Permalink
Browse files

Omit a few unnecessary variables

  • Loading branch information...
franzliedke committed Jan 2, 2019
1 parent 82f0ae4 commit f4aa7540defd7172cf6d97778de786ef335ed104
Showing with 2 additions and 6 deletions.
  1. +2 −6 login.php
@@ -45,14 +45,10 @@
{
$authorized = true;
$remove_salt = !empty($cur_user['salt']);
$rehash = $remove_salt || pun_password_needs_rehash($user_password);
if ($rehash)
if (!empty($cur_user['salt']) || pun_password_needs_rehash($user_password))
{
$user_password = pun_password_hash($form_password);
$salt_sql = ($remove_salt ? 'salt=NULL,' : '');
$db->query('UPDATE '.$db->prefix.'users SET '.$salt_sql.' password=\''.$db->escape($user_password).'\' WHERE id='.$cur_user['id']) or error('Unable to update user password', __FILE__, __LINE__, $db->error());
$db->query('UPDATE '.$db->prefix.'users SET salt=NULL, password=\''.$db->escape($user_password).'\' WHERE id='.$cur_user['id']) or error('Unable to update user password', __FILE__, __LINE__, $db->error());
}
}
}

0 comments on commit f4aa754

Please sign in to comment.