diff options
author | Christoph Wurst <ChristophWurst@users.noreply.github.com> | 2020-04-09 20:39:37 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2020-04-09 20:39:37 +0200 |
commit | 008e6d7e849a82fdc3aa20169c4c8bdd0fe506be (patch) | |
tree | 6abbe3d8741de956ad787b5e3d55cec85ceb558f /apps/user_ldap/lib | |
parent | 64510932b8bd7d4d1d490f7da7fb9ebcf21e31c2 (diff) | |
parent | 3a415e4139d6e28c16b0420ab411e6df5ff6d54a (diff) | |
download | nextcloud-server-008e6d7e849a82fdc3aa20169c4c8bdd0fe506be.tar.gz nextcloud-server-008e6d7e849a82fdc3aa20169c4c8bdd0fe506be.zip |
Merge pull request #20391 from nextcloud/refactor/spaces-cleanup
Remove all extra whitespace PSR2 does not like
Diffstat (limited to 'apps/user_ldap/lib')
-rw-r--r-- | apps/user_ldap/lib/Access.php | 6 | ||||
-rw-r--r-- | apps/user_ldap/lib/Configuration.php | 4 | ||||
-rw-r--r-- | apps/user_ldap/lib/Controller/RenewPasswordController.php | 2 | ||||
-rw-r--r-- | apps/user_ldap/lib/Helper.php | 2 | ||||
-rw-r--r-- | apps/user_ldap/lib/LDAPProvider.php | 6 | ||||
-rw-r--r-- | apps/user_ldap/lib/LDAPProviderFactory.php | 2 | ||||
-rw-r--r-- | apps/user_ldap/lib/Migration/UUIDFixGroup.php | 2 | ||||
-rw-r--r-- | apps/user_ldap/lib/User/Manager.php | 4 | ||||
-rw-r--r-- | apps/user_ldap/lib/User/User.php | 6 |
9 files changed, 17 insertions, 17 deletions
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/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/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..75267165cdf 100644 --- a/apps/user_ldap/lib/LDAPProvider.php +++ b/apps/user_ldap/lib/LDAPProvider.php @@ -110,11 +110,11 @@ class LDAPProvider implements ILDAPProvider, IDeletionFlagSupport { if(!$result){ throw new \Exception('Translation to LDAP DN unsuccessful'); } - return $result; + return $result; } /** - * 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/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 |