Zum Inhalt springen

[Better Login Box] Login auf jeder Page - es geht nicht...

Erstellt am 24. April 2005 · 4 Antworten · letzte Antwort am 26. Mai 2005

Tags: felogin, Frage

hmader ·

Hallo liebe Community,
seit gut zwei Wochen plage ich mich mit folgendem Problem, bei dem ich nicht weiter komme: Ich möchte auf jeder Seite eine Loginbox wie auf typo3.org haben. Also wenn niemand eingeloggt ist, sollen die Login-Felder zu sehen sein, wenn jemand eingeloggt ist, sein Username. Ich kenne die auf verschiedenen Seiten (z.B. http://www.typo3faq.net/index.php?sid=199544&aktion=artikel&rubrik=005&id=38&lang=de) publizierte Lösung, aber ich komme einfach nicht weiter...
Folgenden Code hab' ich ich am Ende des Setup:

#Wenn eine Anmeldung erfolgt ist, wird der folgende Part angezeigt.</b>
[usergroup = *] 
temp.10 = TEXT 
temp.10.data  = TSFE : id 
temp.10.wrap (  
<form action="index.php?id= | " method="post">
<table width=150 border="0" cellpadding="0" cellspacing="0">
                  <tr><td align="right" nowrap> Login: <b><!--###USERNAME###--> </b> &nbsp;&nbsp;<input type="image"
src="fileadmin/pmf/pix/exit.gif" width="18" height="18" alt="Logout" title="Logout" border="0" align="absbottom"></td>

</tr> </table> <input type="hidden" name="logintype" value="logout" > </form>
)

<b>#Ansonsten wird der [else] Zweig angezeigt</b>
[else] 
temp.10 = TEXT 
temp.10.data  = TSFE : id 
temp.10.wrap (
   <form action="index.php?id=<b>446</b>" method="post"> 
                    
    <table width=150 border="0" cellpadding="0" cellspacing="0"> 
                  <tr> 
                        
                    <td align="right"> 
                        <input name="user" type="text" id="user" title="Benutzername" onfocus="if
(this.value==this.defaultValue) this.value=''" value="" size="4" /> 
                        <input name="pass" type="password" id="pass" title="Passwort" onfocus="if
(this.value==this.defaultValue) this.value=''" value="" size="4" > 
                        <input name="image" type="image" title="Login" src="fileadmin/pmf/pix/lock.gif" alt="Login"
align="absbottom" width="18" height="18" border="0"> </td> 
                         <input type="hidden" name="redirect_url"  value="index.php?id= | " /> 
                      </tr> 
                     </table> <input type="hidden" name="logintype" value="login" > <input type="hidden" name="pid"
value="<b>448</b>" > 
              </form> 
)
[global]

Und im Template hab ich den Marker:

marks.LOGIN < temp.10

Allerdings bekomm ich das Ganze nicht zum Laufen - Typo3 scheint den Marker nicht zu erkennen. Hat wer ein ähnliches Problem - was kann ich tun?!?

hmader ·

Nee... geht trotzdem nicht...
Achja... Zu Beginn des Setups steht jetzt marks.LOGIN < temp.10 - der Marker im Template ist natürlich ###LOGIN###...

hardcoder ·

Hi,

[loginUser = *]
temp.login_2 = COA 
temp.login_2 { 

  20 = TEXT 
  20.data  = TSFE : id 
  20.wrap ( 
<form action="index.php?id=|" name="logout" enctype="multipart/form-data" method="post" target="_top">
<table cellspacing="0" cellpadding="0" border="0" width="100%">
<tr><td>
<input style="width:125px;" type="text" value="Logout: <!--###USERNAME###-->" class="loginname" /></td><td width="21"><input type="image" name="submit" src="fileadmin/images/schloss.gif" border="0" alt="Logout" /></td></tr></table><input type="hidden" name="logintype" value="logout" />
<input type="hidden" name="pid" value="3" /></form>
  ) 
} 
[else] 
temp.login_2 = COA 
temp.login_2 { 

  20 = TEXT 
  20.data  = TSFE : id 
  20.wrap (    
<form action="index.php?id=1" name="login" enctype="multipart/form-data" method="post" target="_top">
<table cellspacing="0" cellpadding="0" border="0" width="100%"><tr><td width="60">
<input type="text" name="user" value="Usuário" class="loginname" /></td><td width="5"><img src="clear.gif" width="5" border="0"></td><td width="60"><input type="password" name="pass" value="Senha" class="loginpass" /></td><td align="center"><input type="image" name="submit" src="fileadmin/images/schloss.gif" border="0" alt="Entrar" /></td></tr></table><input type="hidden" name="logintype" value="login" />
<input type="hidden" name="pid" value="3" />
<input type="hidden" name="id" value="|" /></form> 
 )  
} 
[global] 



.
.
.
.
marks.CONT_LEFT < temp.login_2
.
.
.
hmader ·

Juhu... Ich hab's geschafft - es funktioniert alles! Jetzt hab' ich noch eine doofe Frage: Ich hätte gerne, dass der Username, wenn man eingeloggt ist, nicht in einem Formularfeld erscheint, sondern als normaler Text. Einfach das Formular zu killen trau' ich mich nicht, weil dann ja auch der action="index.php?id=|" name="logout" enctype="multipart/form-data" method="post" target="_top"-Teil weg ist...
Wahrscheinlich ist die Lösung eh einfach, und ich steh' nur wieder auf der Leitung... 🙂 Helft mir da bitte raus 🙂
Liebe Grüße aus Wien,
Herwig