diff options
author | Arthur Schiwon <blizzz@owncloud.com> | 2015-01-06 23:40:00 +0100 |
---|---|---|
committer | Arthur Schiwon <blizzz@owncloud.com> | 2015-01-06 23:40:00 +0100 |
commit | 64f0b055e67974141cf2e156d2b062f55768ce7d (patch) | |
tree | a08d02af32d224db1f5190ec81b8453105a68046 /apps/user_ldap/command | |
parent | 40ecd30fba6d29362c455b1f0eef875ff19cd544 (diff) | |
download | nextcloud-server-64f0b055e67974141cf2e156d2b062f55768ce7d.tar.gz nextcloud-server-64f0b055e67974141cf2e156d2b062f55768ce7d.zip |
inject IDateTimeFormatter to show-remnants command
Diffstat (limited to 'apps/user_ldap/command')
-rw-r--r-- | apps/user_ldap/command/showremnants.php | 11 |
1 files changed, 8 insertions, 3 deletions
diff --git a/apps/user_ldap/command/showremnants.php b/apps/user_ldap/command/showremnants.php index ab78cee96e7..5b7322e7711 100644 --- a/apps/user_ldap/command/showremnants.php +++ b/apps/user_ldap/command/showremnants.php @@ -17,16 +17,21 @@ use Symfony\Component\Console\Output\OutputInterface; use OCA\user_ldap\lib\user\DeletedUsersIndex; use OCA\User_LDAP\lib\Connection; use OCA\User_LDAP\Mapping\UserMapping; +use OCP\IDateTimeFormatter; class ShowRemnants extends Command { - /** @var use OCA\User_LDAP\lib\User\DeletedUsersIndex; */ + /** @var OCA\User_LDAP\lib\User\DeletedUsersIndex */ protected $dui; + /** @var OCP\IDateTimeFormatter */ + protected $dateFormatter; + /** * @param OCA\user_ldap\lib\user\DeletedUsersIndex $dui */ - public function __construct(DeletedUsersIndex $dui) { + public function __construct(DeletedUsersIndex $dui, IDateTimeFormatter $dateFormatter) { $this->dui = $dui; + $this->dateFormatter = $dateFormatter; parent::__construct(); } @@ -53,7 +58,7 @@ class ShowRemnants extends Command { foreach($resultSet as $user) { $hAS = $user->getHasActiveShares() ? 'Y' : 'N'; $lastLogin = ($user->getLastLogin() > 0) ? - \OCP\Util::formatDate($user->getLastLogin()) : '-'; + $this->dateFormatter->formatDate($user->getLastLogin()) : '-'; $rows[] = array( $user->getOCName(), $user->getDisplayName(), |