Zum Inhalt springen

newloginbox einrichten für mm_forum

Erstellt am 13. Juni 2007 · Noch keine Antworten

Tags: felogin, Tipp

Unbekannter Benutzer ·

Hallo,
vielleicht helfen nachfolgende Notizen (habe diese etwas schöner gemacht) auch anderen:

Da mm_forum keine eigene Sessioninitialisierung (Anmeldung + Abmeldung) hat und nur zur Verfügung gestellte Sessiondaten nutzt, wird zuallererst eine Extension benötigt, die dies übernimmt.

I. newloginbox-Extension

1. Informative Links:
http://typo3.org/documentation/document-library/tutorials/tut_newloginbox_de/0.0.1/view/1/2/
http://typo3.org/documentation/document-library/extension-manuals/newloginbox/3.0.1/view/

2. newloginbox-Extension in Typo3 importieren + installieren

3. Falls nicht vorhanden: Eine Seite als Typ "SysOrdner" anlegen (dient der Ablage der Userdaten...)

4. Nun bieten sich mehrere Wege an, die Loginfunktionalität zu nutzen:

4.1 Das newloginbox-Plugin als Content irgendwo plazieren. Bei den Seiteneigenschaften der jeweiligen Seiten, die dieses nutzen, muss der Seitentyp auf "Erweitert" gestellt werden und bei "Allgemeine Datensatzsammlung" muss die unter Punkt 3 angelegte Seite zugeordnet werden. Sonst weiß das Plugin nicht, wo seine Daten liegen. Und bei Bedarf ein Extension-Template anlegen mit beispielsweise folgendem Script (weiteres in pi1/locallang.php ersichtlich):

plugin.tx_newloginbox_pi3._CSS_DEFAULT_STYLE =
plugin.tx_newloginbox_pi1._LOCAL_LANG {  
  de {
    oLabel_header_welcome =Herzlich Willkommen bei Bin1Tarif
  }
  tr {
    oLabel_header_welcome =Bin1Tarif'e hoş geldiniz
  }
}

4.2 Über Typoscript im Template die newloginbox initialisieren. Interessante links:
http://typo3-nuernberg.de/newloginbox-einbinden.html oder
http://www.typo3wizard.com/de/snippets/cool-stuff-typoscript/loginbox-per-typoscript-mit-kb-md5feuser-und-newloginbox.html

