From 2098bf444afadcf0363d89b4cc1dca5d2213d754 Mon Sep 17 00:00:00 2001 From: cflip <36554078+cflip@users.noreply.github.com> Date: Sat, 24 Apr 2021 19:40:50 -0600 Subject: Remove all uses of db_inc.php This method of importing the database login every time wasn't very good. Now everything uses the new Database singleton class. --- change_passw.php | 67 ++++++++++++++++++++++++++------------------------------ 1 file changed, 31 insertions(+), 36 deletions(-) (limited to 'change_passw.php') diff --git a/change_passw.php b/change_passw.php index aa8de88..9f39742 100644 --- a/change_passw.php +++ b/change_passw.php @@ -1,26 +1,9 @@ - - -
You must be logged in to change your password.'; - } else { - echo ' -

Change your password

-
-
-
-
-
- -
-
'; - } -?> +include_once './includes/Session.php'; +include_once './includes/model/User.php'; +include_once './includes/functions_user.php'; -'; } else { - $sql = "UPDATE users SET user_pass = ? WHERE user_id = ?;"; - $stmt = mysqli_stmt_init($dbc); - - if (!mysqli_stmt_prepare($stmt, $sql)) { - die('Could not create account due to internal error: ' . mysqli_error($dbc)); - } - $pass_hash = password_hash($user_pass, PASSWORD_DEFAULT); - - mysqli_stmt_bind_param($stmt, "ss", $pass_hash, $_SESSION['user_id']); - mysqli_stmt_execute($stmt); - mysqli_stmt_close($stmt); - + change_password(Session::get()->get_current_user(), $pass_hash); echo 'Password successfully changed!'; } } ?> + + + + Change your password - cflip.net forum + + + + - - +if (!Session::get()->is_signed_in()) { + echo '

You must be logged in to change your password.

'; +} else { + echo ' +

Change your password

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