Show the disabled status of a user in the users:list command

This commit is contained in:
Jan Böhmer 2022-11-14 23:58:38 +01:00
parent 37fde77b8e
commit 27709bed60
3 changed files with 4 additions and 3 deletions

View file

@ -56,7 +56,7 @@ use Symfony\Component\PasswordHasher\Hasher\UserPasswordHasherInterface;
class SetPasswordCommand extends Command
{
protected static $defaultName = 'partdb:users:set-password|app:set-password|users:set-password';
protected static $defaultName = 'partdb:users:set-password|app:set-password|users:set-password|partdb:user:set-password';
protected EntityManagerInterface $entityManager;
protected UserPasswordHasherInterface $encoder;

View file

@ -43,7 +43,7 @@ class UserListCommand extends Command
$io->title('Users:');
$table = new Table($output);
$table->setHeaders(['ID', 'Username', 'Name', 'Email', 'Group']);
$table->setHeaders(['ID', 'Username', 'Name', 'Email', 'Group', 'Login Disabled']);
foreach ($users as $user) {
$table->addRow([
@ -52,6 +52,7 @@ class UserListCommand extends Command
$user->getFullName(),
$user->getEmail(),
$user->getGroup() !== null ? $user->getGroup()->getName() . ' (ID: ' . $user->getGroup()->getID() . ')' : 'No group',
$user->isDisabled() ? 'Yes' : 'No',
]);
}

View file

@ -18,7 +18,7 @@ use Symfony\Contracts\Translation\TranslatorInterface;
class UsersPermissionsCommand extends Command
{
protected static $defaultName = 'partdb:users:permissions';
protected static $defaultName = 'partdb:users:permissions|partdb:user:permissions';
protected static $defaultDescription = 'View and edit the permissions of a given user';
protected EntityManagerInterface $entityManager;