4.3 Mein Favorit: per Typoscript im Template ein spezielles Template für die newloginbox nutzen.
4.3.1 Erstmal im eigenen Template einen hierfür geeigneten Marker (z.B. ###LOGIN###) definieren.
4.3.2 Das vordefinierte Template "newloginbox_00.html" im Extension-Res-Verzeichnis kopieren.
4.3.3 Template anpassen und eventuell eigene CSS-Klassen zuweisen.
Hier ein Auszug meiner Variante:

<!--=========================================================-->
<p class="separator"><a href="#navigation">Navigation</a> | <a href="#">To top</a></p>
<!--=========================================================-->

<a name="template_login"></a><h1>TEMPLATE_LOGIN</h1>
<p>This is the template for the login form with/without the 'forgot password' link.</p>
<!--###TEMPLATE_LOGIN###-->
<form action="###ACTION_URI###" target="_top" method="post" onsubmit="###ON_SUBMIT###">
  <label for="user">###USERNAME_LABEL###</label>
  <input type="text" id="user" name="user" value="" /><br />
  <label for="pass">###PASSWORD_LABEL###</label>
  <input type="password" id="pass" name="pass" value="" /><br />
  <!--###PERMALOGIN_VALID###-->
  <label for="permalogin">###PERMALOGIN###</label>
  <input name="permalogin" value="0" type="hidden" permalogin_hiddenfield_attributes="" id="permaloginHiddenField" /><br />
  <input name="permalogin" value="1" type="checkbox" permalogin_checkbox_attributes="" id="permalogin" onclick="document.getElementById('permaloginHiddenField').disabled = this.checked;" /><br />
  <!--###PERMALOGIN_VALID###-->
  <input type="submit" name="submit" value="###LOGIN_LABEL###" />
  <input type="hidden" name="logintype" value="login" />
  <input type="hidden" name="pid" value="###STORAGE_PID###" />
  <input type="hidden" name="redirect_url" value="###REDIRECT_URL###" />
###EXTRA_HIDDEN###
</form>
<!--###FORGOTP_VALID###-->
<p><!--###FORGOTP_LINK###-->###FORGOT_PASSWORD###<!--###FORGOTP_LINK###--></p>
<!--###FORGOTP_VALID###-->
<!--###TEMPLATE_LOGIN###-->

<!--=========================================================-->
<p class="separator"><a href="#navigation">Navigation</a> | <a href="#">To top</a></p>
<!--=========================================================-->

<a name="template_logout"></a><h1>TEMPLATE_LOGOUT</h1>
<p>This is the template shown after you logged in or displaying the status of current connection.</p>

<!--###TEMPLATE_LOGOUT###-->
<form action="###ACTION_URI###" target="_top" method="post">
  ###USERNAME_LABEL###
  ###USERNAME###<br />
  <input type="submit" name="submit" value="###LOGOUT_LABEL###" />
  <input type="hidden" name="logintype" value="logout" />
  <input type="hidden" name="pid" value="###STORAGE_PID###" />
</form>
<!--###TEMPLATE_LOGOUT###-->

<!--=========================================================-->
<p class="separator"><a href="#navigation">Navigation</a> | <a href="#">To top</a></p>
<!--=========================================================-->
<a name="template_success"></a><h1>TEMPLATE_SUCCESS</h1>
<p>This is the template displayed when successfull login.</p>

<!--###TEMPLATE_SUCCESS###-->
<form action="###ACTION_URI###" target="_top" method="post">
  ###USERNAME_LABEL###
  ###USERNAME###<br />
  <input type="submit" name="submit" value="###LOGOUT_LABEL###" />
  <input type="hidden" name="logintype" value="logout" />
  <input type="hidden" name="pid" value="###STORAGE_PID###" />
</form>
<!--###TEMPLATE_SUCCESS###-->

<!--=========================================================-->
<p class="separator"><a href="#navigation">Navigation</a> | <a href="#">To top</a></p>
<!--=========================================================-->

<a name="template_forgot"></a><h1>TEMPLATE_FORGOT</h1>
<p>This is the template made to mail you back your password to the adress you've registered.</p>

<!--###TEMPLATE_FORGOT###-->
<p>###FORGOT_PASSWORD_ENTEREMAIL###</p>
<form action="###ACTION_URI###" method="post">
  <label for="###PREFIXID###[DATA][forgot_email]">###EMAIL_LABEL###</label>
  <input type="text" name="###PREFIXID###[DATA][forgot_email]" /><br />
  <input type="submit" name="submit" value="###SEND_PASSWORD###" />
</form>
<!--###TEMPLATE_FORGOT###-->

<!--=========================================================-->
<p class="separator"><a href="#navigation">Navigation</a> | <a href="#">To top</a></p>
<!--=========================================================-->

<a name="template_forgot_sent"></a><h1>TEMPLATE_FORGOT_SENT</h1>
<p>This is the template shown when password has been mailed back.</p>

<!--###TEMPLATE_FORGOT_SENT###-->
<p>###STATUS_MESSAGE###</p>
<p>###FORGOT_PASSWORD_BACKTOLOGIN###</p>
<!--###TEMPLATE_FORGOT_SENT###-->

<!--=========================================================-->
<p class="separator"><a href="#navigation">Navigation</a> | <a href="#">To top</a></p>
<!--=========================================================-->

4.3.4 Habe im Anschluss dann in meinem Root-Template folgendes TypoScript hinzugefügt:

### PLUGIN: newloginbox ###
### Textinitialisierung
### muss vor dem Aufruf plaziert werden!
plugin.tx_newloginbox_pi1._LOCAL_LANG { 
  de {
    username =Ihr Nickname:
    password =Ihr Password:
    oLabel_header_welcome =
    forgot_password =Password vergessen ...
    oLabel_msg_welcome =
    login =Login
    oLabel_header_success =
    oLabel_msg_success =Ihr Nickname: ###USER###
    oLabel_header_logout =
    oLabel_msg_logout =
    oLabel_header_status =
    oLabel_msg_status =
    forgot_password_enterEmail =Tragen Sie bitte Ihre uns bekannte eMail-Adresse ein (Gross-/Kleinschreibung bitte beachten!).
    send_password =Password mir zusenden
    your_email =Ihre eMail-Adresse:
    logout =Logout
    forgot_password_emailSent =Ihr Password wurde zur angegebenen eMail-Adresse %s zugeschickt.
    forgot_password_backToLogin =Zurück zum Login
    forgot_password_pswmsg (
Ihr vergessenes Bin1Tarif-Password
Hallo %s,
Ihr Nickname: %s,
Ihr Password: %s

Ihr Bin1Tarif
)
    forgot_password_no_pswmsg (
Ihr vergessenes Bin1Tarif-Password
Hallo %s,

kann es sein, dass sich zwischenzeitlich Ihre eMail-Adresse geändert hat und Sie diese bei Bin1Tarif noch nicht aktualisiert hatten? Denn wir haben keinen registrierten Bin1Tarif-Benutzer mit dieser eMail-Adresse. Melden Sie sich doch neu bei uns an.

Ihr Bin1Tarif
)
  }
  tr {
    username =Nick isminiz:
    password =&#350;ifreniz:
    oLabel_header_welcome =
    forgot_password =&#350;ifremi unuttum ...
    oLabel_msg_welcome =
    login =Login
    oLabel_header_success =
    oLabel_msg_success =Nick isminiz: ###USER###
    oLabel_header_logout =
    oLabel_msg_logout =
    oLabel_header_status =
    oLabel_msg_status =
    forgot_password_enterEmail =Bize berlirtti&#287;iniz ePosta adresini girin (dikkatinize: büyük ve küçük harf ayr&#305;m ediliyor).
    send_password =&#350;ifremi bana yolla
    your_email =Sizin ePosta adresiniz:
    logout =Logout
    forgot_password_emailSent =&#350;ifreniz berlirtti&#287;iniz ePosta adresine %s gönderildi.
    forgot_password_backToLogin =Login'e geri dön
    forgot_password_pswmsg (
Unuttu&#287;unuz Bin1Tarif-&#350;ifreniz
Merhaba %s,
Nick isminiz: %s,
&#350;ifreniz: %s

Sizin Bin1Tarif
www.bin1tarif.de
)
    forgot_password_no_pswmsg (
Unuttu&#287;unuz Bin1Tarif-&#350;ifreniz
Merhaba %s,

ePosta adresiniz de&#287;i&#351;mi&#351; olabilirmi ve yeni ePosta adresinizi Bin1Tarife bildirmemi&#351; olabilirmisiniz? Bu ePosta adresi alt&#305;nda kay&#305;tl&#305; Bin1Tarif üyemiz çünkü yok. Yeni üye kay&#305;d&#305;n&#305; t&#305;klay&#305;n.

Sizin Bin1Tarif
www.bin1tarif.de
)
  }
}

### Fallunterscheidung, damit beim Logout ein Redirect auf X-beliebige Seite erfolgt
[usergroup = *]  # Redirect auf SeitenID 43
  temp.newlogin = COA_INT
  temp.newlogin {
    20 = TEXT
    20.typolink.parameter = 43
    20.typolink.returnLast = url
    20.wrap = <div class="tx-newloginbox-pi1"><form action="|" target="_top" method="post">
    30 = COA
    30 {
      10 = TEXT
      10.value = <input type="submit" name="submit" value="Logout" />
      20 = TEXT
      20.value = <input type="hidden" name="logintype" value="logout" />
      30 = TEXT
      30.value = <input type="hidden" name="pid" value="37" />
      40 = TEXT
      40.value = </form></div>
    }
  }
  r.10.marks.LOGIN < temp.newlogin
[else]
  r.10.marks.LOGIN < plugin.tx_newloginbox_pi1
  r.10.marks.LOGIN {
    templateFile = fileadmin/bin1tarif/newloginbox.html
#    templateFile = EXT:newloginbox/res/newloginbox_00.html
    storagePid = 37
    showForgotPassword = 1
    email_from = noreply@bin1tarif.de
  }
[GLOBAL]

Bei der Zugriffsbeschränkung der Seiten kann man schon mal Fehler machen. Beispielsweise stand ich irritiert vor dem Problem, dass ich nach erfolgreicher Anmeldung "Page not found" erhielt.

Ein hierzu passender guter Thread ist
#348053

Gruss Mensch