<?php require_once('includes/requirepost.inc.php'); require_once('includes/validation.inc.php'); if (is_member()) die; $login=TPOST('login'); $email=TPOST('email'); if (!($login && $email)) { header("Location: ./password.reset.request?op=fail.nouser"); return; } $DBConn->connect(); $emaillist=db_load_email_with_login($DBConn,$email,$login); if ($emaillist) { $vcinfo=validation_generate_code($DBConn,$email.' '.$login); $dataset['user.login']=$login; $dataset['request.time.utc']=seconds_to_datetime(); $dataset['user.ip']=REMOTE_ADDR(); $dataset['server.name']=$Config->SERVER_DOMAIN; $dataset['authcode']=base64_encode(serialize($vcinfo)); $dataset['expire.days']=$Config->VALIDATION_LIFE_DAYS; $mail=prepare_email_from_templates('passwd.reset.email.subject','passwd.reset.email.content',$dataset); sendmail($Config->MailerAddress,$email,$mail['subject'],$mail['body']); header("Location: ./password.reset.mailsent"); } else { header("Location: ./password.reset.request?op=fail.nouser"); } ?>