mirror of
https://github.com/friendica/friendica
synced 2025-04-27 11:50:11 +00:00
Update use statement lists with new Friendica\Database\dba class
- Remove unused use statement - Remove superfluous use statements (classes in the same namespace) - Add missing use statements
This commit is contained in:
parent
c316c5ae30
commit
daa1177e3a
128 changed files with 262 additions and 259 deletions
|
@ -2,12 +2,12 @@
|
|||
|
||||
namespace Friendica\Core\Console;
|
||||
|
||||
use Friendica\Core\L10n;
|
||||
use Friendica\Model\Contact;
|
||||
use Friendica\Model\User;
|
||||
use Friendica\Core\Config;
|
||||
use Friendica\Core\L10n;
|
||||
use Friendica\Database\dba;
|
||||
use Friendica\Database\DBM;
|
||||
use dba;
|
||||
use Friendica\Model\User;
|
||||
use RuntimeException;
|
||||
|
||||
/**
|
||||
* @brief tool to set a new password for a user
|
||||
|
@ -59,14 +59,14 @@ HELP;
|
|||
}
|
||||
|
||||
if ($a->isInstallMode()) {
|
||||
throw new \RuntimeException('Database isn\'t ready or populated yet');
|
||||
throw new RuntimeException('Database isn\'t ready or populated yet');
|
||||
}
|
||||
|
||||
$nick = $this->getArgument(0);
|
||||
|
||||
$user = dba::selectFirst('user', ['uid'], ['nickname' => $nick]);
|
||||
if (!DBM::is_result($user)) {
|
||||
throw new \RuntimeException(L10n::t('User not found'));
|
||||
throw new RuntimeException(L10n::t('User not found'));
|
||||
}
|
||||
|
||||
$password = $this->getArgument(1);
|
||||
|
@ -76,15 +76,15 @@ HELP;
|
|||
}
|
||||
|
||||
if (!$password) {
|
||||
throw new \RuntimeException(L10n::t('Password can\'t be empty'));
|
||||
throw new RuntimeException(L10n::t('Password can\'t be empty'));
|
||||
}
|
||||
|
||||
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.'));
|
||||
throw new RuntimeException(L10n::t('The new password has been exposed in a public data dump, please choose another.'));
|
||||
}
|
||||
|
||||
if (!User::updatePassword($user['uid'], $password)) {
|
||||
throw new \RuntimeException(L10n::t('Password update failed. Please try again.'));
|
||||
throw new RuntimeException(L10n::t('Password update failed. Please try again.'));
|
||||
}
|
||||
|
||||
$this->out(L10n::t('Password changed.'));
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue