summaryrefslogtreecommitdiffstats
path: root/apps/user_ldap/command
diff options
context:
space:
mode:
authorArthur Schiwon <blizzz@owncloud.com>2015-01-06 17:50:06 +0100
committerArthur Schiwon <blizzz@owncloud.com>2015-01-06 17:50:06 +0100
commite724b78694cb17c7a3ff4427ae103b01baa4688c (patch)
tree21ad2d4a24d1e4e3a8da5e5d0ee6f1dd8ff40cf1 /apps/user_ldap/command
parent61ed363f820a3b25b68289ed2c03ff5e5edfed91 (diff)
downloadnextcloud-server-e724b78694cb17c7a3ff4427ae103b01baa4688c.tar.gz
nextcloud-server-e724b78694cb17c7a3ff4427ae103b01baa4688c.zip
smaller fixes: coding style, PHPdoc, typos and few for DI
Diffstat (limited to 'apps/user_ldap/command')
-rw-r--r--apps/user_ldap/command/checkuser.php16
-rw-r--r--apps/user_ldap/command/showremnants.php25
2 files changed, 20 insertions, 21 deletions
diff --git a/apps/user_ldap/command/checkuser.php b/apps/user_ldap/command/checkuser.php
index 5b1dc36c1d0..f9065a7c8d6 100644
--- a/apps/user_ldap/command/checkuser.php
+++ b/apps/user_ldap/command/checkuser.php
@@ -17,7 +17,8 @@ use Symfony\Component\Console\Output\OutputInterface;
use OCA\user_ldap\lib\user\User;
use OCA\User_LDAP\lib\user\Manager;
use OCA\User_LDAP\lib\User\DeletedUsersIndex;
-use OCA\user_ldap\lib\Helper;
+use OCA\User_LDAP\Mapping\UserMapping;
+use OCA\user_ldap\lib\Helper as LDAPHelper;
use OCA\user_ldap\User_Proxy;
class CheckUser extends Command {
@@ -35,10 +36,11 @@ class CheckUser extends Command {
/**
* @param OCA\user_ldap\User_Proxy $uBackend
- * @param OCA\User_LDAP\lib\Helper $helper
- * @param OCP\IConfig $config
+ * @param OCA\user_ldap\lib\Helper $helper
+ * @param OCA\User_LDAP\lib\User\DeletedUsersIndex $dui
+ * @param OCA\User_LDAP\Mapping\UserMapping $mapping
*/
- public function __construct(User_Proxy $uBackend, Helper $helper, DeletedUsersIndex $dui, UserMapping $mapping) {
+ public function __construct(User_Proxy $uBackend, LDAPHelper $helper, DeletedUsersIndex $dui, UserMapping $mapping) {
$this->backend = $uBackend;
$this->helper = $helper;
$this->dui = $dui;
@@ -100,13 +102,13 @@ class CheckUser extends Command {
}
/**
- * checks whether the setup allows reliable checking of LDAP user existance
+ * checks whether the setup allows reliable checking of LDAP user existence
* @throws \Exception
- * @return bool
+ * @return true
*/
protected function isAllowed($force) {
if($this->helper->haveDisabledConfigurations() && !$force) {
- throw new \Exception('Cannot check user existance, because '
+ throw new \Exception('Cannot check user existence, because '
. 'disabled LDAP configurations are present.');
}
diff --git a/apps/user_ldap/command/showremnants.php b/apps/user_ldap/command/showremnants.php
index 8144a54cbee..ab78cee96e7 100644
--- a/apps/user_ldap/command/showremnants.php
+++ b/apps/user_ldap/command/showremnants.php
@@ -19,16 +19,14 @@ use OCA\User_LDAP\lib\Connection;
use OCA\User_LDAP\Mapping\UserMapping;
class ShowRemnants extends Command {
- /** @var OCA\User_LDAP\Mapping\UserMapping */
- protected $mapping;
+ /** @var use OCA\User_LDAP\lib\User\DeletedUsersIndex; */
+ protected $dui;
/**
- * @param OCA\user_ldap\User_Proxy $uBackend
- * @param OCA\User_LDAP\lib\Helper $helper
- * @param OCP\IConfig $config
+ * @param OCA\user_ldap\lib\user\DeletedUsersIndex $dui
*/
- public function __construct(UserMapping $mapper) {
- $this->mapper = $mapper;
+ public function __construct(DeletedUsersIndex $dui) {
+ $this->dui = $dui;
parent::__construct();
}
@@ -39,20 +37,19 @@ class ShowRemnants extends Command {
;
}
+ /**
+ * executes the command, i.e. creeates and outputs a table of LDAP users marked as deleted
+ *
+ * {@inheritdoc}
+ */
protected function execute(InputInterface $input, OutputInterface $output) {
- $dui = new DeletedUsersIndex(
- \OC::$server->getConfig(),
- \OC::$server->getDatabaseConnection(),
- $this->mapper
- );
-
/** @var \Symfony\Component\Console\Helper\Table $table */
$table = $this->getHelperSet()->get('table');
$table->setHeaders(array(
'ownCloud name', 'Display Name', 'LDAP UID', 'LDAP DN', 'Last Login',
'Dir', 'Sharer'));
$rows = array();
- $resultSet = $dui->getUsers();
+ $resultSet = $this->dui->getUsers();
foreach($resultSet as $user) {
$hAS = $user->getHasActiveShares() ? 'Y' : 'N';
$lastLogin = ($user->getLastLogin() > 0) ?