/**
* function to reset a user's password
* @param: $email
*/
function resetPassword($email) {
	global $datetime,$borrowercentralCuser,$home_domain;

	$query=0;
	$query=mysqlquery("select * from vl_users where email='$email'");
	if(mysqlnumrows($query)) {	
		//reset the password and mail the user
		$newPassword=0;
		$newPassword=generatePassword();
		//now reset the password		
		mysqlquery("update vl_users set 
					xp='".borrowercentralcSimpleEncrypt($newPassword)."',
					password='******' 
					where email='$email'");
					
		//inform the user by email
		//subject
		$subject=0;
		$subject="Password Reset";
	
		//variables
		$password=0;
		$password=$newPassword;
				
		//the message
		$message=0;
		$message="
		Your password has been reset. 
		
		Your new password is: $password 
		
		To preserve your privacy, we recommend that you login and change your password. 
		
		Kind regards, 
		System Team";

		//mail the user
		sendPlainEmail($email,$subject,$message);
	}
}
Exemple #2
0
$message="
Your Password on the \"VL\" System has been changed to the following credentials: 

Email: $email
Password: $password 

LOGIN INSTRUCTIONS:
1. Open Internet Explorer
2. Visit http://$default_systemIP/ from your Web Browser.
3. Login with your Email and Password

Kind regards, 
System Team";
							
					//mail the user
					sendPlainEmail($email,$from,$fromName,$subject,"",$message);

					//flag
					$modified=1;
				}
            break;
            case activate:
				//log table change
				logTableChange("vl_users","activate",$id,getDetailedTableInfo2("vl_users","id='$id'","activate"),"1");
				//update vl_users
				mysqlquery("update vl_users set active='1' where id='$id'");
				//flag
				$id=0;
				$activated=1;
            break;
            case deactivate: