Hier meine Datei Passwort_reminder:
<?php
# Copyright by: Manuel
# Support: www.ilch.de
defined ('main') or die ( 'no direct access' );
$title = $allgAr['title'].' :: Users :: Password Reminder';
$hmenu = $extented_forum_menu.'<a class="smalfont" href="?user">Users</a><b> » </b> Password Reminder'.$extented_forum_menu_sufix;
$design = new design ( $title , $hmenu, 1);
$design->header();
$show = true;
if ( isset ( $_POST['name'] ) ) {
$name = escape($_POST['name'],'string');
$erg = db_query("SELECT email FROM prefix_user WHERE name = BINARY '".$name."'");
if ( db_num_rows($erg) == 1 ) {
$row = db_fetch_assoc($erg);
$new_pass = genkey(8);
$md5_pass = md5($new_pass);
$id = md5 (uniqid (rand()));
db_query("INSERT INTO prefix_usercheck (`check`,name,email,pass,datime,ak)
VALUES ('".$id."','".$name."','".$row['email']."','".$md5_pass."',NOW(),2)");
$page = $_SERVER["HTTP_HOST"].$_SERVER["SCRIPT_NAME"];
$confirmlinktext = "\n".$lang['registconfirm']."\n\n".sprintf($lang['registconfirmlink'], $page, $id );
$regmail = sprintf($lang['newpasswordmail'], $name, $confirmlinktext, $new_pass);
icmail($row['email'],'Password Reminder',$regmail); # email an user
echo $lang['youhavereceivedaemail'];
$show = false;
} else {
echo $lang['namenotfound'];
}
}
if ( $show ) {
$tpl = new tpl ( 'user/new_pass' );
$tpl->out(0);
}
$design->footer();
?>
und hier confirm.php:
<?php
# Copyright by: Manuel
# Support: www.ilch.de
defined ('main') or die ( 'no direct access' );
$title = $allgAr['title'].' :: User :: Confirm';
$hmenu = $extented_forum_menu.'<a class="smalfont" href="?user">User</a><b> » </b>Confirm'.$extented_forum_menu_sufix;
$design = new design ( $title , $hmenu, 1);
$design->header();
$abgelaufen = time() - 2592000; # 30 tage
$abgelaufen = date('Y-m-d H:i:s',$abgelaufen);
db_query("DELETE FROM prefix_usercheck WHERE datime < '".$abgelaufen."'");
$erg = db_query("SELECT * FROM prefix_usercheck WHERE `check` = '".escape($_GET['check'], 'string')."'");
if ( db_num_rows($erg) == 1 ) {
$row = db_fetch_assoc($erg);
switch ( $row['ak'] ) {
# confirm regist
case 1 :
if ( 0 == db_count_query("SELECT COUNT(*) FROM prefix_user WHERE name = BINARY '".$row['name']."'") ) {
db_query("INSERT INTO prefix_user (name,pass,recht,regist,llogin,email,status,opt_mail,opt_pm)
VALUES('".$row['name']."','".$row['pass']."',-2,'".time()."','".time()."','".$row['email']."',1,1,1)");
$userid = @db_result(db_query("SELECT id FROM prefix_user WHERE name = '".$row['name']."'"),0);
$page = 'http://'.$_SERVER["HTTP_HOST"].$_SERVER["SCRIPT_NAME"].'?user-details-'.$userid;
$mail = $allgAr['adminMail']; //Administrator eMail im Adminbereich/Konfiguration
$title = 'Neue Registrierung';
$text = 'Hallo Stefan,<br/><br/> soeben hat sich <a href="'.$page.'">'.$row['name'].'</a> auf www.realistic-minecraft.de angemeldet!<br/><br/>bis dann<br/>Keksi';
icmail($mail,$title,$text,"","true");
echo $lang['confirmregist'];
} else {
echo $lang['confirmregistfailed'];
}
break;
# confirm new email
case 3 :
list ($id, $muell) = explode('||', $row['check']);
db_query("UPDATE prefix_user SET email = '".$row['email']."' WHERE id = ". escape($id, 'integer'));
echo $lang['confirmemail'];
break;
# ak 4 wurde besetzt fuer joinus anfragen...
case 4 : break;
# ak 5 remove account
case 5:
list ($id, $muell) = explode('-remove-', $row['check']);
if ($id != $_SESSION['authid']) {
break;
}
user_remove($id);
wd('index.php','Dein Account wurde gelöscht. Du wirst nun auf die Startseite geleitet.',7);
break;
}
db_query("DELETE FROM prefix_usercheck WHERE `check` = '".$row['check']."'");
} else {
echo $lang['confirmfailure'];
}
$design->footer();
?>
vielen dank im voraus.
Lg