From f5e972c030675f46cda543e13da1b787457e070b Mon Sep 17 00:00:00 2001 From: cflip <36554078+cflip@users.noreply.github.com> Date: Wed, 23 Jun 2021 15:21:12 -0600 Subject: Add the rest of the changes --- change_passw.php | 132 +++++++++++++++++++++++++++---------------------------- 1 file changed, 66 insertions(+), 66 deletions(-) mode change 100644 => 100755 change_passw.php (limited to 'change_passw.php') diff --git a/change_passw.php b/change_passw.php old mode 100644 new mode 100755 index 31e0e0d..82db6d3 --- a/change_passw.php +++ b/change_passw.php @@ -1,66 +1,66 @@ -is_signed_in()) { - $errors = array(); - $user_pass = ""; - - if (empty($_POST['user_pass'])) { - $errors[] = "You must provide a password."; - } else { - $user_pass = $_POST['user_pass']; - $pass_check = $_POST['user_pass_check']; - - if (preg_match("/^[a-zA-Z0-9\W]*$/", $user_pass) === false) { - $errors[] = "Password contains invalid characters!"; - } - - if ($user_pass !== $pass_check) { - $errors[] = "The two passwords do not match."; - } - } - - if (!empty($errors)) { - echo 'Please check the following problems: '; - } else { - $pass_hash = password_hash($user_pass, PASSWORD_DEFAULT); - change_password(Session::get()->get_current_user(), $pass_hash); - echo 'Password successfully changed!'; - } -} -?> - - - - Change your password - cflip.net forum - - - -is_signed_in()) { - echo '

You must be logged in to change your password.

'; -} else { - echo ' -

Change your password

-
-
-
-
-
- -
-
'; -} -?> - - +is_signed_in()) { + $errors = array(); + $user_pass = ""; + + if (empty($_POST['user_pass'])) { + $errors[] = "You must provide a password."; + } else { + $user_pass = $_POST['user_pass']; + $pass_check = $_POST['user_pass_check']; + + if (preg_match("/^[a-zA-Z0-9\W]*$/", $user_pass) === false) { + $errors[] = "Password contains invalid characters!"; + } + + if ($user_pass !== $pass_check) { + $errors[] = "The two passwords do not match."; + } + } + + if (!empty($errors)) { + echo 'Please check the following problems: '; + } else { + $pass_hash = password_hash($user_pass, PASSWORD_DEFAULT); + change_password(Session::get()->get_current_user(), $pass_hash); + echo 'Password successfully changed!'; + } +} +?> + + + + Change your password - cflip.net forum + + + +is_signed_in()) { + echo '

You must be logged in to change your password.

'; +} else { + echo ' +

Change your password

+
+
+
+
+
+ +
+
'; +} +?> + + -- cgit v1.2.3