diff --git a/profile.php b/profile.php index 4822c61..da95fc0 100644 --- a/profile.php +++ b/profile.php @@ -82,35 +82,34 @@ } else { ?> - - (string)FILTER_SANITIZE_STRING, - 'form_data_passwordinitial' => (string)FILTER_SANITIZE_STRING, - 'form_data_passwordconfirm' => (string)FILTER_SANITIZE_STRING, - 'form_data_firstname' => (string)FILTER_SANITIZE_STRING, - 'form_data_lastname' => (string)FILTER_SANITIZE_STRING, - 'form_data_email' => (string)FILTER_SANITIZE_STRING + 'fd_saveProfile' => (string)FILTER_SANITIZE_STRING, + 'fd_initialPassword' => (string)FILTER_SANITIZE_STRING, + 'fd_confirmPassword' => (string)FILTER_SANITIZE_STRING, + 'fd_firstName' => (string)FILTER_SANITIZE_STRING, + 'fd_lastName' => (string)FILTER_SANITIZE_STRING, + 'fd_userEmail' => (string)FILTER_SANITIZE_STRING ]); $minpasslength = $StaticFunctions->getMinPass(); - if (isset($form_data['form_data_saveprofile'])): - if (empty($form_data['form_data_passwordinitial']) && empty($form_data['form_data_passwordconfirm'])): - $Users->setUserInfo($session_user["0"]["users_id"], $form_data['form_data_firstname'], $form_data['form_data_lastname'], $form_data['form_data_email'], $session_user["0"]["users_usertypeid"], $session_user["0"]["users_password"]); + if (isset($form_data['fd_saveProfile'])): + if (empty($form_data['fd_initialPassword']) && empty($form_data['fd_confirmPassword'])): + $Users->setUserInfo($session_user["0"]["users_id"], $form_data['fd_firstName'], $form_data['fd_lastName'], $form_data['fd_userEmail'], $session_user["0"]["users_usertypeid"], $session_user["0"]["users_password"]); header('Location: profile.php'); - elseif (strlen($form_data['form_data_passwordinitial']) < $minpasslength): + elseif (strlen($form_data['fd_initialPassword']) < $minpasslength): echo "Password must be at least $minpasslength characters."; - elseif (!empty($form_data['form_data_passwordinitial']) && empty($form_data['form_data_passwordconfirm'])): + elseif (!empty($form_data['fd_initialPassword']) && empty($form_data['fd_confirmPassword'])): echo "Please confirm password if you wish to change it"; - elseif ($form_data['form_data_passwordinitial'] != $form_data['form_data_passwordconfirm']): + elseif ($form_data['fd_initialPassword'] != $form_data['fd_confirmPassword']): echo "New passwords do not match"; - elseif (!empty($form_data['form_data_passwordinitial']) && ($form_data['form_data_passwordinitial'] = $form_data['form_data_passwordconfirm'])): + elseif (!empty($form_data['fd_initialPassword']) && ($form_data['fd_initialPassword'] = $form_data['fd_confirmPassword'])): // change pass require_once("src/Misc/PasswordHash.php"); $hasher = new PasswordHash(8, FALSE); - $password = $hasher->HashPassword($form_data['form_data_passwordinitial']); - $Users->setUserInfo($session_user["0"]["users_id"], $form_data['form_data_firstname'], $form_data['form_data_lastname'], $form_data['form_data_email'], $session_user["0"]["users_usertypeid"], $password); + $password = $hasher->HashPassword($form_data['fd_initialPassword']); + $Users->setUserInfo($session_user["0"]["users_id"], $form_data['fd_firstName'], $form_data['fd_lastName'], $form_data['fd_userEmail'], $session_user["0"]["users_usertypeid"], $password); header('Location: profile.php'); endif; endif; @@ -118,24 +117,24 @@ $form_data = filter_input_array(INPUT_POST, [
=$transLang['ACCOUNT_INFO_DESC'] . $minpasslength; ?>
=$transLang['ACCOUNT_INFO_AUTHLOCKED']?>