X-Git-Url: https://git.mxchange.org/?a=blobdiff_plain;f=src%2FConsole%2FUser.php;h=bff5db74323977038bf5dc230e670ab993a39032;hb=15caf4b3f7eacda399a56b1ad8eeb9d3257306d9;hp=d9766203825bd2203db348589a7908f0cd682894;hpb=1b0a8ec5c0e46e2ef45004b0c1f65498c5b16b36;p=friendica.git diff --git a/src/Console/User.php b/src/Console/User.php index d976620382..bff5db7432 100644 --- a/src/Console/User.php +++ b/src/Console/User.php @@ -1,6 +1,6 @@ [] [-h|--help|-?] [-v] bin/console user add [ [ [ []]]] [-h|--help|-?] [-v] - bin/console user delete [] [-q] [-h|--help|-?] [-v] + bin/console user delete [] [-y] [-h|--help|-?] [-v] bin/console user allow [] [-h|--help|-?] [-v] bin/console user deny [] [-h|--help|-?] [-v] bin/console user block [] [-h|--help|-?] [-v] @@ -78,8 +78,8 @@ Description Options -h|--help|-? Show help information - -v Show more debug information. - -q Quiet mode (don't ask for a command). + -v Show more debug information + -y Non-interactive mode, assume "yes" as answer to the user deletion prompt HELP; return $help; } @@ -304,19 +304,24 @@ HELP; } } - $user = $this->dba->selectFirst('user', ['uid'], ['nickname' => $nick]); + $user = $this->dba->selectFirst('user', ['uid', 'account_removed'], ['nickname' => $nick]); if (empty($user)) { throw new RuntimeException($this->l10n->t('User not found')); } - if (!$this->getOption('q')) { + if (!empty($user['account_removed'])) { + $this->out($this->l10n->t('User has already been marked for deletion.')); + return true; + } + + if (!$this->getOption('y')) { $this->out($this->l10n->t('Type "yes" to delete %s', $nick)); if (CliPrompt::prompt() !== 'yes') { - throw new RuntimeException('Delete abort.'); + throw new RuntimeException($this->l10n->t('Deletion aborted.')); } } - return UserModel::remove($user['uid'] ?? -1); + return UserModel::remove($user['uid']); } /** @@ -404,7 +409,7 @@ HELP; case 'guid': $user = UserModel::getByGuid($param, $fields); break; - case 'email': + case 'mail': $user = UserModel::getByEmail($param, $fields); break; case 'nick':