Co-authored-by: Hypolite Petovan <hypolite@mrpetovan.com>
} else {
try {
$user_id = User::getIdFromPasswordAuthentication(trim($user), trim($password), true);
- if ($user_id !== false) {
- $record = DBA::selectFirst('user', [], ['uid' => $user_id]);
- }
- } catch (Exception $ex) {
- $record = [];
+ $record = DBA::selectFirst('user', [], ['uid' => $user_id]);
+ } catch (Exception $ex) {
+ $record = [];
}
}
if ($email != $user['email']) {
// check for the correct password
try {
- $authenticated = User::getIdFromPasswordAuthentication(intval(local_user()), $_POST['mpassword']);
+ User::getIdFromPasswordAuthentication(local_user(), $_POST['mpassword']);
} catch (Exception $ex) {
- $authenticated = false;
- }
-
- if (!$authenticated) {
$err .= DI::l10n()->t('Wrong Password.');
$email = $user['email'];
}