Date : 1 juin 2015 --> <?php //include include '../../controllers/account/User.php'; // Class User $Pseudo_login = NULL; /**< Username */ $Password_login = NULL; /**< Password of username (tempo.) */ $acces_granted = NULL; /**< Acces granted or denied */ $User = new User(); /**< The User object */ if (verifyUsernameLogin() && verifyPasswordLogin()) { $User->set_email_or_pseudo($_POST['Pseudo_login']); if ($User->check_password($_POST['Password'])) { //return to index.php session_unset(); $_SESSION = array(); /**< PHP session */ $_SESSION['username'] = $User->get_username(); $_SESSION['access'] = true; echo '<script>window.location = "../stations/show_measure.php";</script>'; } else { $acces_granted = "Informations are not valids"; } } /** * @see verifyUsernameLogin() User field can't be empty * @return boolean FALSE == empty, TRUE == Filled
Team : CLouDIA WEB Country: Sherbrooke, Quebec, Canada Date : 1 juin 2015 --> <?php //include include '../../../controllers/account/User.php'; //Verify User in table /** * @var $error Error to send if have one */ $User = new User(); /**< Class User to change the password */ $error = '0'; /**< Error to send if have one */ if ($User->set_email_or_pseudo($_POST['email'])) { $error = $User->update_password($_POST['current_password'], $_POST['new_password']); } else { $error = "e-mail not found!"; } ?> // go to views result <script type="text/javascript"> var result = <?php echo json_encode($error); ?> ; window.location = "../../../views/account/change_password_result.php?change="+result;</script>';