diff options
author | Andreas Fischer <bantu@owncloud.com> | 2014-05-19 14:08:42 +0200 |
---|---|---|
committer | Andreas Fischer <bantu@owncloud.com> | 2014-05-19 14:08:42 +0200 |
commit | 6c4b650524c4a8655984b89d4e7d105cfa61808c (patch) | |
tree | 705b7a235cc3780b902556b9af4b6625c6419e43 /apps/user_ldap | |
parent | 1cff73b61520462d3b22bdd85998eb0e48693ec5 (diff) | |
parent | e7aebc5c32c783f75a26f6ebc8116886a8cb55cf (diff) | |
download | nextcloud-server-6c4b650524c4a8655984b89d4e7d105cfa61808c.tar.gz nextcloud-server-6c4b650524c4a8655984b89d4e7d105cfa61808c.zip |
Merge pull request #8585 from owncloud/phpdoc-improvements-apps
PHPDoc improvements /apps
* owncloud/phpdoc-improvements-apps:
Fix whitespace issues
Reduce double-space with single-space.
Remove spaces around | operator in doc block.
Fix more missing or broken PHPDoc
PHPDoc fixes for user_ldap
Fix PHPDoc in /apps
Diffstat (limited to 'apps/user_ldap')
-rw-r--r-- | apps/user_ldap/group_ldap.php | 30 | ||||
-rw-r--r-- | apps/user_ldap/group_proxy.php | 52 | ||||
-rw-r--r-- | apps/user_ldap/lib/access.php | 60 | ||||
-rw-r--r-- | apps/user_ldap/lib/configuration.php | 34 | ||||
-rw-r--r-- | apps/user_ldap/lib/connection.php | 24 | ||||
-rw-r--r-- | apps/user_ldap/lib/ildapwrapper.php | 14 | ||||
-rw-r--r-- | apps/user_ldap/lib/jobs.php | 44 | ||||
-rw-r--r-- | apps/user_ldap/lib/ldap.php | 6 | ||||
-rw-r--r-- | apps/user_ldap/lib/proxy.php | 32 | ||||
-rw-r--r-- | apps/user_ldap/lib/wizard.php | 12 | ||||
-rw-r--r-- | apps/user_ldap/lib/wizardresult.php | 6 | ||||
-rw-r--r-- | apps/user_ldap/settings.php | 2 | ||||
-rw-r--r-- | apps/user_ldap/tests/user_ldap.php | 6 | ||||
-rw-r--r-- | apps/user_ldap/user_ldap.php | 30 | ||||
-rw-r--r-- | apps/user_ldap/user_proxy.php | 52 |
15 files changed, 202 insertions, 202 deletions
diff --git a/apps/user_ldap/group_ldap.php b/apps/user_ldap/group_ldap.php index e5bec602f62..b34dc339996 100644 --- a/apps/user_ldap/group_ldap.php +++ b/apps/user_ldap/group_ldap.php @@ -40,9 +40,9 @@ class GROUP_LDAP extends BackendUtility implements \OCP\GroupInterface { /** * @brief is user in group? - * @param $uid uid of the user - * @param $gid gid of the group - * @returns true/false + * @param string $uid uid of the user + * @param string $gid gid of the group + * @return bool * * Checks whether the user is member of a group or not. */ @@ -127,8 +127,8 @@ class GROUP_LDAP extends BackendUtility implements \OCP\GroupInterface { /** * @brief Get all groups a user belongs to - * @param $uid Name of the user - * @returns array with group names + * @param string $uid Name of the user + * @return array with group names * * This function fetches all groups a user belongs to. It does not check * if the user exists at all. @@ -177,8 +177,8 @@ class GROUP_LDAP extends BackendUtility implements \OCP\GroupInterface { } $allGroups = array(); if (array_key_exists($dn, $seen)) { - // avoid loops - return array(); + // avoid loops + return array(); } $seen[$dn] = true; $filter = $this->access->combineFilterWithAnd(array( @@ -205,7 +205,7 @@ class GROUP_LDAP extends BackendUtility implements \OCP\GroupInterface { /** * @brief get a list of all users in a group - * @returns array with user ids + * @return array with user ids */ public function usersInGroup($gid, $search = '', $limit = -1, $offset = 0) { if(!$this->enabled) { @@ -286,9 +286,9 @@ class GROUP_LDAP extends BackendUtility implements \OCP\GroupInterface { /** * @brief returns the number of users in a group, who match the search term - * @param string the internal group name - * @param string optional, a search string - * @returns int | bool + * @param string $gid the internal group name + * @param string $search optional, a search string + * @return int|bool */ public function countUsersInGroup($gid, $search = '') { $cachekey = 'countUsersInGroup-'.$gid.'-'.$search; @@ -364,7 +364,7 @@ class GROUP_LDAP extends BackendUtility implements \OCP\GroupInterface { /** * @brief get a list of all groups - * @returns array with group names + * @return array with group names * * Returns a list with all groups (used by getGroups) */ @@ -403,7 +403,7 @@ class GROUP_LDAP extends BackendUtility implements \OCP\GroupInterface { /** * @brief get a list of all groups using a paged search - * @returns array with group names + * @return array with group names * * Returns a list with all groups * Uses a paged search if available to override a @@ -481,8 +481,8 @@ class GROUP_LDAP extends BackendUtility implements \OCP\GroupInterface { /** * @brief Check if backend implements actions - * @param $actions bitwise-or'ed actions - * @returns boolean + * @param int $actions bitwise-or'ed actions + * @return boolean * * Returns the supported actions as int to be * compared with OC_USER_BACKEND_CREATE_USER etc. diff --git a/apps/user_ldap/group_proxy.php b/apps/user_ldap/group_proxy.php index ea94990ffe4..7e401620e82 100644 --- a/apps/user_ldap/group_proxy.php +++ b/apps/user_ldap/group_proxy.php @@ -31,12 +31,12 @@ class Group_Proxy extends lib\Proxy implements \OCP\GroupInterface { /** * @brief Constructor - * @param $serverConfigPrefixes array containing the config Prefixes + * @param string[] $serverConfigPrefixes array containing the config Prefixes */ public function __construct($serverConfigPrefixes, ILDAPWrapper $ldap) { parent::__construct($ldap); foreach($serverConfigPrefixes as $configPrefix) { - $this->backends[$configPrefix] = + $this->backends[$configPrefix] = new \OCA\user_ldap\GROUP_LDAP($this->getAccess($configPrefix)); if(is_null($this->refBackend)) { $this->refBackend = &$this->backends[$configPrefix]; @@ -46,28 +46,28 @@ class Group_Proxy extends lib\Proxy implements \OCP\GroupInterface { /** * @brief Tries the backends one after the other until a positive result is returned from the specified method - * @param $gid string, the gid connected to the request - * @param $method string, the method of the group backend that shall be called - * @param $parameters an array of parameters to be passed + * @param string $gid the gid connected to the request + * @param string $method the method of the group backend that shall be called + * @param array $parameters an array of parameters to be passed * @return mixed, the result of the method or false */ protected function walkBackends($gid, $method, $parameters) { $cacheKey = $this->getGroupCacheKey($gid); foreach($this->backends as $configPrefix => $backend) { - if($result = call_user_func_array(array($backend, $method), $parameters)) { + if($result = call_user_func_array(array($backend, $method), $parameters)) { $this->writeToCache($cacheKey, $configPrefix); return $result; - } + } } return false; } /** * @brief Asks the backend connected to the server that supposely takes care of the gid from the request. - * @param $gid string, the gid connected to the request - * @param $method string, the method of the group backend that shall be called - * @param $parameters an array of parameters to be passed - * @param $passOnWhen the result matches this variable + * @param string $gid the gid connected to the request + * @param string $method the method of the group backend that shall be called + * @param array $parameters an array of parameters to be passed + * @param mixed $passOnWhen the result matches this variable * @return mixed, the result of the method or false */ protected function callOnLastSeenOn($gid, $method, $parameters, $passOnWhen) { @@ -96,9 +96,9 @@ class Group_Proxy extends lib\Proxy implements \OCP\GroupInterface { /** * @brief is user in group? - * @param $uid uid of the user - * @param $gid gid of the group - * @returns true/false + * @param string $uid uid of the user + * @param string $gid gid of the group + * @return bool * * Checks whether the user is member of a group or not. */ @@ -108,8 +108,8 @@ class Group_Proxy extends lib\Proxy implements \OCP\GroupInterface { /** * @brief Get all groups a user belongs to - * @param $uid Name of the user - * @returns array with group names + * @param string $uid Name of the user + * @return string[] with group names * * This function fetches all groups a user belongs to. It does not check * if the user exists at all. @@ -118,7 +118,7 @@ class Group_Proxy extends lib\Proxy implements \OCP\GroupInterface { $groups = array(); foreach($this->backends as $backend) { - $backendGroups = $backend->getUserGroups($uid); + $backendGroups = $backend->getUserGroups($uid); if (is_array($backendGroups)) { $groups = array_merge($groups, $backendGroups); } @@ -129,13 +129,13 @@ class Group_Proxy extends lib\Proxy implements \OCP\GroupInterface { /** * @brief get a list of all users in a group - * @returns array with user ids + * @return string[] with user ids */ public function usersInGroup($gid, $search = '', $limit = -1, $offset = 0) { $users = array(); foreach($this->backends as $backend) { - $backendUsers = $backend->usersInGroup($gid, $search, $limit, $offset); + $backendUsers = $backend->usersInGroup($gid, $search, $limit, $offset); if (is_array($backendUsers)) { $users = array_merge($users, $backendUsers); } @@ -146,9 +146,9 @@ class Group_Proxy extends lib\Proxy implements \OCP\GroupInterface { /** * @brief returns the number of users in a group, who match the search term - * @param string the internal group name - * @param string optional, a search string - * @returns int | bool + * @param string $gid the internal group name + * @param string $search optional, a search string + * @return int|bool */ public function countUsersInGroup($gid, $search = '') { return $this->handleRequest( @@ -157,7 +157,7 @@ class Group_Proxy extends lib\Proxy implements \OCP\GroupInterface { /** * @brief get a list of all groups - * @returns array with group names + * @return string[] with group names * * Returns a list with all groups */ @@ -165,7 +165,7 @@ class Group_Proxy extends lib\Proxy implements \OCP\GroupInterface { $groups = array(); foreach($this->backends as $backend) { - $backendGroups = $backend->getGroups($search, $limit, $offset); + $backendGroups = $backend->getGroups($search, $limit, $offset); if (is_array($backendGroups)) { $groups = array_merge($groups, $backendGroups); } @@ -185,8 +185,8 @@ class Group_Proxy extends lib\Proxy implements \OCP\GroupInterface { /** * @brief Check if backend implements actions - * @param $actions bitwise-or'ed actions - * @returns boolean + * @param int $actions bitwise-or'ed actions + * @return boolean * * Returns the supported actions as int to be * compared with OC_USER_BACKEND_CREATE_USER etc. diff --git a/apps/user_ldap/lib/access.php b/apps/user_ldap/lib/access.php index c721703bce5..441eb40489e 100644 --- a/apps/user_ldap/lib/access.php +++ b/apps/user_ldap/lib/access.php @@ -138,7 +138,7 @@ class Access extends LDAPUtility { if(is_array($dn)) { $result = array(); foreach($dn as $singleDN) { - $result[] = $this->sanitizeDN($singleDN); + $result[] = $this->sanitizeDN($singleDN); } return $result; } @@ -383,7 +383,7 @@ class Access extends LDAPUtility { } /** - * @param $dn + * @param string $dn * @return bool|string */ private function findMappedUser($dn) { @@ -403,7 +403,7 @@ class Access extends LDAPUtility { } /** - * @param $dn + * @param string $dn * @return bool|string */ private function findMappedGroup($dn) { @@ -630,8 +630,8 @@ class Access extends LDAPUtility { } /** - * @param $filter - * @param $attr + * @param string $filter + * @param string|string[] $attr * @param int $limit * @param int $offset * @return array @@ -641,8 +641,8 @@ class Access extends LDAPUtility { } /** - * @param $filter - * @param $attr + * @param string $filter + * @param string|string[] $attr * @param int $limit * @param int $offset * @return array @@ -652,7 +652,7 @@ class Access extends LDAPUtility { } /** - * @param $list + * @param array $list * @param bool $manyAttributes * @return array */ @@ -672,7 +672,7 @@ class Access extends LDAPUtility { /** * @brief executes an LDAP search, optimized for Users * @param string $filter the LDAP filter for the search - * @param string $attr optional, when a certain attribute shall be filtered out + * @param string|string[] $attr optional, when a certain attribute shall be filtered out * @param integer $limit * @param integer $offset * @return array with the search result @@ -685,7 +685,7 @@ class Access extends LDAPUtility { /** * @param string $filter - * @param array $attr + * @param string|string[] $attr * @param int $limit * @param int $offset * @return false|int @@ -697,7 +697,7 @@ class Access extends LDAPUtility { /** * @brief executes an LDAP search, optimized for Groups * @param string $filter the LDAP filter for the search - * @param string $attr optional, when a certain attribute shall be filtered out + * @param string|string[] $attr optional, when a certain attribute shall be filtered out * @param integer $limit * @param integer $offset * @return array with the search result @@ -712,7 +712,7 @@ class Access extends LDAPUtility { * @brief prepares and executes an LDAP search operation * @param string $filter the LDAP filter for the search * @param array $base an array containing the LDAP subtree(s) that shall be searched - * @param array $attr optional, array, one or more attributes that shall be + * @param string|string[] $attr optional, array, one or more attributes that shall be * retrieved. Results will according to the order in the array. * @param int $limit optional, maximum results to be counted * @param int $offset optional, a starting point @@ -799,7 +799,7 @@ class Access extends LDAPUtility { * @brief executes an LDAP search, but counts the results only * @param string $filter the LDAP filter for the search * @param array $base an array containing the LDAP subtree(s) that shall be searched - * @param array $attr optional, array, one or more attributes that shall be + * @param string|string[] $attr optional, array, one or more attributes that shall be * retrieved. Results will according to the order in the array. * @param int $limit optional, maximum results to be counted * @param int $offset optional, a starting point @@ -840,9 +840,9 @@ class Access extends LDAPUtility { } /** - * @param $searchResults - * @param $limit - * @param $hasHitLimit + * @param array $searchResults + * @param int $limit + * @param bool $hasHitLimit * @return int */ private function countEntriesInSearchResults($searchResults, $limit, &$hasHitLimit) { @@ -864,7 +864,7 @@ class Access extends LDAPUtility { * @brief Executes an LDAP search * @param string $filter the LDAP filter for the search * @param array $base an array containing the LDAP subtree(s) that shall be searched - * @param array $attr optional, array, one or more attributes that shall be + * @param string|string[] $attr optional, array, one or more attributes that shall be * @param int $limit * @param int $offset * @param bool $skipHandling @@ -897,7 +897,7 @@ class Access extends LDAPUtility { $findings = array(); foreach($sr as $res) { - $findings = array_merge($findings, $this->ldap->getEntries($cr , $res )); + $findings = array_merge($findings, $this->ldap->getEntries($cr , $res )); } $this->processPagedSearchStatus($sr, $filter, $base, $findings['count'], @@ -969,7 +969,7 @@ class Access extends LDAPUtility { } /** - * @param $name + * @param string $name * @return bool|mixed|string */ public function sanitizeUsername($name) { @@ -1003,7 +1003,7 @@ class Access extends LDAPUtility { /** * @brief combines the input filters with AND - * @param $filters array, the filters to connect + * @param string[] $filters the filters to connect * @return string the combined filter */ public function combineFilterWithAnd($filters) { @@ -1012,7 +1012,7 @@ class Access extends LDAPUtility { /** * @brief combines the input filters with AND - * @param $filters array, the filters to connect + * @param string[] $filters the filters to connect * @return string the combined filter */ public function combineFilterWithOr($filters) { @@ -1021,17 +1021,17 @@ class Access extends LDAPUtility { /** * @brief combines the input filters with given operator - * @param $filters array, the filters to connect + * @param string[] $filters the filters to connect * @param string $operator either & or | * @return string the combined filter */ private function combineFilter($filters, $operator) { $combinedFilter = '('.$operator; foreach($filters as $filter) { - if(!empty($filter) && $filter[0] !== '(') { + if(!empty($filter) && $filter[0] !== '(') { $filter = '('.$filter.')'; - } - $combinedFilter.=$filter; + } + $combinedFilter.=$filter; } $combinedFilter.=')'; return $combinedFilter; @@ -1062,7 +1062,7 @@ class Access extends LDAPUtility { /** * @brief creates a filter part for searches * @param string $search the search term - * @param $searchAttributes + * @param string[]|null $searchAttributes * @param string $fallbackAttribute a fallback attribute in case the user * did not define search attributes. Typically the display name attribute. * @return string the final filter part to use in LDAP searches @@ -1152,7 +1152,7 @@ class Access extends LDAPUtility { } /** - * @param $dn + * @param string $dn * @param bool $isUser * @return array|bool|false */ @@ -1220,7 +1220,7 @@ class Access extends LDAPUtility { /** * @brief checks if the given DN is part of the given base DN(s) * @param string $dn the DN - * @param $bases array containing the allowed base DN or DNs + * @param string[] $bases array containing the allowed base DN or DNs * @return bool */ private function isDNPartOfBase($dn, $bases) { @@ -1293,8 +1293,8 @@ class Access extends LDAPUtility { /** * @brief Prepares a paged search, if possible * @param string $filter the LDAP filter for the search - * @param array $bases an array containing the LDAP subtree(s) that shall be searched - * @param array $attr optional, when a certain attribute shall be filtered outside + * @param string[] $bases an array containing the LDAP subtree(s) that shall be searched + * @param string[] $attr optional, when a certain attribute shall be filtered outside * @param int $limit * @param int $offset * @return bool|true diff --git a/apps/user_ldap/lib/configuration.php b/apps/user_ldap/lib/configuration.php index a9d65963ad5..c6c3c6b89bf 100644 --- a/apps/user_ldap/lib/configuration.php +++ b/apps/user_ldap/lib/configuration.php @@ -81,7 +81,7 @@ class Configuration { ); /** - * @param $configPrefix + * @param string $configPrefix * @param bool $autoRead */ public function __construct($configPrefix, $autoRead = true) { @@ -92,7 +92,7 @@ class Configuration { } /** - * @param $name + * @param string $name * @return mixed|void */ public function __get($name) { @@ -102,8 +102,8 @@ class Configuration { } /** - * @param $name - * @param $value + * @param string $name + * @param mixed $value */ public function __set($name, $value) { $this->setConfiguration(array($name => $value)); @@ -120,7 +120,7 @@ class Configuration { * @brief set LDAP configuration with values delivered by an array, not read * from configuration. It does not save the configuration! To do so, you * must call saveConfiguration afterwards. - * @param $config array that holds the config parameters in an associated + * @param array $config array that holds the config parameters in an associated * array * @param array &$applied optional; array where the set fields will be given to * @return false|null @@ -250,7 +250,7 @@ class Configuration { } /** - * @param $varName + * @param string $varName * @return array|string */ protected function getMultiLine($varName) { @@ -265,8 +265,8 @@ class Configuration { } /** - * @param $varName - * @param $value + * @param string $varName + * @param array|string $value */ protected function setMultiLine($varName, $value) { if(empty($value)) { @@ -282,7 +282,7 @@ class Configuration { } /** - * @param $varName + * @param string $varName * @return string */ protected function getPwd($varName) { @@ -290,7 +290,7 @@ class Configuration { } /** - * @param $varName + * @param string $varName * @return string */ protected function getLcValue($varName) { @@ -298,7 +298,7 @@ class Configuration { } /** - * @param $varName + * @param string $varName * @return string */ protected function getSystemValue($varName) { @@ -307,7 +307,7 @@ class Configuration { } /** - * @param $varName + * @param string $varName * @return string */ protected function getValue($varName) { @@ -321,16 +321,16 @@ class Configuration { } /** - * @param $varName - * @param $value + * @param string $varName + * @param mixed $value */ protected function setValue($varName, $value) { $this->config[$varName] = $value; } /** - * @param $varName - * @param $value + * @param string $varName + * @param string $value * @return bool */ protected function saveValue($varName, $value) { @@ -448,4 +448,4 @@ class Configuration { return $array; } -}
\ No newline at end of file +} diff --git a/apps/user_ldap/lib/connection.php b/apps/user_ldap/lib/connection.php index 847a984bb4d..3a900a6fce4 100644 --- a/apps/user_ldap/lib/connection.php +++ b/apps/user_ldap/lib/connection.php @@ -84,7 +84,7 @@ class Connection extends LDAPUtility { } /** - * @param $name + * @param string $name * @return bool|mixed|void */ public function __get($name) { @@ -100,8 +100,8 @@ class Connection extends LDAPUtility { } /** - * @param $name - * @param $value + * @param string $name + * @param mixed $value */ public function __set($name, $value) { $this->doNotValidate = false; @@ -142,7 +142,7 @@ class Connection extends LDAPUtility { } /** - * @param $key + * @param string|null $key * @return string */ private function getCacheKey($key) { @@ -154,7 +154,7 @@ class Connection extends LDAPUtility { } /** - * @param $key + * @param string $key * @return mixed|null */ public function getFromCache($key) { @@ -174,7 +174,7 @@ class Connection extends LDAPUtility { } /** - * @param $key + * @param string $key * @return bool */ public function isCached($key) { @@ -189,8 +189,8 @@ class Connection extends LDAPUtility { } /** - * @param $key - * @param $value + * @param string $key + * @param mixed $value */ public function writeToCache($key, $value) { if(!$this->configured) { @@ -224,7 +224,7 @@ class Connection extends LDAPUtility { /** * @brief set LDAP configuration with values delivered by an array, not read from configuration - * @param $config array that holds the config parameters in an associated array + * @param array $config array that holds the config parameters in an associated array * @param array &$setParameters optional; array where the set fields will be given to * @return boolean true if config validates, false otherwise. Check with $setParameters for detailed success on single parameters */ @@ -289,7 +289,7 @@ class Connection extends LDAPUtility { private function doSoftValidation() { //if User or Group Base are not set, take over Base DN setting foreach(array('ldapBaseUsers', 'ldapBaseGroups') as $keyBase) { - $val = $this->configuration->$keyBase; + $val = $this->configuration->$keyBase; if(empty($val)) { $obj = strpos('Users', $keyBase) !== false ? 'Users' : 'Groups'; \OCP\Util::writeLog('user_ldap', @@ -523,8 +523,8 @@ class Connection extends LDAPUtility { } /** - * @param $host - * @param $port + * @param string $host + * @param string $port * @return false|void */ private function doConnect($host, $port) { diff --git a/apps/user_ldap/lib/ildapwrapper.php b/apps/user_ldap/lib/ildapwrapper.php index 146ada125bb..e17f787dbb6 100644 --- a/apps/user_ldap/lib/ildapwrapper.php +++ b/apps/user_ldap/lib/ildapwrapper.php @@ -52,15 +52,15 @@ interface ILDAPWrapper { * @param int $pageSize number of results per page * @param bool $isCritical Indicates whether the pagination is critical of not. * @param array $cookie structure sent by LDAP server - * @return true on success, false otherwise + * @return bool true on success, false otherwise */ public function controlPagedResult($link, $pageSize, $isCritical, $cookie); /** * @brief Retrieve the LDAP pagination cookie - * @param $link LDAP link resource - * @param $result LDAP result resource - * @param array $cookie structure sent by LDAP server + * @param resource $link LDAP link resource + * @param resource $result LDAP result resource + * @param string $cookie structure sent by LDAP server * @return bool true on success, false otherwise * * Corresponds to ldap_control_paged_result_response @@ -162,15 +162,15 @@ interface ILDAPWrapper { /** * @brief establish Start TLS - * @param resource|$link LDAP link resource + * @param resource $link LDAP link resource * @return bool true on success, false otherwise */ public function startTls($link); /** * @brief Sort the result of a LDAP search - * @param $link LDAP link resource - * @param $result LDAP result resource + * @param resource $link LDAP link resource + * @param resource $result LDAP result resource * @param string $sortFilter attribute to use a key in sort */ public function sort($link, $result, $sortFilter); diff --git a/apps/user_ldap/lib/jobs.php b/apps/user_ldap/lib/jobs.php index 49c77719721..19c041e4db4 100644 --- a/apps/user_ldap/lib/jobs.php +++ b/apps/user_ldap/lib/jobs.php @@ -34,7 +34,7 @@ class Jobs extends \OC\BackgroundJob\TimedJob { } /** - * @param $argument + * @param mixed $argument */ public function run($argument){ Jobs::updateGroups(); @@ -69,7 +69,7 @@ class Jobs extends \OC\BackgroundJob\TimedJob { } /** - * @param $groups + * @param string[] $groups */ static private function handleKnownGroups($groups) { \OCP\Util::writeLog('user_ldap', 'bgJ "updateGroups" – Dealing with known Groups.', \OCP\Util::DEBUG); @@ -80,26 +80,26 @@ class Jobs extends \OC\BackgroundJob\TimedJob { '); foreach($groups as $group) { //we assume, that self::$groupsFromDB has been retrieved already - $knownUsers = unserialize(self::$groupsFromDB[$group]['owncloudusers']); - $actualUsers = self::getGroupBE()->usersInGroup($group); - $hasChanged = false; - foreach(array_diff($knownUsers, $actualUsers) as $removedUser) { - \OCP\Util::emitHook('OC_User', 'post_removeFromGroup', array('uid' => $removedUser, 'gid' => $group)); - \OCP\Util::writeLog('user_ldap', + $knownUsers = unserialize(self::$groupsFromDB[$group]['owncloudusers']); + $actualUsers = self::getGroupBE()->usersInGroup($group); + $hasChanged = false; + foreach(array_diff($knownUsers, $actualUsers) as $removedUser) { + \OCP\Util::emitHook('OC_User', 'post_removeFromGroup', array('uid' => $removedUser, 'gid' => $group)); + \OCP\Util::writeLog('user_ldap', 'bgJ "updateGroups" – "'.$removedUser.'" removed from "'.$group.'".', \OCP\Util::INFO); - $hasChanged = true; - } - foreach(array_diff($actualUsers, $knownUsers) as $addedUser) { - \OCP\Util::emitHook('OC_User', 'post_addToGroup', array('uid' => $addedUser, 'gid' => $group)); - \OCP\Util::writeLog('user_ldap', + $hasChanged = true; + } + foreach(array_diff($actualUsers, $knownUsers) as $addedUser) { + \OCP\Util::emitHook('OC_User', 'post_addToGroup', array('uid' => $addedUser, 'gid' => $group)); + \OCP\Util::writeLog('user_ldap', 'bgJ "updateGroups" – "'.$addedUser.'" added to "'.$group.'".', \OCP\Util::INFO); - $hasChanged = true; - } - if($hasChanged) { + $hasChanged = true; + } + if($hasChanged) { $query->execute(array(serialize($actualUsers), $group)); - } + } } \OCP\Util::writeLog('user_ldap', 'bgJ "updateGroups" – FINISHED dealing with known Groups.', @@ -107,7 +107,7 @@ class Jobs extends \OC\BackgroundJob\TimedJob { } /** - * @param $createdGroups + * @param string[] $createdGroups */ static private function handleCreatedGroups($createdGroups) { \OCP\Util::writeLog('user_ldap', 'bgJ "updateGroups" – dealing with created Groups.', \OCP\Util::DEBUG); @@ -121,7 +121,7 @@ class Jobs extends \OC\BackgroundJob\TimedJob { 'bgJ "updateGroups" – new group "'.$createdGroup.'" found.', \OCP\Util::INFO); $users = serialize(self::getGroupBE()->usersInGroup($createdGroup)); - $query->execute(array($createdGroup, $users)); + $query->execute(array($createdGroup, $users)); } \OCP\Util::writeLog('user_ldap', 'bgJ "updateGroups" – FINISHED dealing with created Groups.', @@ -129,7 +129,7 @@ class Jobs extends \OC\BackgroundJob\TimedJob { } /** - * @param $removedGroups + * @param string[] $removedGroups */ static private function handleRemovedGroups($removedGroups) { \OCP\Util::writeLog('user_ldap', 'bgJ "updateGroups" – dealing with removed groups.', \OCP\Util::DEBUG); @@ -142,7 +142,7 @@ class Jobs extends \OC\BackgroundJob\TimedJob { \OCP\Util::writeLog('user_ldap', 'bgJ "updateGroups" – group "'.$removedGroup.'" was removed.', \OCP\Util::INFO); - $query->execute(array($removedGroup)); + $query->execute(array($removedGroup)); } \OCP\Util::writeLog('user_ldap', 'bgJ "updateGroups" – FINISHED dealing with removed groups.', @@ -184,7 +184,7 @@ class Jobs extends \OC\BackgroundJob\TimedJob { $result = $query->execute()->fetchAll(); self::$groupsFromDB = array(); foreach($result as $dataset) { - self::$groupsFromDB[$dataset['owncloudname']] = $dataset; + self::$groupsFromDB[$dataset['owncloudname']] = $dataset; } return self::$groupsFromDB; diff --git a/apps/user_ldap/lib/ldap.php b/apps/user_ldap/lib/ldap.php index 9962d1267b8..212eea0d8e9 100644 --- a/apps/user_ldap/lib/ldap.php +++ b/apps/user_ldap/lib/ldap.php @@ -49,7 +49,7 @@ class LDAP implements ILDAPWrapper { /** * @param LDAP $link * @param LDAP $result - * @param $cookie + * @param string $cookie * @return bool|LDAP */ public function controlPagedResultResponse($link, $result, &$cookie) { @@ -65,7 +65,7 @@ class LDAP implements ILDAPWrapper { * @param LDAP $link * @param int $pageSize * @param bool $isCritical - * @param array $cookie + * @param string $cookie * @return mixed|true */ public function controlPagedResult($link, $pageSize, $isCritical, $cookie) { @@ -248,7 +248,7 @@ class LDAP implements ILDAPWrapper { /** * @param string $functionName - * @param $args + * @param array $args */ private function preFunctionCall($functionName, $args) { $this->curFunc = $functionName; diff --git a/apps/user_ldap/lib/proxy.php b/apps/user_ldap/lib/proxy.php index 50e8071a584..f7ba9082e09 100644 --- a/apps/user_ldap/lib/proxy.php +++ b/apps/user_ldap/lib/proxy.php @@ -38,7 +38,7 @@ abstract class Proxy { } /** - * @param $configPrefix + * @param string $configPrefix */ private function addAccess($configPrefix) { $connector = new Connection($this->ldap, $configPrefix); @@ -46,7 +46,7 @@ abstract class Proxy { } /** - * @param $configPrefix + * @param string $configPrefix * @return mixed */ protected function getAccess($configPrefix) { @@ -57,7 +57,7 @@ abstract class Proxy { } /** - * @param $uid + * @param string $uid * @return string */ protected function getUserCacheKey($uid) { @@ -65,7 +65,7 @@ abstract class Proxy { } /** - * @param $gid + * @param string $gid * @return string */ protected function getGroupCacheKey($gid) { @@ -73,25 +73,25 @@ abstract class Proxy { } /** - * @param $id - * @param $method - * @param $parameters + * @param string $id + * @param string $method + * @param array $parameters * @param bool $passOnWhen * @return mixed */ abstract protected function callOnLastSeenOn($id, $method, $parameters, $passOnWhen); /** - * @param $id - * @param $method - * @param $parameters + * @param string $id + * @param string $method + * @param array $parameters * @return mixed */ abstract protected function walkBackends($id, $method, $parameters); /** * @brief Takes care of the request to the User backend - * @param $id + * @param string $id * @param string $method string, the method of the user backend that shall be called * @param array $parameters an array of parameters to be passed * @param bool $passOnWhen @@ -106,7 +106,7 @@ abstract class Proxy { } /** - * @param $key + * @param string|null $key * @return string */ private function getCacheKey($key) { @@ -118,7 +118,7 @@ abstract class Proxy { } /** - * @param $key + * @param string $key * @return mixed|null */ public function getFromCache($key) { @@ -131,7 +131,7 @@ abstract class Proxy { } /** - * @param $key + * @param string $key * @return bool */ public function isCached($key) { @@ -140,8 +140,8 @@ abstract class Proxy { } /** - * @param $key - * @param $value + * @param string $key + * @param mixed $value */ public function writeToCache($key, $value) { $key = $this->getCacheKey($key); diff --git a/apps/user_ldap/lib/wizard.php b/apps/user_ldap/lib/wizard.php index 8d944c9a957..d1f3f7bf3f1 100644 --- a/apps/user_ldap/lib/wizard.php +++ b/apps/user_ldap/lib/wizard.php @@ -641,7 +641,7 @@ class Wizard extends LDAPUtility { //assuming only groups have their cn cached :) continue; } - $filter = strtolower($filterPrefix . $dn . $filterSuffix); + $filter = strtolower($filterPrefix . $dn . $filterSuffix); $rr = $this->ldap->search($cr, $base, $filter, array('dn')); if(!$this->ldap->isResource($rr)) { continue; @@ -776,7 +776,7 @@ class Wizard extends LDAPUtility { if(is_array($attrsToFilter) && count($attrsToFilter) > 0) { $filterAttributes = '(|'; foreach($attrsToFilter as $attribute) { - $filterAttributes .= '(' . $attribute . $loginpart . ')'; + $filterAttributes .= '(' . $attribute . $loginpart . ')'; } $filterAttributes .= ')'; $parts++; @@ -909,7 +909,7 @@ class Wizard extends LDAPUtility { * specified attribute * @param string[] $filters array, the filters that shall be used in the search * @param string $attr the attribute of which a list of values shall be returned - * @param $lfw bool, whether the last filter is a wildcard which shall not + * @param bool $lfw whether the last filter is a wildcard which shall not * be processed if there were already findings, defaults to true * @param int $dnReadLimit the amount of how many DNs should be analyzed. * The lower, the faster @@ -987,7 +987,7 @@ class Wizard extends LDAPUtility { * @param string $dbkey the dbkey of the setting the feature is connected to * @param string $confkey the confkey counterpart for the $dbkey as used in the * Configuration class - * @param $po boolean, whether the objectClass with most result entries + * @param bool $po whether the objectClass with most result entries * shall be pre-selected via the result * @return array, list of found items. * @throws \Exception @@ -1041,9 +1041,9 @@ class Wizard extends LDAPUtility { /** * @brief appends a list of values fr - * @param $result resource, the return value from ldap_get_attributes + * @param resource $result the return value from ldap_get_attributes * @param string $attribute the attribute values to look for - * @param &$known array, new values will be appended here + * @param array &$known new values will be appended here * @return int, state on of the class constants LRESULT_PROCESSED_OK, * LRESULT_PROCESSED_INVALID or LRESULT_PROCESSED_SKIP */ diff --git a/apps/user_ldap/lib/wizardresult.php b/apps/user_ldap/lib/wizardresult.php index 5ed16732ca0..42b0bc04654 100644 --- a/apps/user_ldap/lib/wizardresult.php +++ b/apps/user_ldap/lib/wizardresult.php @@ -29,8 +29,8 @@ class WizardResult { protected $markedChange = false; /** - * @param $key - * @param $value + * @param string $key + * @param mixed $value */ public function addChange($key, $value) { $this->changes[$key] = $value; @@ -72,4 +72,4 @@ class WizardResult { } return $result; } -}
\ No newline at end of file +} diff --git a/apps/user_ldap/settings.php b/apps/user_ldap/settings.php index 6b7d8e6f53e..7acc997e288 100644 --- a/apps/user_ldap/settings.php +++ b/apps/user_ldap/settings.php @@ -71,7 +71,7 @@ $tmpl->assign('settingControls', $sControls); $config = new \OCA\user_ldap\lib\Configuration('', false); $defaults = $config->getDefaults(); foreach($defaults as $key => $default) { - $tmpl->assign($key.'_default', $default); + $tmpl->assign($key.'_default', $default); } return $tmpl->fetchPage(); diff --git a/apps/user_ldap/tests/user_ldap.php b/apps/user_ldap/tests/user_ldap.php index cb4c3b316dc..ca8aeb12f87 100644 --- a/apps/user_ldap/tests/user_ldap.php +++ b/apps/user_ldap/tests/user_ldap.php @@ -79,7 +79,7 @@ class Test_User_Ldap_Direct extends \PHPUnit_Framework_TestCase { /** * @brief Prepares the Access mock for checkPassword tests - * @param $access mock of \OCA\user_ldap\lib\Access + * @param \OCA\user_ldap\lib\Access $access mock * @return void */ private function prepareAccessForCheckPassword(&$access) { @@ -187,7 +187,7 @@ class Test_User_Ldap_Direct extends \PHPUnit_Framework_TestCase { /** * @brief Prepares the Access mock for getUsers tests - * @param $access mock of \OCA\user_ldap\lib\Access + * @param \OCA\user_ldap\lib\Access $access mock * @return void */ private function prepareAccessForGetUsers(&$access) { @@ -557,4 +557,4 @@ class Test_User_Ldap_Direct extends \PHPUnit_Framework_TestCase { $result = $backend->countUsers(); $this->assertFalse($result); } -}
\ No newline at end of file +} diff --git a/apps/user_ldap/user_ldap.php b/apps/user_ldap/user_ldap.php index 757de6b60f4..7e8c557f047 100644 --- a/apps/user_ldap/user_ldap.php +++ b/apps/user_ldap/user_ldap.php @@ -70,8 +70,8 @@ class USER_LDAP extends BackendUtility implements \OCP\UserInterface { /** * @brief reads jpegPhoto and set is as avatar if available - * @param $uid string ownCloud user name - * @param $dn string the user's LDAP DN + * @param string $uid ownCloud user name + * @param string $dn the user's LDAP DN * @return void */ private function updateAvatar($uid, $dn) { @@ -118,7 +118,7 @@ class USER_LDAP extends BackendUtility implements \OCP\UserInterface { /** * @brief checks whether the user is allowed to change his avatar in ownCloud - * @param $uid string the ownCloud user name + * @param string $uid the ownCloud user name * @return boolean either the user can or cannot */ public function canChangeAvatar($uid) { @@ -136,8 +136,8 @@ class USER_LDAP extends BackendUtility implements \OCP\UserInterface { /** * @brief reads the image from LDAP that shall be used as Avatar - * @param $uid string, the ownCloud user name - * @param $dn string, the user DN + * @param string $uid the ownCloud user name + * @param string $dn the user DN * @return string data (provided by LDAP) | false */ private function getAvatarImage($uid, $dn) { @@ -200,7 +200,7 @@ class USER_LDAP extends BackendUtility implements \OCP\UserInterface { /** * @brief Get a list of all users - * @returns array with all uids + * @return string[] with all uids * * Get a list of all users. */ @@ -272,8 +272,8 @@ class USER_LDAP extends BackendUtility implements \OCP\UserInterface { /** * @brief delete a user - * @param $uid The username of the user to delete - * @returns true/false + * @param string $uid The username of the user to delete + * @return bool * * Deletes a user */ @@ -326,8 +326,8 @@ class USER_LDAP extends BackendUtility implements \OCP\UserInterface { /** * @brief get display name of the user - * @param $uid user ID of the user - * @return display name + * @param string $uid user ID of the user + * @return string display name */ public function getDisplayName($uid) { if(!$this->userExists($uid)) { @@ -353,7 +353,7 @@ class USER_LDAP extends BackendUtility implements \OCP\UserInterface { /** * @brief Get a list of all display names - * @returns array with all displayNames (value) and the correspondig uids (key) + * @return array with all displayNames (value) and the correspondig uids (key) * * Get a list of all display names and user ids. */ @@ -372,10 +372,10 @@ class USER_LDAP extends BackendUtility implements \OCP\UserInterface { return $displayNames; } - /** + /** * @brief Check if backend implements actions - * @param $actions bitwise-or'ed actions - * @returns boolean + * @param int $actions bitwise-or'ed actions + * @return boolean * * Returns the supported actions as int to be * compared with OC_USER_BACKEND_CREATE_USER etc. @@ -399,7 +399,7 @@ class USER_LDAP extends BackendUtility implements \OCP\UserInterface { /** * counts the users in LDAP * - * @return int | bool + * @return int|bool */ public function countUsers() { $filter = \OCP\Util::mb_str_replace( diff --git a/apps/user_ldap/user_proxy.php b/apps/user_ldap/user_proxy.php index 2cb3dfb2c60..77d08ada703 100644 --- a/apps/user_ldap/user_proxy.php +++ b/apps/user_ldap/user_proxy.php @@ -31,12 +31,12 @@ class User_Proxy extends lib\Proxy implements \OCP\UserInterface { /** * @brief Constructor - * @param $serverConfigPrefixes array containing the config Prefixes + * @param array $serverConfigPrefixes array containing the config Prefixes */ public function __construct($serverConfigPrefixes, ILDAPWrapper $ldap) { parent::__construct($ldap); foreach($serverConfigPrefixes as $configPrefix) { - $this->backends[$configPrefix] = + $this->backends[$configPrefix] = new \OCA\user_ldap\USER_LDAP($this->getAccess($configPrefix)); if(is_null($this->refBackend)) { $this->refBackend = &$this->backends[$configPrefix]; @@ -46,12 +46,12 @@ class User_Proxy extends lib\Proxy implements \OCP\UserInterface { /** * @brief Tries the backends one after the other until a positive result is returned from the specified method - * @param $uid string, the uid connected to the request - * @param $method string, the method of the user backend that shall be called - * @param $parameters an array of parameters to be passed - * @return mixed, the result of the method or false + * @param string $uid the uid connected to the request + * @param string $method the method of the user backend that shall be called + * @param array $parameters an array of parameters to be passed + * @return mixed the result of the method or false */ - protected function walkBackends($uid, $method, $parameters) { + protected function walkBackends($uid, $method, $parameters) { $cacheKey = $this->getUserCacheKey($uid); foreach($this->backends as $configPrefix => $backend) { $instance = $backend; @@ -69,13 +69,13 @@ class User_Proxy extends lib\Proxy implements \OCP\UserInterface { /** * @brief Asks the backend connected to the server that supposely takes care of the uid from the request. - * @param $uid string, the uid connected to the request - * @param $method string, the method of the user backend that shall be called - * @param $parameters an array of parameters to be passed - * @param $passOnWhen the result matches this variable - * @return mixed, the result of the method or false + * @param string $uid the uid connected to the request + * @param string $method the method of the user backend that shall be called + * @param array $parameters an array of parameters to be passed + * @param mixed $passOnWhen the result matches this variable + * @return mixed the result of the method or false */ - protected function callOnLastSeenOn($uid, $method, $parameters, $passOnWhen) { + protected function callOnLastSeenOn($uid, $method, $parameters, $passOnWhen) { $cacheKey = $this->getUserCacheKey($uid); $prefix = $this->getFromCache($cacheKey); //in case the uid has been found in the past, try this stored connection first @@ -106,8 +106,8 @@ class User_Proxy extends lib\Proxy implements \OCP\UserInterface { /** * @brief Check if backend implements actions - * @param $actions bitwise-or'ed actions - * @returns boolean + * @param int $actions bitwise-or'ed actions + * @return boolean * * Returns the supported actions as int to be * compared with OC_USER_BACKEND_CREATE_USER etc. @@ -119,7 +119,7 @@ class User_Proxy extends lib\Proxy implements \OCP\UserInterface { /** * @brief Get a list of all users - * @returns array with all uids + * @return string[] with all uids * * Get a list of all users. */ @@ -146,9 +146,9 @@ class User_Proxy extends lib\Proxy implements \OCP\UserInterface { /** * @brief Check if the password is correct - * @param $uid The username - * @param $password The password - * @returns true/false + * @param string $uid The username + * @param string $password The password + * @return bool * * Check if the password is correct without logging in the user */ @@ -167,8 +167,8 @@ class User_Proxy extends lib\Proxy implements \OCP\UserInterface { /** * @brief get display name of the user - * @param $uid user ID of the user - * @return display name + * @param string $uid user ID of the user + * @return string display name */ public function getDisplayName($uid) { return $this->handleRequest($uid, 'getDisplayName', array($uid)); @@ -176,7 +176,7 @@ class User_Proxy extends lib\Proxy implements \OCP\UserInterface { /** * @brief checks whether the user is allowed to change his avatar in ownCloud - * @param $uid string the ownCloud user name + * @param string $uid the ownCloud user name * @return boolean either the user can or cannot */ public function canChangeAvatar($uid) { @@ -185,7 +185,7 @@ class User_Proxy extends lib\Proxy implements \OCP\UserInterface { /** * @brief Get a list of all display names - * @returns array with all displayNames (value) and the corresponding uids (key) + * @return array with all displayNames (value) and the corresponding uids (key) * * Get a list of all display names and user ids. */ @@ -203,8 +203,8 @@ class User_Proxy extends lib\Proxy implements \OCP\UserInterface { /** * @brief delete a user - * @param $uid The username of the user to delete - * @returns true/false + * @param string $uid The username of the user to delete + * @return bool * * Deletes a user */ @@ -221,7 +221,7 @@ class User_Proxy extends lib\Proxy implements \OCP\UserInterface { /** * @brief Count the number of users - * @returns int | bool + * @return int|bool */ public function countUsers() { $users = false; |