Update password only when necessary

This commit is contained in:
Frederic Guillot 2013-03-17 21:57:47 -04:00
parent 4ec4ac3795
commit 2384f4f14a

View File

@ -327,7 +327,15 @@ function validate_config_update(array $values)
function save_config(array $values)
{
if (! empty($values['password'])) {
$values['password'] = \PicoTools\Crypto\password_hash($values['password']);
}
else {
unset($values['password']);
}
unset($values['confirmation']);
return \PicoTools\singleton('db')->table('config')->update($values);