Für alle die schon sehnsüchtig warten:
INFO: Fügt nur neue Bereiche hinzu, weil das im Original eingefügt wurde.
ICH ÜBERNEHME KENE HAFTUNG FÜR FEHLER ODER SCHÄDEN
include/templates/user/login.htm
<table width="100%" border="0" cellspacing="0" cellpadding="10">
<tr>
<td>
<form action="index.php?user-login" method="POST">
<fieldset>
<legend><b>{_lang_LOGIN}</b></legend>
<label style="float:left; width:60px;">{_lang_nickname}</label><b style="float:left; text-align:left; width:20px;">:</b><input type="text" style="margin-bottom:2px;" tabindex="1" name="name" maxlength="50" /><br />
<label style="float:left; width:60px;">{_lang_password}</label><b style="float:left; text-align:left; width:20px;">:</b><input type="password" style="margin-bottom:2px;" tabindex="2" maxlength="20" name="pass" /><br />
<!-- Neu Anfang -->
<label style="float:left; width:80px;"></label><input type="checkbox" name="autologin" value="1"> Autologin <br>
<!-- Neu Ende -->
<label style="float:left; width:80px;"> </label><input type="hidden" name="wdlink" value="{WDLINK}" /><input type="submit" style="margin-bottom:2px;" tabindex="3" value="{_lang_login}" name="user_login_sub" /><br /><br />
<label style="padding-left:80px;"><a href="index.php?user-regist">{_lang_registernow}</a></label><br />
<label style="padding-left:80px;"><a href="index.php?user-remind">{_lang_forgottenpassword}?</a></label>
</form>
</td>
</tr>
</table>
{EXPLODE}
{_lang_yourareloged}!
{EXPLODE}
{_lang_login3failure}
include/templates/user/boxen_login.htm
<table width="100%" border="0" cellspacing="0" cellpadding="10">
<tr>
<td>
Hallo <b>{NAME}</b>
<br />
<br />
{NACHRICHTEN}
<a class="box" href="index.php?user-3">{_lang_logout}</a> | <a class="box" href="index.php?user-8">{_lang_profil}</a>
<br>
{ADMIN}
</td>
</tr>
</table>
{EXPLODE}
<table width="100%" border="0" cellspacing="0" cellpadding="10">
<tr>
<td>
<form method="POST">
<input type="text" name="name" size="13" value="{NAME}" onFocus="if (value == '{NAME}') {value = ''}" onBlur="if (value == '') {value = '{NAME}'}" maxlength="50" style="margin-top:5px; " /><br />
<input type="password" size="13" value="{PASS}" onFocus="if (value == '{PASS}') {value = ''}" onBlur="if (value == '') {value = '{PASS}'}" maxlength="20" name="pass" style="margin-top:5px; " /><br />
<input type="hidden" name="wdlink" value="{wdlink}" />
<!-- Neu Anfang -->
<input type="checkbox" name="autologin" value="1"> Autologin <br>
<!-- Neu Ende-->
<input type="submit" name="user_login_sub" value="Login" style="margin-top:5px; " />{regist}
</form>
</td>
</tr>
</table>
include/includes/func/user.php ab Zeile 77
function user_login_check () {
if ( isset ($_POST['user_login_sub']) AND isset ($_POST['name']) AND isset ($_POST['pass']) ) {
debug ('posts vorhanden');
$erg = db_query("SELECT name,id,recht,pass,llogin FROM prefix_user WHERE name = BINARY '".$_POST['name']."'");
if ( db_num_rows($erg) == 1 ) {
debug ('user gefunden');
$row = db_fetch_assoc($erg);
if ( $row['pass'] == md5($_POST['pass']) ) {
debug ('passwort stimmt ... '.$row['name']);
$_SESSION['authname'] = $row['name'];
$_SESSION['authid'] = $row['id'];
$_SESSION['authright'] = $row['recht'];
$_SESSION['lastlogin'] = $row['llogin'];
$_SESSION['authsess'] = session_und_cookie_name();
## Neu Anfang
$autologin = escape($_POST['autologin'], 'integer');
## Neu Ende
db_query("UPDATE prefix_online SET uid = ".$_SESSION['authid']." WHERE sid = '".session_id()."'");
## Diese Zeile ersetzen Anfang
setcookie($_SESSION['authsess'], $row['id'].'='.$row['pass'].'='.$autologin , time() + 31104000, "/" );
## Diese Zeile ersetzen Ende
user_set_grps_and_modules();
return (true);
}
}
global $menu;
$menu->set_url (0, 'user');
$menu->set_url (1, 'login');
}
return ( false );
}
function user_auto_login_check () {
$cn = session_und_cookie_name();
$dat = explode('=',$_COOKIE[$cn]);
$id = $pw = 0;
if (isset($dat[0])) { $id = escape($dat[0], 'integer'); }
if (isset($dat[1])) { $pw = $dat[1]; }
## Neu Anfang
if (isset($dat[2])) { $autologin = $dat[2]; }
if($autologin == 1){
## Neu Ende
debug (' pw ' . $pw );
debug (' id ' . $id );
$erg = db_query("SELECT name,id,recht,pass,llogin FROM prefix_user WHERE id = ".$id);
if (db_num_rows($erg) == 1) {
debug ('benutzer gefunden');
$row = db_fetch_assoc($erg);
if ($row['pass'] == $pw) {
debug ('passwoerter stimmen');
debug ($row['name']);
$_SESSION['authname'] = $row['name'];
$_SESSION['authid'] = $row['id'];
$_SESSION['authright'] = $row['recht'];
$_SESSION['lastlogin'] = $row['llogin'];
$_SESSION['authsess'] = $cn;
db_query("UPDATE prefix_online SET uid = ".$_SESSION['authid']." WHERE sid = '".session_id()."'");
## Zeile Ersten Anfang
setcookie($cn, $row['id'].'='.$row['pass'].'='.$autologin, time() + 31104000, "/" );
## Zeile Ersetzen Ende
return (true);
}
}
## Neu Anfang
}else{
## Neu Ende
user_logout ();
return (false);
## Neu Anfang
}
## Neu Ende
}
Viel Spaß damit!
PS: Alle eingeloggten User werden ausgeloggt, d.h. der Cookie wird beim ersten mal nach dem der Mod aktiv ist, gelöscht!!!!!
Zuletzt modifiziert von boehserdavid am 31.10.2007 - 20:31:48