Changeset View
Changeset View
Standalone View
Standalone View
src/app/Console/Commands/UserStatus.php
Show All 34 Lines | public function handle() | ||||
} | } | ||||
$statuses = [ | $statuses = [ | ||||
'active' => User::STATUS_ACTIVE, | 'active' => User::STATUS_ACTIVE, | ||||
'suspended' => User::STATUS_SUSPENDED, | 'suspended' => User::STATUS_SUSPENDED, | ||||
'deleted' => User::STATUS_DELETED, | 'deleted' => User::STATUS_DELETED, | ||||
'ldapReady' => User::STATUS_LDAP_READY, | 'ldapReady' => User::STATUS_LDAP_READY, | ||||
'imapReady' => User::STATUS_IMAP_READY, | 'imapReady' => User::STATUS_IMAP_READY, | ||||
'degraded' => User::STATUS_DEGRADED, | |||||
]; | ]; | ||||
foreach ($statuses as $text => $bit) { | foreach ($statuses as $text => $bit) { | ||||
$func = 'is' . \ucfirst($text); | $func = 'is' . \ucfirst($text); | ||||
$this->info(sprintf("%d %s: %s", $bit, $text, $user->$func())); | $this->info(sprintf("%d %s: %s", $bit, $text, $user->$func())); | ||||
} | } | ||||
$this->info("In total: {$user->status}"); | $this->info("In total: {$user->status}"); | ||||
} | } | ||||
} | } |