From 3ca70d647a36144e64cbe4b90ffa97b3d9b64470 Mon Sep 17 00:00:00 2001 From: Arthur Schiwon Date: Sat, 20 Dec 2014 16:33:37 +0100 Subject: move from \OC\Preferences to \OCP\IConfig --- apps/user_ldap/command/showremnants.php | 36 +++++++++++++++------------------ 1 file changed, 16 insertions(+), 20 deletions(-) (limited to 'apps/user_ldap/command') diff --git a/apps/user_ldap/command/showremnants.php b/apps/user_ldap/command/showremnants.php index fb9fc54ff6a..8144a54cbee 100644 --- a/apps/user_ldap/command/showremnants.php +++ b/apps/user_ldap/command/showremnants.php @@ -41,7 +41,7 @@ class ShowRemnants extends Command { protected function execute(InputInterface $input, OutputInterface $output) { $dui = new DeletedUsersIndex( - new \OC\Preferences(\OC_DB::getConnection()), + \OC::$server->getConfig(), \OC::$server->getDatabaseConnection(), $this->mapper ); @@ -52,25 +52,21 @@ class ShowRemnants extends Command { 'ownCloud name', 'Display Name', 'LDAP UID', 'LDAP DN', 'Last Login', 'Dir', 'Sharer')); $rows = array(); - $offset = 0; - do { - $resultSet = $dui->getUsers($offset); - $offset += count($resultSet); - foreach($resultSet as $user) { - $hAS = $user->getHasActiveShares() ? 'Y' : 'N'; - $lastLogin = ($user->getLastLogin() > 0) ? - \OCP\Util::formatDate($user->getLastLogin()) : '-'; - $rows[] = array( - $user->getOCName(), - $user->getDisplayName(), - $user->getUid(), - $user->getDN(), - $lastLogin, - $user->getHomePath(), - $hAS - ); - } - } while (count($resultSet) === 10); + $resultSet = $dui->getUsers(); + foreach($resultSet as $user) { + $hAS = $user->getHasActiveShares() ? 'Y' : 'N'; + $lastLogin = ($user->getLastLogin() > 0) ? + \OCP\Util::formatDate($user->getLastLogin()) : '-'; + $rows[] = array( + $user->getOCName(), + $user->getDisplayName(), + $user->getUid(), + $user->getDN(), + $lastLogin, + $user->getHomePath(), + $hAS + ); + } $table->setRows($rows); $table->render($output); -- cgit v1.2.3