throw new RuntimeException('Database isn\'t ready or populated yet');
}
$nick = $this->getArgument(0);
$user = DBA::selectFirst('user', ['uid'], ['nickname' => $nick]);
throw new RuntimeException('Database isn\'t ready or populated yet');
}
$nick = $this->getArgument(0);
$user = DBA::selectFirst('user', ['uid'], ['nickname' => $nick]);
- if (!Config::get('system', 'disable_password_exposed', false) && User::isPasswordExposed($password)) {
- throw new RuntimeException(L10n::t('The new password has been exposed in a public data dump, please choose another.'));
- }
+ if (!DBA::isResult($result)) {
+ throw new \Exception(L10n::t('Password update failed. Please try again.'));
+ }
- if (!User::updatePassword($user['uid'], $password)) {
- throw new RuntimeException(L10n::t('Password update failed. Please try again.'));
+ $this->out(L10n::t('Password changed.'));
+ } catch (\Exception $e) {
+ throw new RuntimeException($e->getMessage(), $e->getCode(), $e);