From 44577e4345066952622feca9ef69c24fc23d08ab Mon Sep 17 00:00:00 2001 From: Christoph Wurst Date: Thu, 9 Apr 2020 16:07:47 +0200 Subject: Remove trailing and in between spaces Signed-off-by: Christoph Wurst --- apps/user_ldap/lib/Access.php | 6 +++--- apps/user_ldap/lib/Controller/RenewPasswordController.php | 2 +- apps/user_ldap/lib/Helper.php | 2 +- apps/user_ldap/lib/LDAPProvider.php | 2 +- apps/user_ldap/lib/LDAPProviderFactory.php | 2 +- apps/user_ldap/lib/Migration/UUIDFixGroup.php | 2 +- apps/user_ldap/lib/User/Manager.php | 4 ++-- apps/user_ldap/lib/User/User.php | 6 +++--- apps/user_ldap/templates/settings.php | 2 +- apps/user_ldap/tests/GroupLDAPPluginTest.php | 4 ++-- apps/user_ldap/tests/Group_LDAPTest.php | 2 +- apps/user_ldap/tests/Jobs/CleanUpTest.php | 2 +- apps/user_ldap/tests/UserLDAPPluginTest.php | 8 ++++---- 13 files changed, 22 insertions(+), 22 deletions(-) (limited to 'apps/user_ldap') diff --git a/apps/user_ldap/lib/Access.php b/apps/user_ldap/lib/Access.php index 81e467cb639..836e1fddb85 100644 --- a/apps/user_ldap/lib/Access.php +++ b/apps/user_ldap/lib/Access.php @@ -620,7 +620,7 @@ class Access extends LDAPUtility { // outside of core user management will still cache the user as non-existing. $originalTTL = $this->connection->ldapCacheTTL; $this->connection->setConfiguration(['ldapCacheTTL' => 0]); - if( $intName !== '' + if($intName !== '' && (($isUser && !$this->ncUserManager->userExists($intName)) || (!$isUser && !\OC::$server->getGroupManager()->groupExists($intName)) ) @@ -708,7 +708,7 @@ class Access extends LDAPUtility { foreach($ldapObjects as $ldapObject) { $nameByLDAP = null; - if( isset($ldapObject[$nameAttribute]) + if(isset($ldapObject[$nameAttribute]) && is_array($ldapObject[$nameAttribute]) && isset($ldapObject[$nameAttribute][0]) ) { @@ -1777,7 +1777,7 @@ class Access extends LDAPUtility { if($this->detectUuidAttribute($dn, $isUser, false, $ldapRecord)) { $attr = $this->connection->$uuidAttr; $uuid = isset($ldapRecord[$attr]) ? $ldapRecord[$attr] : $this->readAttribute($dn, $attr); - if( !is_array($uuid) + if(!is_array($uuid) && $uuidOverride !== '' && $this->detectUuidAttribute($dn, $isUser, true, $ldapRecord)) { diff --git a/apps/user_ldap/lib/Controller/RenewPasswordController.php b/apps/user_ldap/lib/Controller/RenewPasswordController.php index ff60cd3b2f1..cc58f79cbd0 100644 --- a/apps/user_ldap/lib/Controller/RenewPasswordController.php +++ b/apps/user_ldap/lib/Controller/RenewPasswordController.php @@ -54,7 +54,7 @@ class RenewPasswordController extends Controller { * @param IConfig $config * @param IURLGenerator $urlGenerator */ - function __construct($appName, IRequest $request, IUserManager $userManager, + function __construct($appName, IRequest $request, IUserManager $userManager, IConfig $config, IL10N $l10n, ISession $session, IURLGenerator $urlGenerator) { parent::__construct($appName, $request); $this->userManager = $userManager; diff --git a/apps/user_ldap/lib/Helper.php b/apps/user_ldap/lib/Helper.php index 93dc92f334d..595e3c92ec8 100644 --- a/apps/user_ldap/lib/Helper.php +++ b/apps/user_ldap/lib/Helper.php @@ -305,7 +305,7 @@ class Helper { $userBackend = new User_Proxy( $configPrefixes, $ldapWrapper, $ocConfig, $notificationManager, $userSession, $userPluginManager ); - $uid = $userBackend->loginName2UserName($param['uid'] ); + $uid = $userBackend->loginName2UserName($param['uid']); if($uid !== false) { $param['uid'] = $uid; } diff --git a/apps/user_ldap/lib/LDAPProvider.php b/apps/user_ldap/lib/LDAPProvider.php index 1916e10b8cd..3119bcb0132 100644 --- a/apps/user_ldap/lib/LDAPProvider.php +++ b/apps/user_ldap/lib/LDAPProvider.php @@ -110,7 +110,7 @@ class LDAPProvider implements ILDAPProvider, IDeletionFlagSupport { if(!$result){ throw new \Exception('Translation to LDAP DN unsuccessful'); } - return $result; + return $result; } /** diff --git a/apps/user_ldap/lib/LDAPProviderFactory.php b/apps/user_ldap/lib/LDAPProviderFactory.php index 637b2d4e67b..ec8d0e3254e 100644 --- a/apps/user_ldap/lib/LDAPProviderFactory.php +++ b/apps/user_ldap/lib/LDAPProviderFactory.php @@ -56,7 +56,7 @@ class LDAPProviderFactory implements ILDAPProviderFactory { $dbConnection = $this->serverContainer->getDatabaseConnection(); $userMapping = new UserMapping($dbConnection); return new LDAPProvider($this->serverContainer, new Helper($this->serverContainer->getConfig()), - new DeletedUsersIndex($this->serverContainer->getConfig(), + new DeletedUsersIndex($this->serverContainer->getConfig(), $dbConnection, $userMapping)); } } diff --git a/apps/user_ldap/lib/Migration/UUIDFixGroup.php b/apps/user_ldap/lib/Migration/UUIDFixGroup.php index 618e5c519e7..a101a97a82f 100644 --- a/apps/user_ldap/lib/Migration/UUIDFixGroup.php +++ b/apps/user_ldap/lib/Migration/UUIDFixGroup.php @@ -34,7 +34,7 @@ use OCP\IConfig; class UUIDFixGroup extends UUIDFix { public function __construct(GroupMapping $mapper, LDAP $ldap, IConfig $config, Helper $helper) { $this->mapper = $mapper; - $this->proxy = new User_Proxy($helper->getServerConfigurationPrefixes(true), $ldap, $config, + $this->proxy = new User_Proxy($helper->getServerConfigurationPrefixes(true), $ldap, $config, \OC::$server->getNotificationManager(), \OC::$server->getUserSession(), \OC::$server->query('LDAPUserPluginManager')); } diff --git a/apps/user_ldap/lib/User/Manager.php b/apps/user_ldap/lib/User/Manager.php index 3f3e8cd3be3..c7660a40ba6 100644 --- a/apps/user_ldap/lib/User/Manager.php +++ b/apps/user_ldap/lib/User/Manager.php @@ -130,7 +130,7 @@ class Manager { $this->checkAccess(); $user = new User($uid, $dn, $this->access, $this->ocConfig, $this->ocFilesystem, clone $this->image, $this->ocLog, - $this->avatarManager, $this->userManager, + $this->avatarManager, $this->userManager, $this->notificationManager); $this->usersByDN[$dn] = $user; $this->usersByUid[$uid] = $user; @@ -264,7 +264,7 @@ class Manager { return $this->usersByUid[$id]; } - if($this->access->stringResemblesDN($id) ) { + if($this->access->stringResemblesDN($id)) { $uid = $this->access->dn2username($id); if($uid !== false) { return $this->createAndCache($id, $uid); diff --git a/apps/user_ldap/lib/User/User.php b/apps/user_ldap/lib/User/User.php index ccd40621704..2c038e43285 100644 --- a/apps/user_ldap/lib/User/User.php +++ b/apps/user_ldap/lib/User/User.php @@ -327,12 +327,12 @@ class User { if ($path !== '') { //if attribute's value is an absolute path take this, otherwise append it to data dir //check for / at the beginning or pattern c:\ resp. c:/ - if( '/' !== $path[0] + if('/' !== $path[0] && !(3 < strlen($path) && ctype_alpha($path[0]) && $path[1] === ':' && ('\\' === $path[2] || '/' === $path[2])) ) { $path = $this->config->getSystemValue('datadirectory', - \OC::$SERVERROOT.'/data' ) . '/' . $path; + \OC::$SERVERROOT.'/data') . '/' . $path; } //we need it to store it in the DB as well in case a user gets //deleted so we can clean up afterwards @@ -342,7 +342,7 @@ class User { return $path; } - if( !is_null($attr) + if(!is_null($attr) && $this->config->getAppValue('user_ldap', 'enforce_home_folder_naming_rule', true) ) { // a naming rule attribute is defined, but it doesn't exist for that LDAP user diff --git a/apps/user_ldap/templates/settings.php b/apps/user_ldap/templates/settings.php index 0ac3a2bcc40..bbc809481ac 100644 --- a/apps/user_ldap/templates/settings.php +++ b/apps/user_ldap/templates/settings.php @@ -83,7 +83,7 @@ style('user_ldap', 'settings');

-


+


t('Directory Settings'));?>

