Zum Inhalt springen

Mehrere Benutzegruppen - eigenes Skript - LogOut

Erstellt am 21. Juni 2006 · Noch keine Antworten

Tags: felogin, PHP, Frage

kanti ·

Hallo,

ich habe für den LogIn-Bereich ein eigenses PHP-Skript erstellt, was je nach Usergroupe andere Daten anzeigt:

Usergruppe1 - Name, Vorname, Status
Usergruppe2 - Name,Vorname, Firma

usw.

Bis jetzt gabe es keine Problem da nur eine Website damit bestückt ist. Nun möchte ich es für mehrere Website anwenden.

Was eigentlich kein Problem ist, nur wenn sich jemand ausloggt, er nicht unbedingt auf die Ausgangsseite geschickt wird.

Um folgendes dynamisch zu ändern:

<form action='index.php?id=".[b]$pid[/b]."' method='post'>

Würde ich gerne in diesem Skript einen Wert auslesen, den ich im Template.Constante eingetragen habe. Kann mir jemand ein Tip geben wie ich an diese Daten kommen? Kann ich da mit $GLOBALS["TSFE"] zugreifen?

Über eine Antwort würde ich mich freuen!

Grüsse Kanti

##############################################################################
Habe das Problem gelöst, wie folgt

im Setup login Box eingebunden

####loginbox#################
temp.10 =TEXT
temp.10.data = TSFE : id
temp.10.wrap (

<form action="index.php?id={$PageIDhome}" method="post"> 
                    
    <table width="100%" border="0" cellpadding="0" cellspacing="0"> 
       <tr> 
          <td width="12">&nbsp;</td>
          <td colspan="3">Bitte einloggen!</td>
        </tr>
        <tr>
          <td height="15" colspan="4">&nbsp;</td>
        </tr>
        <tr>
          <td>&nbsp;</td>     
          <td>User</td>
          <td>&nbsp;</td> 
          <td align="right"><input name="user" type="text" id="user" title="Benutzername" onfocus="if
                                   (this.value==this.defaultValue) this.value=''" value="Username" size="20"  /> 
          </td>
      </tr>
      <tr><td height="15" colspan="4">&nbsp;</td></tr>
      <tr>
        <td>&nbsp;</td>
        <td>PIN</td>
        <td>&nbsp;</td>
        <td align="right"><input name="pass" type="password" id="pass" title="Passwort" onfocus="if
                                 (this.value==this.defaultValue) this.value=''" value="Passwort" size="20" />
        </td>
    </tr>
    <tr><td colspan="4" height="15">&nbsp;</td></tr>
    <tr>
      <td align="right" colspan="4"> 
         <input name="image" type="image" title="Login" src="{$LoginJpg}" alt="Login"
align="absbottom" width="18" height="18" border="0" /> 
        <input type="hidden" name="logintype" value="login" />
        <input type="hidden" name="pid" value="{$PageIDNewLoginBox}" /> 
        <input type="hidden" name="redirect_url" value="index.php?id= | " /> 

        </td>  
     </tr> 
  </table>
   
 </form> 

)


##################################
[usergroup = *]
seite.10.marks.login = PHP_SCRIPT
seite.10.marks.login {
    myVar = {$PageIDhome}
    file =  fileadmin/script/test_script.php
}

[else]
seite.10.marks.login < temp.10
[GLOBAL]
##########loginbox ende###################

PageIDhome wird in Constant mit der PageId der Seite, wo nach LogOut geleitet werden soll, besetzt.

test_script.php

$lastname= $GLOBALS["TSFE"]->fe_user->user["name"];
$firstname = $GLOBALS["TSFE"]->fe_user->user["tx_fecatering_firstname"];
$kdnr = $GLOBALS["TSFE"]->fe_user->user["username"];
$catstatus=$GLOBALS["TSFE"]->fe_user->user["tx_fecatering_catstatus"];
$pid=$GLOBALS["TSFE"]->fe_user->user["pid"];
$HomId=$conf['myVar'];

...
if ($usergroup[$i] == "CatererAll"){
$content .= "<form action='index.php?id=".$HomId."' method='post'><table border='0' cellpadding='0' cellspacing='0' width='100%'>\n\r";
$content .= "<tr>\n\r<td width='13'>&nbsp;</td><td>LogIn:<br><strong>".$firstname." ".$lastname."<br>".$catstatus."</strong></td><td valign='bottom'>&nbsp;<input type='image' src='fileadmin/pic/logout.jpg' width='18' height='18' alt='Logout' title='Logout' border='0' align='right'></td></tr>\n\r";
$content .= "<tr><td colspan='3' height='5'></td></tr>";
$content .= "<tr><td></td><td colspan='2'class='headline' height='1'><img height='1' src='fileadmin/pic/tran.gif' width='100%' border='0' alt=''></td></tr>";
$content .= "</table>\n\r<input type='hidden' name='logintype' value='logout'>\n\r</form>";
}