예제 #1
0
				} else {
					$_SESSION['admin_id'] = $login->fldAdministratorID;
					$_SESSION['admin_name'] = $login->fldAdministratorRealName;
					$links = $ROOT_URL.'_admin/modules_pages/';
					header("Location: $links");
					
				}
		} else {
			$error = "Invalid Security Code";
		}
	}
	
	//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");