diff --git a/apps/user_ldap/tests/GroupLDAPPluginTest.php b/apps/user_ldap/tests/GroupLDAPPluginTest.php index 73c5271960b..b5d9c40862b 100644 --- a/apps/user_ldap/tests/GroupLDAPPluginTest.php +++ b/apps/user_ldap/tests/GroupLDAPPluginTest.php @@ -152,7 +152,7 @@ class GroupLDAPPluginTest extends \Test\TestCase { $pluginManager = $this->getGroupPluginManager(); $pluginManager->addToGroup('foo', 'bar'); - } + } public function testRemoveFromGroup() { $pluginManager = $this->getGroupPluginManager(); @@ -214,7 +214,7 @@ class GroupLDAPPluginTest extends \Test\TestCase { $pluginManager = $this->getGroupPluginManager(); $pluginManager->countUsersInGroup('foo', 'bar'); - } + } public function testgetGroupDetails() { $pluginManager = $this->getGroupPluginManager(); diff --git a/apps/user_ldap/tests/Group_LDAPTest.php b/apps/user_ldap/tests/Group_LDAPTest.php index a81255c10a9..cf6e2d7bb84 100644 --- a/apps/user_ldap/tests/Group_LDAPTest.php +++ b/apps/user_ldap/tests/Group_LDAPTest.php @@ -194,7 +194,7 @@ class Group_LDAPTest extends TestCase { $ldap = new GroupLDAP($access, $pluginManager); $this->assertEquals($ldap->countUsersInGroup('gid', 'search'),42); - } + } public function testGidNumber2NameSuccess() { $access = $this->getAccessMock(); diff --git a/apps/user_ldap/tests/Jobs/CleanUpTest.php b/apps/user_ldap/tests/Jobs/CleanUpTest.php index 75bd6f0b08e..bf4c8b75bac 100644 --- a/apps/user_ldap/tests/Jobs/CleanUpTest.php +++ b/apps/user_ldap/tests/Jobs/CleanUpTest.php @@ -55,7 +55,7 @@ class CleanUpTest extends \Test\TestCase { $args = $this->getMocks(); $args['helper']->expects($this->once()) ->method('haveDisabledConfigurations') - ->willReturn(true ); + ->willReturn(true); $args['ocConfig']->expects($this->never()) ->method('getSystemValue'); diff --git a/apps/user_ldap/tests/UserLDAPPluginTest.php b/apps/user_ldap/tests/UserLDAPPluginTest.php index 58bc63e442f..03557ec174b 100644 --- a/apps/user_ldap/tests/UserLDAPPluginTest.php +++ b/apps/user_ldap/tests/UserLDAPPluginTest.php @@ -153,7 +153,7 @@ class UserLDAPPluginTest extends \Test\TestCase { $pluginManager = $this->getUserPluginManager(); $pluginManager->getHome('foo'); - } + } public function testGetDisplayName() { $pluginManager = $this->getUserPluginManager(); @@ -204,7 +204,7 @@ class UserLDAPPluginTest extends \Test\TestCase { ); $pluginManager->register($plugin); - $pluginManager->setDisplayName('user', 'password'); + $pluginManager->setDisplayName('user', 'password'); } @@ -214,7 +214,7 @@ class UserLDAPPluginTest extends \Test\TestCase { $pluginManager = $this->getUserPluginManager(); $pluginManager->setDisplayName('foo', 'bar'); - } + } public function testCanChangeAvatar() { $pluginManager = $this->getUserPluginManager(); @@ -271,7 +271,7 @@ class UserLDAPPluginTest extends \Test\TestCase { $pluginManager = $this->getUserPluginManager(); $pluginManager->countUsers(); - } + } public function testDeleteUser() { $pluginManager = $this->getUserPluginManager(); -- cgit v1.2.3 From a8a06a82d2b93c17b3014f0d468f23239100ca10 Mon Sep 17 00:00:00 2001 From: Christoph Wurst Date: Thu, 9 Apr 2020 16:09:23 +0200 Subject: Remove trailing whitespaces from comments Signed-off-by: Christoph Wurst --- apps/user_ldap/lib/Configuration.php | 4 ++-- apps/user_ldap/lib/LDAPProvider.php | 4 ++-- apps/user_ldap/tests/Integration/ExceptionOnLostConnection.php | 2 +- 3 files changed, 5 insertions(+), 5 deletions(-) (limited to 'apps/user_ldap') diff --git a/apps/user_ldap/lib/Configuration.php b/apps/user_ldap/lib/Configuration.php index a04ea638d09..3c6693b151e 100644 --- a/apps/user_ldap/lib/Configuration.php +++ b/apps/user_ldap/lib/Configuration.php @@ -311,7 +311,7 @@ class Configuration { /** * Sets multi-line values as arrays - * + * * @param string $varName name of config-key * @param array|string $value to set */ @@ -387,7 +387,7 @@ class Configuration { /** * Sets a scalar value. - * + * * @param string $varName name of config key * @param mixed $value to set */ diff --git a/apps/user_ldap/lib/LDAPProvider.php b/apps/user_ldap/lib/LDAPProvider.php index 3119bcb0132..75267165cdf 100644 --- a/apps/user_ldap/lib/LDAPProvider.php +++ b/apps/user_ldap/lib/LDAPProvider.php @@ -114,7 +114,7 @@ class LDAPProvider implements ILDAPProvider, IDeletionFlagSupport { } /** - * Translate a LDAP DN to an internal user name. If there is no mapping between + * Translate a LDAP DN to an internal user name. If there is no mapping between * the DN and the user name, a new one will be created. * @param string $dn LDAP DN * @return string with the internal user name @@ -147,7 +147,7 @@ class LDAPProvider implements ILDAPProvider, IDeletionFlagSupport { } /** - * Return a new LDAP connection resource for the specified user. + * Return a new LDAP connection resource for the specified user. * The connection must be closed manually. * @param string $uid user id * @return resource of the LDAP connection diff --git a/apps/user_ldap/tests/Integration/ExceptionOnLostConnection.php b/apps/user_ldap/tests/Integration/ExceptionOnLostConnection.php index 50c45b49048..33eb1c70d6f 100644 --- a/apps/user_ldap/tests/Integration/ExceptionOnLostConnection.php +++ b/apps/user_ldap/tests/Integration/ExceptionOnLostConnection.php @@ -36,7 +36,7 @@ use OCA\User_LDAP\LDAP; * * LDAP must be available via toxiproxy. * - * This test must be run manually. + * This test must be run manually. * */ class ExceptionOnLostConnection { -- cgit v1.2.3