USR); $EMAIL = $data->EMAIL; if(strtolower($_POST['username']) == $USR) { # create new random password $random = createRandomPassword(); // $random = '1234'; # create backup createBak($file, GSUSERSPATH, GSBACKUSERSPATH); # create password change trigger file $flagfile = GSUSERSPATH . _id($USR).".xml.reset"; copy(GSUSERSPATH . $file, $flagfile); # change password and resave xml file $data->PWD = passhash($random); $status = XMLsave($data, GSUSERSPATH . $file); # send the email with the new password $subject = $site_full_name .' '. i18n_r('RESET_PASSWORD') .' '. i18n_r('ATTEMPT'); $message = "

". cl($SITENAME) ." ". i18n_r('RESET_PASSWORD') ." ". i18n_r('ATTEMPT').'

'; $message .= "

". i18n_r('LABEL_USERNAME').": ". $USR.""; $message .= "
". i18n_r('NEW_PASSWORD').": ". $random.""; $message .= '
'. i18n_r('EMAIL_LOGIN') .': '.$SITEURL . $GSADMIN.'/

'; exec_action('resetpw-success'); $status = sendmail($EMAIL,$subject,$message); # show the result of the reset attempt usleep($randSleep); $status = 'success'; redirect("resetpassword.php?upd=pwd-".$status); } else{ # username doesnt match listed xml username exec_action('resetpw-error'); usleep($randSleep); redirect("resetpassword.php?upd=pwd-success"); } } else { # no user exists for this username, but do not show this to the submitter usleep($randSleep); redirect("resetpassword.php?upd=pwd-success"); } } else { # no username was submitted redirect("resetpassword.php?upd=pwd-error"); } } get_template('header', cl($SITENAME).' » '.i18n_r('RESET_PASSWORD')); ?>

«   |   »