00001 <?php
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023
00024
00025
00026
00027
00028
00029
00030
00031 require "../include/pre.php";
00032 require $GLOBALS['sys_www_topdir']."/include/account.php";
00033
00034
00035
00036
00037 $res_lostuser = db_query("SELECT * FROM user WHERE confirm_hash='$confirm_hash'");
00038 if (db_numrows($res_lostuser) > 1) {
00039 exit_error(_("Error"),_("This confirm hash exists more than once."));
00040 }
00041 if (db_numrows($res_lostuser) < 1) {
00042 exit_error(_("Error"),_("Invalid confirmation hash."));
00043 }
00044 $row_lostuser = db_fetch_array($res_lostuser);
00045
00046 if ($update && form_check($form_id) && $form_pw && !strcmp($form_pw,$form_pw2)) {
00047 db_query("UPDATE user SET "
00048 . "user_pw='" . md5($form_pw) . "',"
00049 . "confirm_hash='' WHERE "
00050 . "confirm_hash='$confirm_hash'");
00051
00052 form_clean($form_id);
00053 session_redirect($GLOBALS['sys_home']);
00054 }
00055
00056 $HTML->header(array('title'=>_("Lost Password Login")));
00057
00058 print '<h3>'._("Lost Password Login").'</h3>';
00059 print '<p>'._("Welcome").', '.$row_lostuser['user_name'].'.';
00060 print ' '._("You may now change your password").'.</p>';
00061
00062 print form_header($PHP_SELF);
00063
00064 print '<div class="inputfield"><h5>'._("New Password:").'</h5>';
00065 print form_input("password", "form_pw").'</div>';
00066
00067 print '<div class="inputfield"><h5>'._("New Password (repeat):").'</h5>';
00068 print form_input("password", "form_pw2").'</div>';
00069
00070 print form_input("hidden", "confirm_hash", $confirm_hash);
00071 print form_footer();
00072
00073 $HTML->footer(array());
00074
00075 ?>