"; if (strlen($account) > 4) $errors.="Account numbers are only 4 Digits.
"; if (!is_numeric($account)) $errors.="Account Number must be a number.
"; if ($type == "F"){ checkAccuracy("frpUsers", $username, $account); }// end if if ($type == "S"){ checkAccuracy("recyclingUsers", $username, $account); }// end if }// end if function checkAccuracy ($table, $username, $account){ global $errors; $statement = "SELECT email FROM $table WHERE userName = '".$username."' and account = '".$account."'"; $result = mysql_query($statement); $nameCheck = mysql_num_rows($result); if ($nameCheck == 1){ while($row = mysql_fetch_array($result)) $email = $row['0']; updatePass($table, $username, $account, $email); }// end if else if ($nameCheck == 0){ $errors.="User Name and Account Number do not Match.
"; unset($account); }// end else if else $errors.="An error occurred selecting your account, please email techsupport@metro-grp.com with this problem and include your username and account number.
"; }// end function function updatePass ($table, $username, $account, $email){ global $errors; $password = makePassword(); $md5Pass = md5($password); $command = "UPDATE $table SET password = '".$md5Pass."' WHERE username='".$username."' AND account='".$account."'"; $result = mysql_query($command); if ($result == false) $errors.="An error occurred while resetting password. Try again or email us.
"; else if ($result == true){ sendEmail($email, $username, $password); $errors.="Password Reset.
Temporary password emailed to $email
"; }// end else }// end function function makePassword (){ $seed = "abcdefghijkmnpqrstuvwxy23456789"; srand((double)microtime()*1000000); $i = 0; while ($i <= 7){ $num = rand() % 33; $tmp = substr($seed, $num, 1); $pass = $pass.$tmp; $i++; }// end while return $pass; }// end function function sendEmail($email, $username, $password){ $subject = "Your metro-grp.com Login"; $message = "Dear $username, Your password has been reset to the following temporary password. Temporary Password: $password Please Change your password upon logging in. Go to 'Account Settings' and enter the password above into the 'Current Password' field. Then enter a new password into 'New Password' field and re-type that password again into the 'Confirm Password' box. Press 'Submit'. If you have any trouble loging in, please email techsupport@metro-grp.com with your Username, and Account Number and a discription of your problem. Thank You. Metro Group Inc. --- This message was generated automatically, do not reply. --- "; mail($email, $subject, $message, "From: Metro Group Inc. \n"); }// end function ?> Metro Group Inc. | Home

Reset Account Password
  Please fill out the following information. The password will be reset to a temporary password and will be emailed to the address on the account. The submit button will enable when all data is valid. ALL FIELDS ARE REQUIRED.
Account Type:
User Name:
(5 to 15 characters at least 1 non-numeric)
Account Number:4 Digits
Frequent Recycler - Located on Frequent Recycler Card
Scrap Vendor - Located on any Pickup Ticket left of company name

© Copyright 2005, Metro Group Inc. 401 West 900 South Salt Lake City, Utah 84101