include_once "../php_inc/config.php"; include_once "../php_inc/auth_config.php"; dbconnect(); $page_title = "Site Administration password reminder"; $page_content = "
Enter you email address below. We will send a reminder to the email address we have on file for your account.
$getInfo
"; $getInfoQuery = mysql_query($getInfo) or die(mysql_error()); $infoNum = mysql_numrows($getInfoQuery); if($infoNum == 1){ while ($row = mysql_fetch_array($getInfoQuery, MYSQL_ASSOC)) { $f_name = $row["f_name"]; $l_name = $row["l_name"]; $email_new = $row["email"]; $password = $row["password"]; } $sendTo = "$email_new"; // send the email to this address $fromAdd = "administration@berkeleyrecycling.org"; // send the email to this address $subLine = "Password Reminder"; // email subject line $mailVals = " Here is your berkeleyrecycling.org Site Administration password: $password This email was generated by a request for an email reminder. If you did not request this reminder, please disregard this message. Log in to the Site Administration here: http://www.berkeleyrecycling.org/admin/ "; // $page_content .= "$mailVals"; $mailYes = mail($sendTo, $subLine, $mailVals, "From: ".$fromAdd."\r\n"); $page_content .= "
A password reminder has been sent to $email_new.
"; }elseif($infoNum > 1){ $page_content .= "We found more than one record with that email address. Please select the proper account from the list below
The email address you supplied does not match any in our records. Please try again.
Enter your current password and the new password below. When accepted, an email will be sent to the address we have on record as a reminder.
"; if($c != ""){ $page_content .= "The passwords you entered did not match. Please try again and be sure your new password is the same in the new password box and in the confirmation box.
"; } if($p != ""){ $page_content .= "The password you entered was not valid. Please review the password guidelines and try again.
"; } if($l != ""){ $page_content .= "The current password you entered was not correct. Please try again. If you have forgotten your current password, click here to have a reminder sent to you.
"; } $page_content .= "$checkPW
"; $checkPWQuery = mysql_query($checkPW) or die(mysql_error()); $PWcheck = mysql_numrows($checkPWQuery); if($PWcheck == 0){ $errorFlag = true; $errorLink .= "&l=1"; } if($new_password != $rpt_password){ $errorFlag = true; $errorLink .= "&c=1"; } if(strlen($new_password) > 16 || strlen($new_password) < 6 || strpos($new_password," ") > -1 || strpos($new_password,";") > -1 || strpos($new_password,"'") > -1 || strpos($new_password,"\"") > -1){ $errorFlag = true; $errorLink .= "&p=1"; } if($errorFlag){ header("location: password.php?act=new$errorLink"); }else{ $forumPW = md5($new_password); $updatePW = "update $table_name set $pw_field = '$new_password' where adm_id = $mbr"; // $page_content .= "$updatePW
"; $updatePWQuery = mysql_query($updatePW) or die(mysql_error()); $getInfo = "select f_name, l_name, email, $pw_field from $table_name where $id_num_field = $mbr and status = 'active'"; // $page_content .= "$getInfo
"; $getInfoQuery = mysql_query($getInfo) or die(mysql_error()); while ($row = mysql_fetch_array($getInfoQuery, MYSQL_ASSOC)) { $f_name = $row["f_name"]; $l_name = $row["l_name"]; $email_new = $row["email"]; $password = $row["password"]; } if($email_new != ""){ $sendTo = "$email_new"; // send the email to this address $fromAdd = "administration@berkeleyrecycling.org"; // send the email to this address $subLine = "Password Update - Berkeley Recycling Administration"; // email subject line $mailVals = " Your Berkeley Recycling Administration password has been changed to: $password This email was generated by requesting a new password. If you did not request a new password, please reply to this email with your information. "; // $page_content .= "$mailVals"; $mailYes = mail($sendTo, $subLine, $mailVals, "From: ".$fromAdd."\r\n"); $email_mess = "An email notice has been sent to $email_new for your records."; }else{ $email_mess = ""; } session_unset(); session_destroy(); $page_title = "Change Your Berkeley Recycling Administration Password"; $page_content .= "
Your password has been changed. $email_mess
Please log-in again to return to the Berkeley Recycling Administration pages.
"; } } $page_content .= "