diff --git a/index.php b/index.php index 99336dd5..e5c25848 100644 --- a/index.php +++ b/index.php @@ -48,9 +48,9 @@ $config->load(); * database. */ session_start( - array( + [ 'name' => 'wishthis', - ) + ] ); $user = User::getCurrent(); diff --git a/src/classes/wishthis/User.php b/src/classes/wishthis/User.php index 0ec86bd8..d8d1e2fb 100644 --- a/src/classes/wishthis/User.php +++ b/src/classes/wishthis/User.php @@ -369,7 +369,8 @@ class User ?: $this->email; } - public function updatePasswordHash(string $password, string $email): string { + public function updatePasswordHash(string $password, string $email): string + { global $database; $passwordHash = User::passwordToHash($password); @@ -378,10 +379,10 @@ class User SET `password` = :password_hash WHERE `email` = :user_email', [ - "user_email" => $email, - "password_hash" => $passwordHash + "user_email" => $email, + "password_hash" => $passwordHash, ] - ); + ); return $passwordHash; } @@ -416,7 +417,7 @@ class User FROM `users` WHERE `email` = :user_email', [ - 'user_email' => $email + 'user_email' => $email, ] ) ->fetch(\PDO::FETCH_ASSOC); @@ -439,7 +440,7 @@ class User $password_matches = password_verify($password, $passwordHash); - if(!$password_matches) { + if (!$password_matches) { return false; } @@ -452,7 +453,7 @@ class User SET `last_login` = NOW() WHERE `email` = :user_email', [ - 'user_email' => $email + 'user_email' => $email, ] ); $user_database_fields['last_login'] = date('Y-m-d H:i');