Exemplo n.º 1
0
	//recover your password
	if(isset($_POST['recover'])) {
		$email = $_POST['email'];
		$admin = Administrator::findAdministratorByEmail($email);
	
	if(empty($admin)) {
			$error = "Email address not on list";
	} else {
		$username = $admin->fldAdministratorusername;
		$admin_name = $admin->fldAdministratorRealName;
		$admin_id = $admin->fldAdministratorID;
		
		
		$password = "******";
		//change the password
		Administrator::changePassword($admin_id,$password);
		
		//send email to owner
		require("includes/class.phpmailer.php");
  	    $mail = new PHPMailer();
				 $to = $email;	
				$name = $admin_name;
				$from = "*****@*****.**";	
				$mail->From = $from;
				$mail->FromName = "Red and White Marketing";
				$mail->AddAddress($to);
				$mail->IsHTML(true); // set email format to HTML
				$all_html = implode('',file('includes/change_password.php'));
				
				$all_html = str_replace("%%name%%", $admin_name, $all_html);
				$all_html = str_replace("%%username%%", $username, $all_html);