/* Lost password page */
include 'io.php';
include 'render.php';
/* Theme is set to default before login; since this script is called when
* login fails, we have to set theme to default here, too. */
$theme='default';
/* Handle posted user id and email address. */
$uid = "";
$email = "";
$errmsg = "";
if (isset($_POST['uid']) || isset($_POST['email'])) {
$uid = $_POST['uid'];
$email = $_POST['email'];
if (empty($uid) || empty($email))
$errmsg = "Please provide user name and email address!";
else if (ioLoadUserEmailAddress($uid) != $email)
$errmsg = "User name and email address do not match,
please contact administrator!";
else {
/* mail password */
$pwd = ioLoadUserPassword($uid);
$url = dirname(getGameURL("dummy"));
mail($email, "[OCC] Your Account Info",
"Dear $uid,\n\nyour password is: $pwd\n\n".
"Login at: $url", $mail_header);
/* render page */
renderPageBegin(null,null,null,null);
echo '
Password Recovery
'; echo "Password has been sent to $email.
"; echo '[ Back To Login ]'; renderPageEnd(null); exit; } } /* ---------- Lost Password page ---------- */ renderPageBegin(null,null,null,null); echo 'Password Recovery
'; if (empty($errmsg)) echo 'Please provide your user name and e-mail address for password recovery.
Warning: Password will be sent by e-mail in plain text!
'.$errmsg.'
'; echo '| '; echo ''; echo '[ Back To Login ]'; echo ' |