applied coding convention:

- replaced space -> tab (code indenting)
- added curly braces
- used dbm::is_result() if $r is no result (may happen)

Signed-off-by: Roland Häder <roland@mxchange.org>
This commit is contained in:
Roland Häder 2017-01-23 09:44:53 +01:00 committed by Roland Haeder
parent 909e1e055f
commit 1c6535c0b4
No known key found for this signature in database
GPG Key ID: B72F8185C6C7BD78
1 changed files with 12 additions and 9 deletions

View File

@ -381,13 +381,15 @@ function settings_post(App $a) {
$err = true;
}
// check if the old password was supplied correctly before
// changing it to the new value
$r = q("SELECT `password` FROM `user`WHERE `uid` = %d LIMIT 1", intval(local_user()));
if( $oldpass != $r[0]['password'] ) {
notice( t('Wrong password.') . EOL);
$err = true;
}
// check if the old password was supplied correctly before
// changing it to the new value
$r = q("SELECT `password` FROM `user`WHERE `uid` = %d LIMIT 1", intval(local_user()));
if (!dbm::is_result($r)) {
killme();
} elseif ( $oldpass != $r[0]['password'] ) {
notice( t('Wrong password.') . EOL);
$err = true;
}
if(! $err) {
$password = hash('whirlpool',$newpass);
@ -395,10 +397,11 @@ function settings_post(App $a) {
dbesc($password),
intval(local_user())
);
if($r)
if($r) {
info( t('Password changed.') . EOL);
else
} else {
notice( t('Password update failed. Please try again.') . EOL);
}
}
}