[TYPO3-german] FE_USERS - Problem

Dennis Bork dennis.bork at dkb-online.com
Wed Sep 20 15:14:22 CEST 2006


Ich habe folgendes Problem:

Ich habe FE-User, die sich erfolgreich registriert haben. Doch leider 
kann sich seit kurzem keiner von Ihnen mehr einloggen. Ich habe den 
Login über ein PHP-Script eingebunden. Ich hoffe sehr, das mir jemand 
von euch dabei helfen kann.


Hier nun mein PHP-Script:

<?php
/*Login, Logout und Status-Anzeige
in einer Typo3-DB (MySQL)
*/

//Variablen
/*$user = $_POST["user"];
$fname = $_POST["fname"];
$sname = $_POST["sname"];
$pwd = $_POST["pwd"];
$pwd1 = $_POST["pwd1"];
$pwd2 = $_POST["pwd2"];
$step = $_POST["step"];*/

//*********************************************************************Konstanten
//$URL = "/index.php?id=".$_GET["id"]; //mit? auf jeden Fall
$LANG = array("de","en");
$lang = $LANG[$GLOBALS["TSFE"]->sys_language_uid];
//$lang = $LANG[0];

//Login-Check
if ($GLOBALS["TSFE"]->loginUser){
   $GLOBALS["TSFE"]->set_no_cache();
   $fname = $GLOBALS["TSFE"]->fe_user->user["name"];
   $sname = $GLOBALS["TSFE"]->fe_user->user["title"];
   $user = $GLOBALS["TSFE"]->fe_user->user["username"];
   //print("GLOBALS->loginUser positiv\n");
}


$TEXT = array(
   //"this" => 
$_SERVER["REDIRECT_URL"].'?&L='.$GLOBALS["TSFE"]->sys_language_uid,
   "this" => 
"/index.php?id=".$GLOBALS["TSFE"]->id.'&L='.$GLOBALS["TSFE"]->sys_language_uid,
   "header" => array(
     array("de"=>"Login-Status","en"=>"Login status")
   ),
   "final" => array(
     array("de"=>"Angemeldet als: ", "en"=>"Log on as: ")
   ),
   "error" => array(
     array("de"=>"Login fehlgeschlagen. Bitte überprüfen Sie 
Benutzername und Pa&szlig;wort.", "en"=>"Login failure. Please check 
username and password.")
   ),
   "img" => array(
     array("de"=>'<img src="img/buttons/registrieren.gif" width="75" 
height="20" alt="registrieren" title="registrieren" border="0">',
     "en"=>'<img src="img/buttons/createlogin.gif" width="75" 
height="20" alt="create login" title="create login" border="0">')
   ),
   "link" => array(
     "login"=>"/84.0.html?&L=".$GLOBALS["TSFE"]->sys_language_uid,
     "createlogin"=>"/740.0.html?&L=".$GLOBALS["TSFE"]->sys_language_uid,
     "logout" => 
"http://www.dai-labor.de/188.0.html?&L=".$GLOBALS["TSFE"]->sys_language_uid
   )
   /*"" => array(
     array("de"=>"", "en"=>"")
   )*/
);

//*******************************************************************Funktionen
function show_login_form(){
   global $TEXT;
   global $lang;

   echo('<FORM name="login" method="post" action="'.$TEXT["this"].'">');
   //echo('<a href="'.$_SERVER["REDIRECT_URL"].'">Login</a><br>');
   echo('<a href="'.$TEXT["link"]["login"].'">Login</a><br>');
   echo('<input class="inputfields" style="height:18px; width:60px;" 
name="user" type="text" value="" title="Enter your username here" 
onfocus="if (this.value==this.defaultValue) this.value=\'\'" /> ');
   echo('<input class="inputfields" style="height:18px; width:60px;" 
name="pass" type="password" value="" title="Enter your password here" 
onfocus="if (this.value==this.defaultValue) this.value=\'\'" /> ');
   echo('<input class="inputbutton" type="image" 
src="/img/buttons/ok.gif" width="22" height="20" alt="ok" title="ok" 
border="0" />');
   echo('<input type="hidden" name="logintype" value="login" />');
   echo('<input type="hidden" name="pid" value="86" />');
   echo('</form>');
   echo('<a 
href="'.$TEXT["link"]["createlogin"].'">'.$TEXT["img"][0][$lang].'</a>');
   echo('<br><br><a 
href="http://www.dai-labor.de/index.php?id=557">Passwort Vergessen?</a>');
   echo('</FORM>'."\n");
}
function show_logout_form($user){
   global $TEXT;
   global $lang;

   echo('<FORM name="logout" method="post" 
action="'.$TEXT["link"]["logout"].'">');
   echo(/*$TEXT["final"][0][$lang].*/'['.$user.']&nbsp;');
   echo('<input type="submit" value="logout" />');
   echo('<input type="hidden" name="logintype" value="logout" />');
   //echo('<input type="hidden" name="pid" value="86" />');
   echo('</FORM>'."\n");
}

//****************************************************************************HP
//echo('<h3>'.$TEXT["header"][0][$lang].'</h3>'."\n");
/*echo('user: #'.$user."#\n");
echo('fname: '.$fname."\n");
echo('sname: '.$sname."\n");*/
//echo($TEXT["this"]."<br>\n");
$error=false;
if (!$GLOBALS["TSFE"]->fe_user->user["username"]){
   // is logout
   if ($logintype == 'login') echo('<div 
class="form_error">'.$TEXT["error"][0][$lang]."</div><br />\n");
   show_login_form();
} else {
   // is login
   show_logout_form($user);
}

?>



More information about the TYPO3-german mailing list