}
}
-
$r = q("UPDATE `user` SET `theme` = '%s' WHERE `uid` = %d",
dbesc($theme),
intval(local_user())
call_hooks('settings_post', $_POST);
if (x($_POST, 'password') || x($_POST, 'confirm')) {
-
$newpass = $_POST['password'];
$confirm = $_POST['confirm'];
$err = true;
}
- // check if the old password was supplied correctly before
- // changing it to the new value
if (User::authenticate(intval(local_user()), $_POST['opassword'])) {
+ // check if the old password was supplied correctly before changing it to the new value
notice(t('Wrong password.') . EOL);
$err = true;
}
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);
+ }
}
}
-
$username = ((x($_POST, 'username')) ? notags(trim($_POST['username'])) : '');
$email = ((x($_POST, 'email')) ? notags(trim($_POST['email'])) : '');
$timezone = ((x($_POST, 'timezone')) ? notags(trim($_POST['timezone'])) : '');