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:
parent
909e1e055f
commit
1c6535c0b4
|
@ -384,7 +384,9 @@ function settings_post(App $a) {
|
||||||
// check if the old password was supplied correctly before
|
// check if the old password was supplied correctly before
|
||||||
// changing it to the new value
|
// changing it to the new value
|
||||||
$r = q("SELECT `password` FROM `user`WHERE `uid` = %d LIMIT 1", intval(local_user()));
|
$r = q("SELECT `password` FROM `user`WHERE `uid` = %d LIMIT 1", intval(local_user()));
|
||||||
if( $oldpass != $r[0]['password'] ) {
|
if (!dbm::is_result($r)) {
|
||||||
|
killme();
|
||||||
|
} elseif ( $oldpass != $r[0]['password'] ) {
|
||||||
notice( t('Wrong password.') . EOL);
|
notice( t('Wrong password.') . EOL);
|
||||||
$err = true;
|
$err = true;
|
||||||
}
|
}
|
||||||
|
@ -395,12 +397,13 @@ function settings_post(App $a) {
|
||||||
dbesc($password),
|
dbesc($password),
|
||||||
intval(local_user())
|
intval(local_user())
|
||||||
);
|
);
|
||||||
if($r)
|
if($r) {
|
||||||
info( t('Password changed.') . EOL);
|
info( t('Password changed.') . EOL);
|
||||||
else
|
} else {
|
||||||
notice( t('Password update failed. Please try again.') . EOL);
|
notice( t('Password update failed. Please try again.') . EOL);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
$username = ((x($_POST,'username')) ? notags(trim($_POST['username'])) : '');
|
$username = ((x($_POST,'username')) ? notags(trim($_POST['username'])) : '');
|
||||||
|
|
Loading…
Reference in a new issue