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
This commit is contained in:
Andreas Fischer 2014-05-19 14:08:42 +02:00
commit 6c4b650524
43 changed files with 338 additions and 342 deletions

View File

@ -68,8 +68,8 @@ $storageInfo=OC_Helper::getStorageInfo('/', $dirInfo);
// if the encryption app is disabled, than everything is fine (INIT_SUCCESSFUL status code) // if the encryption app is disabled, than everything is fine (INIT_SUCCESSFUL status code)
$encryptionInitStatus = 2; $encryptionInitStatus = 2;
if (OC_App::isEnabled('files_encryption')) { if (OC_App::isEnabled('files_encryption')) {
$session = new \OCA\Encryption\Session(new \OC\Files\View('/')); $session = new \OCA\Encryption\Session(new \OC\Files\View('/'));
$encryptionInitStatus = $session->getInitialized(); $encryptionInitStatus = $session->getInitialized();
} }
$nav = new OCP\Template('files', 'appnavigation', ''); $nav = new OCP\Template('files', 'appnavigation', '');

View File

@ -167,7 +167,7 @@ class Helper
/** /**
* Sort the given file info array * Sort the given file info array
* *
* @param \OCP\Files\FileInfo[] files to sort * @param \OCP\Files\FileInfo[] $files files to sort
* @param string $sortAttribute attribute to sort on * @param string $sortAttribute attribute to sort on
* @param bool $sortDescending true for descending sort, false otherwise * @param bool $sortDescending true for descending sort, false otherwise
* @return \OCP\Files\FileInfo[] sorted files * @return \OCP\Files\FileInfo[] sorted files

View File

@ -262,7 +262,7 @@ class Hooks {
* @brief check if files can be encrypted to every user. * @brief check if files can be encrypted to every user.
*/ */
/** /**
* @param $params * @param array $params
*/ */
public static function preShared($params) { public static function preShared($params) {
@ -422,7 +422,7 @@ class Hooks {
/** /**
* @brief after a file is renamed, rename its keyfile and share-keys also fix the file size and fix also the sharing * @brief after a file is renamed, rename its keyfile and share-keys also fix the file size and fix also the sharing
* @param array with oldpath and newpath * @param array $params array with oldpath and newpath
* *
* This function is connected to the rename signal of OC_Filesystem and adjust the name and location * This function is connected to the rename signal of OC_Filesystem and adjust the name and location
* of the stored versions along the actual file * of the stored versions along the actual file

View File

@ -125,7 +125,7 @@ class Crypt {
/** /**
* @brief Check if a file's contents contains an IV and is symmetrically encrypted * @brief Check if a file's contents contains an IV and is symmetrically encrypted
* @param $content * @param string $content
* @return boolean * @return boolean
* @note see also OCA\Encryption\Util->isEncryptedPath() * @note see also OCA\Encryption\Util->isEncryptedPath()
*/ */
@ -179,10 +179,9 @@ class Crypt {
/** /**
* @brief Check if a file is encrypted via legacy system * @brief Check if a file is encrypted via legacy system
* @param $data * @param boolean $isCatFileContent
* @param string $relPath The path of the file, relative to user/data; * @param string $relPath The path of the file, relative to user/data;
* e.g. filename or /Docs/filename, NOT admin/files/filename * e.g. filename or /Docs/filename, NOT admin/files/filename
* @param boolean $isCatFileContent
* @return boolean * @return boolean
*/ */
public static function isLegacyEncryptedContent($isCatFileContent, $relPath) { public static function isLegacyEncryptedContent($isCatFileContent, $relPath) {
@ -323,7 +322,7 @@ class Crypt {
/** /**
* @brief Symmetrically decrypts keyfile content * @brief Symmetrically decrypts keyfile content
* @param $keyfileContent * @param string $keyfileContent
* @param string $passphrase * @param string $passphrase
* @throws \Exception * @throws \Exception
* @return string|false * @return string|false
@ -362,7 +361,7 @@ class Crypt {
* @brief Decrypt private key and check if the result is a valid keyfile * @brief Decrypt private key and check if the result is a valid keyfile
* @param string $encryptedKey encrypted keyfile * @param string $encryptedKey encrypted keyfile
* @param string $passphrase to decrypt keyfile * @param string $passphrase to decrypt keyfile
* @return encrypted private key or false * @return string|false encrypted private key or false
* *
* This function decrypts a file * This function decrypts a file
*/ */
@ -435,9 +434,9 @@ class Crypt {
/** /**
* @brief Asymmetrically encrypt a file using multiple public keys * @brief Asymmetrically encrypt a file using multiple public keys
* @param $encryptedContent * @param string $encryptedContent
* @param $shareKey * @param string $shareKey
* @param $privateKey * @param mixed $privateKey
* @return false|string * @return false|string
* @internal param string $plainContent content to be encrypted * @internal param string $plainContent content to be encrypted
* @return string $plainContent decrypted string * @return string $plainContent decrypted string
@ -498,7 +497,7 @@ class Crypt {
/** /**
* @brief Generate a pseudo random 256-bit ASCII key, used as file key * @brief Generate a pseudo random 256-bit ASCII key, used as file key
* @return $key Generated key * @return string|false Generated key
*/ */
public static function generateKey() { public static function generateKey() {
@ -524,7 +523,7 @@ class Crypt {
/** /**
* @brief Get the blowfish encryption handler for a key * @brief Get the blowfish encryption handler for a key
* @param $key string (optional) * @param string $key (optional)
* @return \Crypt_Blowfish blowfish object * @return \Crypt_Blowfish blowfish object
* *
* if the key is left out, the default handler will be used * if the key is left out, the default handler will be used
@ -561,7 +560,7 @@ class Crypt {
} }
/** /**
* @param $data * @param string $data
* @param string $key * @param string $key
* @param int $maxLength * @param int $maxLength
* @return string * @return string

View File

@ -102,7 +102,7 @@ class Helper {
/** /**
* @brief enable recovery * @brief enable recovery
* *
* @param $recoveryKeyId * @param string $recoveryKeyId
* @param string $recoveryPassword * @param string $recoveryPassword
* @internal param \OCA\Encryption\Util $util * @internal param \OCA\Encryption\Util $util
* @internal param string $password * @internal param string $password

View File

@ -57,7 +57,7 @@ class Keymanager {
/** /**
* @brief retrieve public key for a specified user * @brief retrieve public key for a specified user
* @param \OC\Files\View $view * @param \OC\Files\View $view
* @param $userId * @param string $userId
* @return string public key or false * @return string public key or false
*/ */
public static function getPublicKey(\OC\Files\View $view, $userId) { public static function getPublicKey(\OC\Files\View $view, $userId) {
@ -76,7 +76,7 @@ class Keymanager {
/** /**
* @brief Retrieve a user's public and private key * @brief Retrieve a user's public and private key
* @param \OC\Files\View $view * @param \OC\Files\View $view
* @param $userId * @param string $userId
* @return array keys: privateKey, publicKey * @return array keys: privateKey, publicKey
*/ */
public static function getUserKeys(\OC\Files\View $view, $userId) { public static function getUserKeys(\OC\Files\View $view, $userId) {
@ -297,7 +297,7 @@ class Keymanager {
* *
* @param \OC\Files\View $view * @param \OC\Files\View $view
* @param string $path where the share key is stored * @param string $path where the share key is stored
* @param $shareKey * @param string $shareKey
* @return bool true/false * @return bool true/false
* @note The keyfile is not encrypted here. Client code must * @note The keyfile is not encrypted here. Client code must
* asymmetrically encrypt the keyfile before passing it to this method * asymmetrically encrypt the keyfile before passing it to this method

View File

@ -79,8 +79,8 @@ class Proxy extends \OC_FileProxy {
} }
/** /**
* @param $path * @param string $path
* @param $data * @param string $data
* @return bool * @return bool
*/ */
public function preFile_put_contents($path, &$data) { public function preFile_put_contents($path, &$data) {
@ -225,8 +225,8 @@ class Proxy extends \OC_FileProxy {
/** /**
* @param $path * @param string $path
* @param $result * @param resource $result
* @return resource * @return resource
*/ */
public function postFopen($path, &$result) { public function postFopen($path, &$result) {
@ -261,8 +261,8 @@ class Proxy extends \OC_FileProxy {
} }
/** /**
* @param $path * @param string $path
* @param $data * @param array $data
* @return array * @return array
*/ */
public function postGetFileInfo($path, $data) { public function postGetFileInfo($path, $data) {
@ -285,9 +285,9 @@ class Proxy extends \OC_FileProxy {
} }
/** /**
* @param $path * @param string $path
* @param $size * @param int $size
* @return bool * @return int|bool
*/ */
public function postFileSize($path, $size) { public function postFileSize($path, $size) {

View File

@ -121,7 +121,7 @@ class Session {
/** /**
* @brief Sets status of encryption app * @brief Sets status of encryption app
* @param string $init INIT_SUCCESSFUL, INIT_EXECUTED, NOT_INOITIALIZED * @param string $init INIT_SUCCESSFUL, INIT_EXECUTED, NOT_INITIALIZED
* @return bool * @return bool
* *
* @note this doesn not indicate of the init was successful, we just remeber the try! * @note this doesn not indicate of the init was successful, we just remeber the try!
@ -145,7 +145,7 @@ class Session {
/** /**
* @brief Gets status if we already tried to initialize the encryption app * @brief Gets status if we already tried to initialize the encryption app
* @return init status INIT_SUCCESSFUL, INIT_EXECUTED, NOT_INOITIALIZED * @return string init status INIT_SUCCESSFUL, INIT_EXECUTED, NOT_INITIALIZED
* *
* @note this doesn not indicate of the init was successful, we just remeber the try! * @note this doesn not indicate of the init was successful, we just remeber the try!
*/ */

View File

@ -79,10 +79,10 @@ class Stream {
private $privateKey; private $privateKey;
/** /**
* @param $path raw path relative to data/ * @param string $path raw path relative to data/
* @param $mode * @param string $mode
* @param $options * @param int $options
* @param $opened_path * @param string $opened_path
* @return bool * @return bool
*/ */
public function stream_open($path, $mode, $options, &$opened_path) { public function stream_open($path, $mode, $options, &$opened_path) {
@ -180,14 +180,14 @@ class Stream {
/** /**
* @brief Returns the current position of the file pointer * @brief Returns the current position of the file pointer
* @return int position of the file pointer * @return int position of the file pointer
*/ */
public function stream_tell() { public function stream_tell() {
return ftell($this->handle); return ftell($this->handle);
} }
/** /**
* @param $offset * @param int $offset
* @param int $whence * @param int $whence
* @return bool true if fseek was successful, otherwise false * @return bool true if fseek was successful, otherwise false
*/ */
@ -202,7 +202,7 @@ class Stream {
} }
/** /**
* @param $count * @param int $count
* @return bool|string * @return bool|string
* @throws \Exception * @throws \Exception
*/ */
@ -426,9 +426,9 @@ class Stream {
/** /**
* @param $option * @param int $option
* @param $arg1 * @param int $arg1
* @param $arg2 * @param int|null $arg2
*/ */
public function stream_set_option($option, $arg1, $arg2) { public function stream_set_option($option, $arg1, $arg2) {
$return = false; $return = false;
@ -454,7 +454,7 @@ class Stream {
} }
/** /**
* @param $mode * @param int $mode
*/ */
public function stream_lock($mode) { public function stream_lock($mode) {
return flock($this->handle, $mode); return flock($this->handle, $mode);

View File

@ -54,7 +54,7 @@ class Util {
/** /**
* @param \OC\Files\View $view * @param \OC\Files\View $view
* @param $userId * @param string $userId
* @param bool $client * @param bool $client
*/ */
public function __construct($view, $userId, $client = false) { public function __construct($view, $userId, $client = false) {
@ -1238,7 +1238,7 @@ class Util {
/** /**
* @brief check if files are already migrated to the encryption system * @brief check if files are already migrated to the encryption system
* @return migration status, false = in case of no record * @return int|false migration status, false = in case of no record
* @note If records are not being returned, check for a hidden space * @note If records are not being returned, check for a hidden space
* at the start of the uid in db * at the start of the uid in db
*/ */
@ -1398,8 +1398,7 @@ class Util {
/** /**
* @brief get owner of the shared files. * @brief get owner of the shared files.
* @param $id * @param int $id ID of a share
* @internal param int $Id of a share
* @return string owner * @return string owner
*/ */
public function getOwnerFromSharedFile($id) { public function getOwnerFromSharedFile($id) {
@ -1479,7 +1478,7 @@ class Util {
} }
/** /**
* @param $password * @param string $password
* @return bool * @return bool
*/ */
public function checkRecoveryPassword($password) { public function checkRecoveryPassword($password) {
@ -1639,7 +1638,7 @@ class Util {
/** /**
* @brief check if the file is stored on a system wide mount point * @brief check if the file is stored on a system wide mount point
* @param $path relative to /data/user with leading '/' * @param string $path relative to /data/user with leading '/'
* @return boolean * @return boolean
*/ */
public function isSystemWideMountPoint($path) { public function isSystemWideMountPoint($path) {

View File

@ -662,7 +662,7 @@ class Test_Encryption_Crypt extends \PHPUnit_Framework_TestCase {
/** /**
* @brief encryption using legacy blowfish method * @brief encryption using legacy blowfish method
* @param string $data data to encrypt * @param string $data data to encrypt
* @param $passwd string password * @param string $passwd password
* @return string * @return string
*/ */
function legacyEncrypt($data, $passwd) { function legacyEncrypt($data, $passwd) {

View File

@ -554,7 +554,7 @@ class Test_Encryption_Util extends \PHPUnit_Framework_TestCase {
} }
/** /**
* @param $user * @param string $user
* @param bool $create * @param bool $create
* @param bool $password * @param bool $password
*/ */
@ -595,7 +595,7 @@ class Test_Encryption_Util extends \PHPUnit_Framework_TestCase {
* to be able to test the migration path * to be able to test the migration path
* *
* @param integer $status needed migration status for test * @param integer $status needed migration status for test
* @param $user for which user the status should be set * @param string $user for which user the status should be set
* @return boolean * @return boolean
*/ */
private function setMigrationStatus($status, $user) { private function setMigrationStatus($status, $user) {

View File

@ -25,7 +25,7 @@
namespace OC\Files\Storage; namespace OC\Files\Storage;
set_include_path(get_include_path() . PATH_SEPARATOR . set_include_path(get_include_path() . PATH_SEPARATOR .
\OC_App::getAppPath('files_external') . '/3rdparty/aws-sdk-php'); \OC_App::getAppPath('files_external') . '/3rdparty/aws-sdk-php');
require 'aws-autoloader.php'; require 'aws-autoloader.php';
use Aws\S3\S3Client; use Aws\S3\S3Client;

View File

@ -359,10 +359,10 @@ class OC_Mount_Config {
* Add a mount point to the filesystem * Add a mount point to the filesystem
* @param string $mountPoint Mount point * @param string $mountPoint Mount point
* @param string $class Backend class * @param string $class Backend class
* @param array Backend parameters for the class * @param array $classOptions Backend parameters for the class
* @param string $mountType MOUNT_TYPE_GROUP | MOUNT_TYPE_USER * @param string $mountType MOUNT_TYPE_GROUP | MOUNT_TYPE_USER
* @param string $applicable User or group to apply mount to * @param string $applicable User or group to apply mount to
* @param bool Personal or system mount point i.e. is this being called from the personal or admin page * @param bool $isPersonal Personal or system mount point i.e. is this being called from the personal or admin page
* @return boolean * @return boolean
*/ */
public static function addMountPoint($mountPoint, public static function addMountPoint($mountPoint,
@ -410,10 +410,10 @@ class OC_Mount_Config {
/** /**
* *
* @param string Mount point * @param string $mountPoint Mount point
* @param string MOUNT_TYPE_GROUP | MOUNT_TYPE_USER * @param string $mountType MOUNT_TYPE_GROUP | MOUNT_TYPE_USER
* @param string User or group to remove mount from * @param string $applicable User or group to remove mount from
* @param bool Personal or system mount point * @param bool $isPersonal Personal or system mount point
* @return bool * @return bool
*/ */
public static function removeMountPoint($mountPoint, $mountType, $applicable, $isPersonal = false) { public static function removeMountPoint($mountPoint, $mountType, $applicable, $isPersonal = false) {
@ -610,9 +610,9 @@ class OC_Mount_Config {
/** /**
* Returns a dependency missing message * Returns a dependency missing message
* @param $l OC_L10N * @param OC_L10N $l
* @param $module string * @param string $module
* @param $backend string * @param string $backend
* @return string * @return string
*/ */
private static function getSingleDependencyMessage($l, $module, $backend) { private static function getSingleDependencyMessage($l, $module, $backend) {
@ -658,7 +658,7 @@ class OC_Mount_Config {
/** /**
* Encrypt a single password * Encrypt a single password
* @param string $password plain text password * @param string $password plain text password
* @return encrypted password * @return string encrypted password
*/ */
private static function encryptPassword($password) { private static function encryptPassword($password) {
$cipher = self::getCipher(); $cipher = self::getCipher();
@ -670,7 +670,7 @@ class OC_Mount_Config {
/** /**
* Decrypts a single password * Decrypts a single password
* @param string $encryptedPassword encrypted password * @param string $encryptedPassword encrypted password
* @return plain text password * @return string plain text password
*/ */
private static function decryptPassword($encryptedPassword) { private static function decryptPassword($encryptedPassword) {
$cipher = self::getCipher(); $cipher = self::getCipher();

View File

@ -65,8 +65,8 @@ class Dropbox extends \OC\Files\Storage\Common {
/** /**
* @brief Returns the path's metadata * @brief Returns the path's metadata
* @param string $path path for which to return the metadata * @param string $path path for which to return the metadata
* @param $list if true, also return the directory's contents * @param bool $list if true, also return the directory's contents
* @return directory contents if $list is true, file metadata if $list is * @return mixed directory contents if $list is true, file metadata if $list is
* false, null if the file doesn't exist or "false" if the operation failed * false, null if the file doesn't exist or "false" if the operation failed
*/ */
private function getMetaData($path, $list = false) { private function getMetaData($path, $list = false) {

View File

@ -64,7 +64,7 @@ class FTP extends \OC\Files\Storage\StreamWrapper{
/** /**
* Unlinks file or directory * Unlinks file or directory
* @param string @path * @param string $path
*/ */
public function unlink($path) { public function unlink($path) {
if ($this->is_dir($path)) { if ($this->is_dir($path)) {

View File

@ -83,7 +83,7 @@ class SMB extends \OC\Files\Storage\StreamWrapper{
/** /**
* Unlinks file or directory * Unlinks file or directory
* @param string @path * @param string $path
*/ */
public function unlink($path) { public function unlink($path) {
if ($this->is_dir($path)) { if ($this->is_dir($path)) {

View File

@ -23,7 +23,7 @@
namespace OC\Files\Storage; namespace OC\Files\Storage;
set_include_path(get_include_path() . PATH_SEPARATOR . set_include_path(get_include_path() . PATH_SEPARATOR .
\OC_App::getAppPath('files_external') . '/3rdparty/php-opencloud/lib'); \OC_App::getAppPath('files_external') . '/3rdparty/php-opencloud/lib');
require_once 'openstack.php'; require_once 'openstack.php';
use \OpenCloud; use \OpenCloud;
@ -31,25 +31,25 @@ use \OpenCloud\Common\Exceptions;
class Swift extends \OC\Files\Storage\Common { class Swift extends \OC\Files\Storage\Common {
/** /**
* @var \OpenCloud\ObjectStore * @var \OpenCloud\ObjectStore
*/ */
private $connection; private $connection;
/** /**
* @var \OpenCloud\ObjectStore\Container * @var \OpenCloud\ObjectStore\Container
*/ */
private $container; private $container;
/** /**
* @var \OpenCloud\OpenStack * @var \OpenCloud\OpenStack
*/ */
private $anchor; private $anchor;
/** /**
* @var string * @var string
*/ */
private $bucket; private $bucket;
/** /**
* @var array * @var array
*/ */
private static $tmpFiles = array(); private static $tmpFiles = array();
/** /**

View File

@ -386,7 +386,7 @@ class Api {
/** /**
* @brief update password for public link share * @brief update password for public link share
* @param array $share information about the share * @param array $share information about the share
* @param type $params 'password' * @param array $params 'password'
* @return \OC_OCS_Result * @return \OC_OCS_Result
*/ */
private static function updatePassword($share, $params) { private static function updatePassword($share, $params) {

View File

@ -80,7 +80,7 @@ class Shared_Cache extends Cache {
/** /**
* get the stored metadata of a file or folder * get the stored metadata of a file or folder
* *
* @param string /int $file * @param string|int $file
* @return array * @return array
*/ */
public function get($file) { public function get($file) {
@ -424,7 +424,7 @@ class Shared_Cache extends Cache {
* *
* @param int $id * @param int $id
* @param string $pathEnd (optional) used internally for recursive calls * @param string $pathEnd (optional) used internally for recursive calls
* @return string | null * @return string|null
*/ */
public function getPathById($id, $pathEnd = '') { public function getPathById($id, $pathEnd = '') {
// direct shares are easy // direct shares are easy

View File

@ -33,7 +33,7 @@ class Maintainer {
* Keeps track of the "allow links" config setting * Keeps track of the "allow links" config setting
* and removes all link shares if the config option is set to "no" * and removes all link shares if the config option is set to "no"
* *
* @param array with app, key, value as named values * @param array $params array with app, key, value as named values
*/ */
static public function configChangeHook($params) { static public function configChangeHook($params) {
if($params['app'] === 'core' && $params['key'] === 'shareapi_allow_links' && $params['value'] === 'no') { if($params['app'] === 'core' && $params['key'] === 'shareapi_allow_links' && $params['value'] === 'no') {

View File

@ -53,8 +53,7 @@ class Shared extends \OC\Files\Storage\Common {
/** /**
* @brief Get the source file path, permissions, and owner for a shared file * @brief Get the source file path, permissions, and owner for a shared file
* @param string Shared target file path * @param string $target Shared target file path
* @param string $target
* @return Returns array with the keys path, permissions, and owner or false if not found * @return Returns array with the keys path, permissions, and owner or false if not found
*/ */
public function getFile($target) { public function getFile($target) {
@ -77,8 +76,7 @@ class Shared extends \OC\Files\Storage\Common {
/** /**
* @brief Get the source file path for a shared file * @brief Get the source file path for a shared file
* @param string Shared target file path * @param string $target Shared target file path
* @param string $target
* @return string source file path or false if not found * @return string source file path or false if not found
*/ */
public function getSourcePath($target) { public function getSourcePath($target) {
@ -101,7 +99,7 @@ class Shared extends \OC\Files\Storage\Common {
/** /**
* @brief Get the permissions granted for a shared file * @brief Get the permissions granted for a shared file
* @param string Shared target file path * @param string $target Shared target file path
* @return int CRUDS permissions granted * @return int CRUDS permissions granted
*/ */
public function getPermissions($target) { public function getPermissions($target) {

View File

@ -187,7 +187,7 @@ class Test_Files_Sharing_Api extends Test_Files_Sharing_Base {
$this->assertTrue($result->succeeded()); $this->assertTrue($result->succeeded());
// test should return two shares created from testCreateShare() // test should return two shares created from testCreateShare()
$this->assertTrue(count($result->getData()) === 1); $this->assertTrue(count($result->getData()) === 1);
\OCP\Share::unshare('file', $fileinfo['fileid'], \OCP\Share::SHARE_TYPE_USER, \OCP\Share::unshare('file', $fileinfo['fileid'], \OCP\Share::SHARE_TYPE_USER,
@ -214,7 +214,7 @@ class Test_Files_Sharing_Api extends Test_Files_Sharing_Base {
$this->assertTrue($result->succeeded()); $this->assertTrue($result->succeeded());
// test should return one share created from testCreateShare() // test should return one share created from testCreateShare()
$this->assertTrue(count($result->getData()) === 2); $this->assertTrue(count($result->getData()) === 2);
\OCP\Share::unshare('file', $fileInfo['fileid'], \OCP\Share::SHARE_TYPE_USER, \OCP\Share::unshare('file', $fileInfo['fileid'], \OCP\Share::SHARE_TYPE_USER,
@ -341,7 +341,7 @@ class Test_Files_Sharing_Api extends Test_Files_Sharing_Base {
$this->assertTrue($result->succeeded()); $this->assertTrue($result->succeeded());
// test should return one share within $this->folder // test should return one share within $this->folder
$this->assertTrue(count($result->getData()) === 1); $this->assertTrue(count($result->getData()) === 1);
\OCP\Share::unshare('file', $fileInfo1['fileid'], \OCP\Share::SHARE_TYPE_USER, \OCP\Share::unshare('file', $fileInfo1['fileid'], \OCP\Share::SHARE_TYPE_USER,
@ -698,7 +698,7 @@ class Test_Files_Sharing_Api extends Test_Files_Sharing_Base {
$result = Share\Api::getShare($params); $result = Share\Api::getShare($params);
$this->assertEquals(404, $result->getStatusCode()); $this->assertEquals(404, $result->getStatusCode());
$meta = $result->getMeta(); $meta = $result->getMeta();
$this->assertEquals('share doesn\'t exist', $meta['message']); $this->assertEquals('share doesn\'t exist', $meta['message']);
} }
@ -755,7 +755,7 @@ class Test_Files_Sharing_Api extends Test_Files_Sharing_Base {
$result = Share\Api::updateShare($params); $result = Share\Api::updateShare($params);
$meta = $result->getMeta(); $meta = $result->getMeta();
$this->assertTrue($result->succeeded(), $meta['message']); $this->assertTrue($result->succeeded(), $meta['message']);
$items = \OCP\Share::getItemShared('file', $userShare['file_source']); $items = \OCP\Share::getItemShared('file', $userShare['file_source']);

View File

@ -97,7 +97,7 @@ abstract class Test_Files_Sharing_Base extends \PHPUnit_Framework_TestCase {
} }
/** /**
* @param $user * @param string $user
* @param bool $create * @param bool $create
* @param bool $password * @param bool $password
*/ */

View File

@ -30,7 +30,7 @@ class Hooks {
/** /**
* @brief Copy files to trash bin * @brief Copy files to trash bin
* @param array * @param array $params
* *
* This function is connected to the delete signal of OC_Filesystem * This function is connected to the delete signal of OC_Filesystem
* to copy the file to the trash bin * to copy the file to the trash bin
@ -45,7 +45,7 @@ class Hooks {
/** /**
* @brief clean up user specific settings if user gets deleted * @brief clean up user specific settings if user gets deleted
* @param array with uid * @param array $params array with uid
* *
* This function is connected to the pre_deleteUser signal of OC_Users * This function is connected to the pre_deleteUser signal of OC_Users
* to remove the used space for the trash bin stored in the database * to remove the used space for the trash bin stored in the database

View File

@ -96,7 +96,7 @@ class Trashbin {
/** /**
* move file to the trash bin * move file to the trash bin
* *
* @param $file_path path to the deleted file/directory relative to the files root directory * @param string $file_path path to the deleted file/directory relative to the files root directory
*/ */
public static function move2trash($file_path) { public static function move2trash($file_path) {
$user = \OCP\User::getUser(); $user = \OCP\User::getUser();
@ -155,11 +155,11 @@ class Trashbin {
/** /**
* Move file versions to trash so that they can be restored later * Move file versions to trash so that they can be restored later
* *
* @param $file_path path to original file * @param string $file_path path to original file
* @param $filename of deleted file * @param string $filename of deleted file
* @param integer $timestamp when the file was deleted * @param integer $timestamp when the file was deleted
* *
* @return size of stored versions * @return int size of stored versions
*/ */
private static function retainVersions($file_path, $filename, $timestamp) { private static function retainVersions($file_path, $filename, $timestamp) {
$size = 0; $size = 0;
@ -200,11 +200,11 @@ class Trashbin {
/** /**
* Move encryption keys to trash so that they can be restored later * Move encryption keys to trash so that they can be restored later
* *
* @param $file_path path to original file * @param string $file_path path to original file
* @param $filename of deleted file * @param string $filename of deleted file
* @param integer $timestamp when the file was deleted * @param integer $timestamp when the file was deleted
* *
* @return size of encryption keys * @return int size of encryption keys
*/ */
private static function retainEncryptionKeys($file_path, $filename, $timestamp) { private static function retainEncryptionKeys($file_path, $filename, $timestamp) {
$size = 0; $size = 0;
@ -299,9 +299,9 @@ class Trashbin {
/** /**
* restore files from trash bin * restore files from trash bin
* *
* @param $file path to the deleted file * @param string $file path to the deleted file
* @param $filename name of the file * @param string $filename name of the file
* @param $timestamp time when the file was deleted * @param int $timestamp time when the file was deleted
* *
* @return bool * @return bool
*/ */
@ -376,11 +376,11 @@ class Trashbin {
* @brief restore versions from trash bin * @brief restore versions from trash bin
* *
* @param \OC\Files\View $view file view * @param \OC\Files\View $view file view
* @param $file complete path to file * @param string $file complete path to file
* @param $filename name of file once it was deleted * @param string $filename name of file once it was deleted
* @param string $uniqueFilename new file name to restore the file without overwriting existing files * @param string $uniqueFilename new file name to restore the file without overwriting existing files
* @param $location location if file * @param string $location location if file
* @param $timestamp deleteion time * @param int $timestamp deleteion time
* *
*/ */
private static function restoreVersions($view, $file, $filename, $uniqueFilename, $location, $timestamp) { private static function restoreVersions($view, $file, $filename, $uniqueFilename, $location, $timestamp) {
@ -424,11 +424,11 @@ class Trashbin {
* @brief restore encryption keys from trash bin * @brief restore encryption keys from trash bin
* *
* @param \OC\Files\View $view * @param \OC\Files\View $view
* @param $file complete path to file * @param string $file complete path to file
* @param $filename name of file * @param string $filename name of file
* @param string $uniqueFilename new file name to restore the file without overwriting existing files * @param string $uniqueFilename new file name to restore the file without overwriting existing files
* @param $location location of file * @param string $location location of file
* @param $timestamp deleteion time * @param int $timestamp deleteion time
* *
*/ */
private static function restoreEncryptionKeys($view, $file, $filename, $uniqueFilename, $location, $timestamp) { private static function restoreEncryptionKeys($view, $file, $filename, $uniqueFilename, $location, $timestamp) {
@ -539,10 +539,10 @@ class Trashbin {
/** /**
* @brief delete file from trash bin permanently * @brief delete file from trash bin permanently
* *
* @param $filename path to the file * @param string $filename path to the file
* @param $timestamp of deletion time * @param int $timestamp of deletion time
* *
* @return size of deleted files * @return int size of deleted files
*/ */
public static function delete($filename, $timestamp = null) { public static function delete($filename, $timestamp = null) {
$user = \OCP\User::getUser(); $user = \OCP\User::getUser();
@ -634,9 +634,9 @@ class Trashbin {
/** /**
* check to see whether a file exists in trashbin * check to see whether a file exists in trashbin
* *
* @param $filename path to the file * @param string $filename path to the file
* @param $timestamp of deletion time * @param int $timestamp of deletion time
* @return true if file exists, otherwise false * @return bool true if file exists, otherwise false
*/ */
public static function file_exists($filename, $timestamp = null) { public static function file_exists($filename, $timestamp = null) {
$user = \OCP\User::getUser(); $user = \OCP\User::getUser();
@ -656,7 +656,7 @@ class Trashbin {
* @brief deletes used space for trash bin in db if user was deleted * @brief deletes used space for trash bin in db if user was deleted
* *
* @param type $uid id of deleted user * @param type $uid id of deleted user
* @return result of db delete operation * @return bool result of db delete operation
*/ */
public static function deleteUser($uid) { public static function deleteUser($uid) {
$query = \OC_DB::prepare('DELETE FROM `*PREFIX*files_trash` WHERE `user`=?'); $query = \OC_DB::prepare('DELETE FROM `*PREFIX*files_trash` WHERE `user`=?');
@ -672,7 +672,7 @@ class Trashbin {
* calculate remaining free space for trash bin * calculate remaining free space for trash bin
* *
* @param integer $trashbinSize current size of the trash bin * @param integer $trashbinSize current size of the trash bin
* @return available free space for trash bin * @return int available free space for trash bin
*/ */
private static function calculateFreeSpace($trashbinSize) { private static function calculateFreeSpace($trashbinSize) {
$softQuota = true; $softQuota = true;
@ -808,8 +808,8 @@ class Trashbin {
/** /**
* find all versions which belong to the file we want to restore * find all versions which belong to the file we want to restore
* *
* @param $filename name of the file which should be restored * @param string $filename name of the file which should be restored
* @param $timestamp timestamp when the file was deleted * @param int $timestamp timestamp when the file was deleted
*/ */
private static function getVersionsFromTrash($filename, $timestamp) { private static function getVersionsFromTrash($filename, $timestamp) {
$view = new \OC\Files\View('/' . \OCP\User::getUser() . '/files_trashbin/versions'); $view = new \OC\Files\View('/' . \OCP\User::getUser() . '/files_trashbin/versions');
@ -841,8 +841,8 @@ class Trashbin {
/** /**
* find unique extension for restored file if a file with the same name already exists * find unique extension for restored file if a file with the same name already exists
* *
* @param $location where the file should be restored * @param string $location where the file should be restored
* @param $filename name of the file * @param string $filename name of the file
* @param \OC\Files\View $view filesystem view relative to users root directory * @param \OC\Files\View $view filesystem view relative to users root directory
* @return string with unique extension * @return string with unique extension
*/ */
@ -903,7 +903,7 @@ class Trashbin {
/** /**
* get current size of trash bin from a given user * get current size of trash bin from a given user
* *
* @param $user user who owns the trash bin * @param string $user user who owns the trash bin
* @return mixed trash bin size or false if no trash bin size is stored * @return mixed trash bin size or false if no trash bin size is stored
*/ */
private static function getTrashbinSize($user) { private static function getTrashbinSize($user) {

View File

@ -30,7 +30,7 @@ class Hooks {
/** /**
* @brief Erase versions of deleted file * @brief Erase versions of deleted file
* @param array * @param array $params
* *
* This function is connected to the delete signal of OC_Filesystem * This function is connected to the delete signal of OC_Filesystem
* cleanup the versions directory if the actual file gets deleted * cleanup the versions directory if the actual file gets deleted
@ -58,7 +58,7 @@ class Hooks {
/** /**
* @brief rename/move versions of renamed/moved files * @brief rename/move versions of renamed/moved files
* @param array with oldpath and newpath * @param array $params array with oldpath and newpath
* *
* This function is connected to the rename signal of OC_Filesystem and adjust the name and location * This function is connected to the rename signal of OC_Filesystem and adjust the name and location
* of the stored versions along the actual file * of the stored versions along the actual file
@ -76,7 +76,7 @@ class Hooks {
/** /**
* @brief clean up user specific settings if user gets deleted * @brief clean up user specific settings if user gets deleted
* @param array with uid * @param array $params array with uid
* *
* This function is connected to the pre_deleteUser signal of OC_Users * This function is connected to the pre_deleteUser signal of OC_Users
* to remove the used space for versions stored in the database * to remove the used space for versions stored in the database

View File

@ -53,7 +53,7 @@ class Storage {
/** /**
* get current size of all versions from a given user * get current size of all versions from a given user
* *
* @param $user user who owns the versions * @param string $user user who owns the versions
* @return mixed versions size or false if no versions size is stored * @return mixed versions size or false if no versions size is stored
*/ */
private static function getVersionsSize($user) { private static function getVersionsSize($user) {
@ -69,8 +69,8 @@ class Storage {
/** /**
* write to the database how much space is in use for versions * write to the database how much space is in use for versions
* *
* @param $user owner of the versions * @param string $user owner of the versions
* @param $size size of the versions * @param int $size size of the versions
*/ */
private static function setVersionsSize($user, $size) { private static function setVersionsSize($user, $size) {
if ( self::getVersionsSize($user) === false) { if ( self::getVersionsSize($user) === false) {
@ -336,7 +336,7 @@ class Storage {
/** /**
* @brief deletes used space for files versions in db if user was deleted * @brief deletes used space for files versions in db if user was deleted
* *
* @param type $uid id of deleted user * @param string $uid id of deleted user
* @return \OC_DB_StatementWrapper of db delete operation * @return \OC_DB_StatementWrapper of db delete operation
*/ */
public static function deleteUser($uid) { public static function deleteUser($uid) {
@ -346,8 +346,8 @@ class Storage {
/** /**
* @brief get the size of all stored versions from a given user * @brief get the size of all stored versions from a given user
* @param $uid id from the user * @param string $uid id from the user
* @return size of vesions * @return int size of versions
*/ */
private static function calculateSize($uid) { private static function calculateSize($uid) {
if (\OCP\Config::getSystemValue('files_versions', Storage::DEFAULTENABLED) == 'true') { if (\OCP\Config::getSystemValue('files_versions', Storage::DEFAULTENABLED) == 'true') {

View File

@ -40,9 +40,9 @@ class GROUP_LDAP extends BackendUtility implements \OCP\GroupInterface {
/** /**
* @brief is user in group? * @brief is user in group?
* @param $uid uid of the user * @param string $uid uid of the user
* @param $gid gid of the group * @param string $gid gid of the group
* @returns true/false * @return bool
* *
* Checks whether the user is member of a group or not. * 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 * @brief Get all groups a user belongs to
* @param $uid Name of the user * @param string $uid Name of the user
* @returns array with group names * @return array with group names
* *
* This function fetches all groups a user belongs to. It does not check * This function fetches all groups a user belongs to. It does not check
* if the user exists at all. * if the user exists at all.
@ -177,8 +177,8 @@ class GROUP_LDAP extends BackendUtility implements \OCP\GroupInterface {
} }
$allGroups = array(); $allGroups = array();
if (array_key_exists($dn, $seen)) { if (array_key_exists($dn, $seen)) {
// avoid loops // avoid loops
return array(); return array();
} }
$seen[$dn] = true; $seen[$dn] = true;
$filter = $this->access->combineFilterWithAnd(array( $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 * @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) { public function usersInGroup($gid, $search = '', $limit = -1, $offset = 0) {
if(!$this->enabled) { 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 * @brief returns the number of users in a group, who match the search term
* @param string the internal group name * @param string $gid the internal group name
* @param string optional, a search string * @param string $search optional, a search string
* @returns int | bool * @return int|bool
*/ */
public function countUsersInGroup($gid, $search = '') { public function countUsersInGroup($gid, $search = '') {
$cachekey = '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 * @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) * 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 * @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 * Returns a list with all groups
* Uses a paged search if available to override a * 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 * @brief Check if backend implements actions
* @param $actions bitwise-or'ed actions * @param int $actions bitwise-or'ed actions
* @returns boolean * @return boolean
* *
* Returns the supported actions as int to be * Returns the supported actions as int to be
* compared with OC_USER_BACKEND_CREATE_USER etc. * compared with OC_USER_BACKEND_CREATE_USER etc.

View File

@ -31,12 +31,12 @@ class Group_Proxy extends lib\Proxy implements \OCP\GroupInterface {
/** /**
* @brief Constructor * @brief Constructor
* @param $serverConfigPrefixes array containing the config Prefixes * @param string[] $serverConfigPrefixes array containing the config Prefixes
*/ */
public function __construct($serverConfigPrefixes, ILDAPWrapper $ldap) { public function __construct($serverConfigPrefixes, ILDAPWrapper $ldap) {
parent::__construct($ldap); parent::__construct($ldap);
foreach($serverConfigPrefixes as $configPrefix) { foreach($serverConfigPrefixes as $configPrefix) {
$this->backends[$configPrefix] = $this->backends[$configPrefix] =
new \OCA\user_ldap\GROUP_LDAP($this->getAccess($configPrefix)); new \OCA\user_ldap\GROUP_LDAP($this->getAccess($configPrefix));
if(is_null($this->refBackend)) { if(is_null($this->refBackend)) {
$this->refBackend = &$this->backends[$configPrefix]; $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 * @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 string $gid the gid connected to the request
* @param $method string, the method of the group backend that shall be called * @param string $method the method of the group backend that shall be called
* @param $parameters an array of parameters to be passed * @param array $parameters an array of parameters to be passed
* @return mixed, the result of the method or false * @return mixed, the result of the method or false
*/ */
protected function walkBackends($gid, $method, $parameters) { protected function walkBackends($gid, $method, $parameters) {
$cacheKey = $this->getGroupCacheKey($gid); $cacheKey = $this->getGroupCacheKey($gid);
foreach($this->backends as $configPrefix => $backend) { 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); $this->writeToCache($cacheKey, $configPrefix);
return $result; return $result;
} }
} }
return false; return false;
} }
/** /**
* @brief Asks the backend connected to the server that supposely takes care of the gid from the request. * @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 string $gid the gid connected to the request
* @param $method string, the method of the group backend that shall be called * @param string $method the method of the group backend that shall be called
* @param $parameters an array of parameters to be passed * @param array $parameters an array of parameters to be passed
* @param $passOnWhen the result matches this variable * @param mixed $passOnWhen the result matches this variable
* @return mixed, the result of the method or false * @return mixed, the result of the method or false
*/ */
protected function callOnLastSeenOn($gid, $method, $parameters, $passOnWhen) { 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? * @brief is user in group?
* @param $uid uid of the user * @param string $uid uid of the user
* @param $gid gid of the group * @param string $gid gid of the group
* @returns true/false * @return bool
* *
* Checks whether the user is member of a group or not. * 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 * @brief Get all groups a user belongs to
* @param $uid Name of the user * @param string $uid Name of the user
* @returns array with group names * @return string[] with group names
* *
* This function fetches all groups a user belongs to. It does not check * This function fetches all groups a user belongs to. It does not check
* if the user exists at all. * if the user exists at all.
@ -118,7 +118,7 @@ class Group_Proxy extends lib\Proxy implements \OCP\GroupInterface {
$groups = array(); $groups = array();
foreach($this->backends as $backend) { foreach($this->backends as $backend) {
$backendGroups = $backend->getUserGroups($uid); $backendGroups = $backend->getUserGroups($uid);
if (is_array($backendGroups)) { if (is_array($backendGroups)) {
$groups = array_merge($groups, $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 * @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) { public function usersInGroup($gid, $search = '', $limit = -1, $offset = 0) {
$users = array(); $users = array();
foreach($this->backends as $backend) { foreach($this->backends as $backend) {
$backendUsers = $backend->usersInGroup($gid, $search, $limit, $offset); $backendUsers = $backend->usersInGroup($gid, $search, $limit, $offset);
if (is_array($backendUsers)) { if (is_array($backendUsers)) {
$users = array_merge($users, $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 * @brief returns the number of users in a group, who match the search term
* @param string the internal group name * @param string $gid the internal group name
* @param string optional, a search string * @param string $search optional, a search string
* @returns int | bool * @return int|bool
*/ */
public function countUsersInGroup($gid, $search = '') { public function countUsersInGroup($gid, $search = '') {
return $this->handleRequest( return $this->handleRequest(
@ -157,7 +157,7 @@ class Group_Proxy extends lib\Proxy implements \OCP\GroupInterface {
/** /**
* @brief get a list of all groups * @brief get a list of all groups
* @returns array with group names * @return string[] with group names
* *
* Returns a list with all groups * Returns a list with all groups
*/ */
@ -165,7 +165,7 @@ class Group_Proxy extends lib\Proxy implements \OCP\GroupInterface {
$groups = array(); $groups = array();
foreach($this->backends as $backend) { foreach($this->backends as $backend) {
$backendGroups = $backend->getGroups($search, $limit, $offset); $backendGroups = $backend->getGroups($search, $limit, $offset);
if (is_array($backendGroups)) { if (is_array($backendGroups)) {
$groups = array_merge($groups, $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 * @brief Check if backend implements actions
* @param $actions bitwise-or'ed actions * @param int $actions bitwise-or'ed actions
* @returns boolean * @return boolean
* *
* Returns the supported actions as int to be * Returns the supported actions as int to be
* compared with OC_USER_BACKEND_CREATE_USER etc. * compared with OC_USER_BACKEND_CREATE_USER etc.

View File

@ -138,7 +138,7 @@ class Access extends LDAPUtility {
if(is_array($dn)) { if(is_array($dn)) {
$result = array(); $result = array();
foreach($dn as $singleDN) { foreach($dn as $singleDN) {
$result[] = $this->sanitizeDN($singleDN); $result[] = $this->sanitizeDN($singleDN);
} }
return $result; return $result;
} }
@ -383,7 +383,7 @@ class Access extends LDAPUtility {
} }
/** /**
* @param $dn * @param string $dn
* @return bool|string * @return bool|string
*/ */
private function findMappedUser($dn) { private function findMappedUser($dn) {
@ -403,7 +403,7 @@ class Access extends LDAPUtility {
} }
/** /**
* @param $dn * @param string $dn
* @return bool|string * @return bool|string
*/ */
private function findMappedGroup($dn) { private function findMappedGroup($dn) {
@ -630,8 +630,8 @@ class Access extends LDAPUtility {
} }
/** /**
* @param $filter * @param string $filter
* @param $attr * @param string|string[] $attr
* @param int $limit * @param int $limit
* @param int $offset * @param int $offset
* @return array * @return array
@ -641,8 +641,8 @@ class Access extends LDAPUtility {
} }
/** /**
* @param $filter * @param string $filter
* @param $attr * @param string|string[] $attr
* @param int $limit * @param int $limit
* @param int $offset * @param int $offset
* @return array * @return array
@ -652,7 +652,7 @@ class Access extends LDAPUtility {
} }
/** /**
* @param $list * @param array $list
* @param bool $manyAttributes * @param bool $manyAttributes
* @return array * @return array
*/ */
@ -672,7 +672,7 @@ class Access extends LDAPUtility {
/** /**
* @brief executes an LDAP search, optimized for Users * @brief executes an LDAP search, optimized for Users
* @param string $filter the LDAP filter for the search * @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 $limit
* @param integer $offset * @param integer $offset
* @return array with the search result * @return array with the search result
@ -685,7 +685,7 @@ class Access extends LDAPUtility {
/** /**
* @param string $filter * @param string $filter
* @param array $attr * @param string|string[] $attr
* @param int $limit * @param int $limit
* @param int $offset * @param int $offset
* @return false|int * @return false|int
@ -697,7 +697,7 @@ class Access extends LDAPUtility {
/** /**
* @brief executes an LDAP search, optimized for Groups * @brief executes an LDAP search, optimized for Groups
* @param string $filter the LDAP filter for the search * @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 $limit
* @param integer $offset * @param integer $offset
* @return array with the search result * @return array with the search result
@ -712,7 +712,7 @@ class Access extends LDAPUtility {
* @brief prepares and executes an LDAP search operation * @brief prepares and executes an LDAP search operation
* @param string $filter the LDAP filter for the 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 $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. * retrieved. Results will according to the order in the array.
* @param int $limit optional, maximum results to be counted * @param int $limit optional, maximum results to be counted
* @param int $offset optional, a starting point * @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 * @brief executes an LDAP search, but counts the results only
* @param string $filter the LDAP filter for the 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 $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. * retrieved. Results will according to the order in the array.
* @param int $limit optional, maximum results to be counted * @param int $limit optional, maximum results to be counted
* @param int $offset optional, a starting point * @param int $offset optional, a starting point
@ -840,9 +840,9 @@ class Access extends LDAPUtility {
} }
/** /**
* @param $searchResults * @param array $searchResults
* @param $limit * @param int $limit
* @param $hasHitLimit * @param bool $hasHitLimit
* @return int * @return int
*/ */
private function countEntriesInSearchResults($searchResults, $limit, &$hasHitLimit) { private function countEntriesInSearchResults($searchResults, $limit, &$hasHitLimit) {
@ -864,7 +864,7 @@ class Access extends LDAPUtility {
* @brief Executes an LDAP search * @brief Executes an LDAP search
* @param string $filter the LDAP filter for the 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 $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 $limit
* @param int $offset * @param int $offset
* @param bool $skipHandling * @param bool $skipHandling
@ -897,7 +897,7 @@ class Access extends LDAPUtility {
$findings = array(); $findings = array();
foreach($sr as $res) { 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'], $this->processPagedSearchStatus($sr, $filter, $base, $findings['count'],
@ -969,7 +969,7 @@ class Access extends LDAPUtility {
} }
/** /**
* @param $name * @param string $name
* @return bool|mixed|string * @return bool|mixed|string
*/ */
public function sanitizeUsername($name) { public function sanitizeUsername($name) {
@ -1003,7 +1003,7 @@ class Access extends LDAPUtility {
/** /**
* @brief combines the input filters with AND * @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 * @return string the combined filter
*/ */
public function combineFilterWithAnd($filters) { public function combineFilterWithAnd($filters) {
@ -1012,7 +1012,7 @@ class Access extends LDAPUtility {
/** /**
* @brief combines the input filters with AND * @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 * @return string the combined filter
*/ */
public function combineFilterWithOr($filters) { public function combineFilterWithOr($filters) {
@ -1021,17 +1021,17 @@ class Access extends LDAPUtility {
/** /**
* @brief combines the input filters with given operator * @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 | * @param string $operator either & or |
* @return string the combined filter * @return string the combined filter
*/ */
private function combineFilter($filters, $operator) { private function combineFilter($filters, $operator) {
$combinedFilter = '('.$operator; $combinedFilter = '('.$operator;
foreach($filters as $filter) { foreach($filters as $filter) {
if(!empty($filter) && $filter[0] !== '(') { if(!empty($filter) && $filter[0] !== '(') {
$filter = '('.$filter.')'; $filter = '('.$filter.')';
} }
$combinedFilter.=$filter; $combinedFilter.=$filter;
} }
$combinedFilter.=')'; $combinedFilter.=')';
return $combinedFilter; return $combinedFilter;
@ -1062,7 +1062,7 @@ class Access extends LDAPUtility {
/** /**
* @brief creates a filter part for searches * @brief creates a filter part for searches
* @param string $search the search term * @param string $search the search term
* @param $searchAttributes * @param string[]|null $searchAttributes
* @param string $fallbackAttribute a fallback attribute in case the user * @param string $fallbackAttribute a fallback attribute in case the user
* did not define search attributes. Typically the display name attribute. * did not define search attributes. Typically the display name attribute.
* @return string the final filter part to use in LDAP searches * @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 * @param bool $isUser
* @return array|bool|false * @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) * @brief checks if the given DN is part of the given base DN(s)
* @param string $dn the DN * @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 * @return bool
*/ */
private function isDNPartOfBase($dn, $bases) { private function isDNPartOfBase($dn, $bases) {
@ -1293,8 +1293,8 @@ class Access extends LDAPUtility {
/** /**
* @brief Prepares a paged search, if possible * @brief Prepares a paged search, if possible
* @param string $filter the LDAP filter for the search * @param string $filter the LDAP filter for the search
* @param array $bases an array containing the LDAP subtree(s) that shall be searched * @param string[] $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[] $attr optional, when a certain attribute shall be filtered outside
* @param int $limit * @param int $limit
* @param int $offset * @param int $offset
* @return bool|true * @return bool|true

View File

@ -81,7 +81,7 @@ class Configuration {
); );
/** /**
* @param $configPrefix * @param string $configPrefix
* @param bool $autoRead * @param bool $autoRead
*/ */
public function __construct($configPrefix, $autoRead = true) { public function __construct($configPrefix, $autoRead = true) {
@ -92,7 +92,7 @@ class Configuration {
} }
/** /**
* @param $name * @param string $name
* @return mixed|void * @return mixed|void
*/ */
public function __get($name) { public function __get($name) {
@ -102,8 +102,8 @@ class Configuration {
} }
/** /**
* @param $name * @param string $name
* @param $value * @param mixed $value
*/ */
public function __set($name, $value) { public function __set($name, $value) {
$this->setConfiguration(array($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 * @brief set LDAP configuration with values delivered by an array, not read
* from configuration. It does not save the configuration! To do so, you * from configuration. It does not save the configuration! To do so, you
* must call saveConfiguration afterwards. * 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 * array
* @param array &$applied optional; array where the set fields will be given to * @param array &$applied optional; array where the set fields will be given to
* @return false|null * @return false|null
@ -250,7 +250,7 @@ class Configuration {
} }
/** /**
* @param $varName * @param string $varName
* @return array|string * @return array|string
*/ */
protected function getMultiLine($varName) { protected function getMultiLine($varName) {
@ -265,8 +265,8 @@ class Configuration {
} }
/** /**
* @param $varName * @param string $varName
* @param $value * @param array|string $value
*/ */
protected function setMultiLine($varName, $value) { protected function setMultiLine($varName, $value) {
if(empty($value)) { if(empty($value)) {
@ -282,7 +282,7 @@ class Configuration {
} }
/** /**
* @param $varName * @param string $varName
* @return string * @return string
*/ */
protected function getPwd($varName) { protected function getPwd($varName) {
@ -290,7 +290,7 @@ class Configuration {
} }
/** /**
* @param $varName * @param string $varName
* @return string * @return string
*/ */
protected function getLcValue($varName) { protected function getLcValue($varName) {
@ -298,7 +298,7 @@ class Configuration {
} }
/** /**
* @param $varName * @param string $varName
* @return string * @return string
*/ */
protected function getSystemValue($varName) { protected function getSystemValue($varName) {
@ -307,7 +307,7 @@ class Configuration {
} }
/** /**
* @param $varName * @param string $varName
* @return string * @return string
*/ */
protected function getValue($varName) { protected function getValue($varName) {
@ -321,16 +321,16 @@ class Configuration {
} }
/** /**
* @param $varName * @param string $varName
* @param $value * @param mixed $value
*/ */
protected function setValue($varName, $value) { protected function setValue($varName, $value) {
$this->config[$varName] = $value; $this->config[$varName] = $value;
} }
/** /**
* @param $varName * @param string $varName
* @param $value * @param string $value
* @return bool * @return bool
*/ */
protected function saveValue($varName, $value) { protected function saveValue($varName, $value) {
@ -448,4 +448,4 @@ class Configuration {
return $array; return $array;
} }
} }

View File

@ -84,7 +84,7 @@ class Connection extends LDAPUtility {
} }
/** /**
* @param $name * @param string $name
* @return bool|mixed|void * @return bool|mixed|void
*/ */
public function __get($name) { public function __get($name) {
@ -100,8 +100,8 @@ class Connection extends LDAPUtility {
} }
/** /**
* @param $name * @param string $name
* @param $value * @param mixed $value
*/ */
public function __set($name, $value) { public function __set($name, $value) {
$this->doNotValidate = false; $this->doNotValidate = false;
@ -142,7 +142,7 @@ class Connection extends LDAPUtility {
} }
/** /**
* @param $key * @param string|null $key
* @return string * @return string
*/ */
private function getCacheKey($key) { private function getCacheKey($key) {
@ -154,7 +154,7 @@ class Connection extends LDAPUtility {
} }
/** /**
* @param $key * @param string $key
* @return mixed|null * @return mixed|null
*/ */
public function getFromCache($key) { public function getFromCache($key) {
@ -174,7 +174,7 @@ class Connection extends LDAPUtility {
} }
/** /**
* @param $key * @param string $key
* @return bool * @return bool
*/ */
public function isCached($key) { public function isCached($key) {
@ -189,8 +189,8 @@ class Connection extends LDAPUtility {
} }
/** /**
* @param $key * @param string $key
* @param $value * @param mixed $value
*/ */
public function writeToCache($key, $value) { public function writeToCache($key, $value) {
if(!$this->configured) { 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 * @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 * @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 * @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() { private function doSoftValidation() {
//if User or Group Base are not set, take over Base DN setting //if User or Group Base are not set, take over Base DN setting
foreach(array('ldapBaseUsers', 'ldapBaseGroups') as $keyBase) { foreach(array('ldapBaseUsers', 'ldapBaseGroups') as $keyBase) {
$val = $this->configuration->$keyBase; $val = $this->configuration->$keyBase;
if(empty($val)) { if(empty($val)) {
$obj = strpos('Users', $keyBase) !== false ? 'Users' : 'Groups'; $obj = strpos('Users', $keyBase) !== false ? 'Users' : 'Groups';
\OCP\Util::writeLog('user_ldap', \OCP\Util::writeLog('user_ldap',
@ -523,8 +523,8 @@ class Connection extends LDAPUtility {
} }
/** /**
* @param $host * @param string $host
* @param $port * @param string $port
* @return false|void * @return false|void
*/ */
private function doConnect($host, $port) { private function doConnect($host, $port) {

View File

@ -52,15 +52,15 @@ interface ILDAPWrapper {
* @param int $pageSize number of results per page * @param int $pageSize number of results per page
* @param bool $isCritical Indicates whether the pagination is critical of not. * @param bool $isCritical Indicates whether the pagination is critical of not.
* @param array $cookie structure sent by LDAP server * @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); public function controlPagedResult($link, $pageSize, $isCritical, $cookie);
/** /**
* @brief Retrieve the LDAP pagination cookie * @brief Retrieve the LDAP pagination cookie
* @param $link LDAP link resource * @param resource $link LDAP link resource
* @param $result LDAP result resource * @param resource $result LDAP result resource
* @param array $cookie structure sent by LDAP server * @param string $cookie structure sent by LDAP server
* @return bool true on success, false otherwise * @return bool true on success, false otherwise
* *
* Corresponds to ldap_control_paged_result_response * Corresponds to ldap_control_paged_result_response
@ -162,15 +162,15 @@ interface ILDAPWrapper {
/** /**
* @brief establish Start TLS * @brief establish Start TLS
* @param resource|$link LDAP link resource * @param resource $link LDAP link resource
* @return bool true on success, false otherwise * @return bool true on success, false otherwise
*/ */
public function startTls($link); public function startTls($link);
/** /**
* @brief Sort the result of a LDAP search * @brief Sort the result of a LDAP search
* @param $link LDAP link resource * @param resource $link LDAP link resource
* @param $result LDAP result resource * @param resource $result LDAP result resource
* @param string $sortFilter attribute to use a key in sort * @param string $sortFilter attribute to use a key in sort
*/ */
public function sort($link, $result, $sortFilter); public function sort($link, $result, $sortFilter);

View File

@ -34,7 +34,7 @@ class Jobs extends \OC\BackgroundJob\TimedJob {
} }
/** /**
* @param $argument * @param mixed $argument
*/ */
public function run($argument){ public function run($argument){
Jobs::updateGroups(); Jobs::updateGroups();
@ -69,7 +69,7 @@ class Jobs extends \OC\BackgroundJob\TimedJob {
} }
/** /**
* @param $groups * @param string[] $groups
*/ */
static private function handleKnownGroups($groups) { static private function handleKnownGroups($groups) {
\OCP\Util::writeLog('user_ldap', 'bgJ "updateGroups" Dealing with known Groups.', \OCP\Util::DEBUG); \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) { foreach($groups as $group) {
//we assume, that self::$groupsFromDB has been retrieved already //we assume, that self::$groupsFromDB has been retrieved already
$knownUsers = unserialize(self::$groupsFromDB[$group]['owncloudusers']); $knownUsers = unserialize(self::$groupsFromDB[$group]['owncloudusers']);
$actualUsers = self::getGroupBE()->usersInGroup($group); $actualUsers = self::getGroupBE()->usersInGroup($group);
$hasChanged = false; $hasChanged = false;
foreach(array_diff($knownUsers, $actualUsers) as $removedUser) { foreach(array_diff($knownUsers, $actualUsers) as $removedUser) {
\OCP\Util::emitHook('OC_User', 'post_removeFromGroup', array('uid' => $removedUser, 'gid' => $group)); \OCP\Util::emitHook('OC_User', 'post_removeFromGroup', array('uid' => $removedUser, 'gid' => $group));
\OCP\Util::writeLog('user_ldap', \OCP\Util::writeLog('user_ldap',
'bgJ "updateGroups" "'.$removedUser.'" removed from "'.$group.'".', 'bgJ "updateGroups" "'.$removedUser.'" removed from "'.$group.'".',
\OCP\Util::INFO); \OCP\Util::INFO);
$hasChanged = true; $hasChanged = true;
} }
foreach(array_diff($actualUsers, $knownUsers) as $addedUser) { foreach(array_diff($actualUsers, $knownUsers) as $addedUser) {
\OCP\Util::emitHook('OC_User', 'post_addToGroup', array('uid' => $addedUser, 'gid' => $group)); \OCP\Util::emitHook('OC_User', 'post_addToGroup', array('uid' => $addedUser, 'gid' => $group));
\OCP\Util::writeLog('user_ldap', \OCP\Util::writeLog('user_ldap',
'bgJ "updateGroups" "'.$addedUser.'" added to "'.$group.'".', 'bgJ "updateGroups" "'.$addedUser.'" added to "'.$group.'".',
\OCP\Util::INFO); \OCP\Util::INFO);
$hasChanged = true; $hasChanged = true;
} }
if($hasChanged) { if($hasChanged) {
$query->execute(array(serialize($actualUsers), $group)); $query->execute(array(serialize($actualUsers), $group));
} }
} }
\OCP\Util::writeLog('user_ldap', \OCP\Util::writeLog('user_ldap',
'bgJ "updateGroups" FINISHED dealing with known Groups.', '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) { static private function handleCreatedGroups($createdGroups) {
\OCP\Util::writeLog('user_ldap', 'bgJ "updateGroups" dealing with created Groups.', \OCP\Util::DEBUG); \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.', 'bgJ "updateGroups" new group "'.$createdGroup.'" found.',
\OCP\Util::INFO); \OCP\Util::INFO);
$users = serialize(self::getGroupBE()->usersInGroup($createdGroup)); $users = serialize(self::getGroupBE()->usersInGroup($createdGroup));
$query->execute(array($createdGroup, $users)); $query->execute(array($createdGroup, $users));
} }
\OCP\Util::writeLog('user_ldap', \OCP\Util::writeLog('user_ldap',
'bgJ "updateGroups" FINISHED dealing with created Groups.', '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) { static private function handleRemovedGroups($removedGroups) {
\OCP\Util::writeLog('user_ldap', 'bgJ "updateGroups" dealing with removed groups.', \OCP\Util::DEBUG); \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', \OCP\Util::writeLog('user_ldap',
'bgJ "updateGroups" group "'.$removedGroup.'" was removed.', 'bgJ "updateGroups" group "'.$removedGroup.'" was removed.',
\OCP\Util::INFO); \OCP\Util::INFO);
$query->execute(array($removedGroup)); $query->execute(array($removedGroup));
} }
\OCP\Util::writeLog('user_ldap', \OCP\Util::writeLog('user_ldap',
'bgJ "updateGroups" FINISHED dealing with removed groups.', 'bgJ "updateGroups" FINISHED dealing with removed groups.',
@ -184,7 +184,7 @@ class Jobs extends \OC\BackgroundJob\TimedJob {
$result = $query->execute()->fetchAll(); $result = $query->execute()->fetchAll();
self::$groupsFromDB = array(); self::$groupsFromDB = array();
foreach($result as $dataset) { foreach($result as $dataset) {
self::$groupsFromDB[$dataset['owncloudname']] = $dataset; self::$groupsFromDB[$dataset['owncloudname']] = $dataset;
} }
return self::$groupsFromDB; return self::$groupsFromDB;

View File

@ -49,7 +49,7 @@ class LDAP implements ILDAPWrapper {
/** /**
* @param LDAP $link * @param LDAP $link
* @param LDAP $result * @param LDAP $result
* @param $cookie * @param string $cookie
* @return bool|LDAP * @return bool|LDAP
*/ */
public function controlPagedResultResponse($link, $result, &$cookie) { public function controlPagedResultResponse($link, $result, &$cookie) {
@ -65,7 +65,7 @@ class LDAP implements ILDAPWrapper {
* @param LDAP $link * @param LDAP $link
* @param int $pageSize * @param int $pageSize
* @param bool $isCritical * @param bool $isCritical
* @param array $cookie * @param string $cookie
* @return mixed|true * @return mixed|true
*/ */
public function controlPagedResult($link, $pageSize, $isCritical, $cookie) { public function controlPagedResult($link, $pageSize, $isCritical, $cookie) {
@ -248,7 +248,7 @@ class LDAP implements ILDAPWrapper {
/** /**
* @param string $functionName * @param string $functionName
* @param $args * @param array $args
*/ */
private function preFunctionCall($functionName, $args) { private function preFunctionCall($functionName, $args) {
$this->curFunc = $functionName; $this->curFunc = $functionName;

View File

@ -38,7 +38,7 @@ abstract class Proxy {
} }
/** /**
* @param $configPrefix * @param string $configPrefix
*/ */
private function addAccess($configPrefix) { private function addAccess($configPrefix) {
$connector = new Connection($this->ldap, $configPrefix); $connector = new Connection($this->ldap, $configPrefix);
@ -46,7 +46,7 @@ abstract class Proxy {
} }
/** /**
* @param $configPrefix * @param string $configPrefix
* @return mixed * @return mixed
*/ */
protected function getAccess($configPrefix) { protected function getAccess($configPrefix) {
@ -57,7 +57,7 @@ abstract class Proxy {
} }
/** /**
* @param $uid * @param string $uid
* @return string * @return string
*/ */
protected function getUserCacheKey($uid) { protected function getUserCacheKey($uid) {
@ -65,7 +65,7 @@ abstract class Proxy {
} }
/** /**
* @param $gid * @param string $gid
* @return string * @return string
*/ */
protected function getGroupCacheKey($gid) { protected function getGroupCacheKey($gid) {
@ -73,25 +73,25 @@ abstract class Proxy {
} }
/** /**
* @param $id * @param string $id
* @param $method * @param string $method
* @param $parameters * @param array $parameters
* @param bool $passOnWhen * @param bool $passOnWhen
* @return mixed * @return mixed
*/ */
abstract protected function callOnLastSeenOn($id, $method, $parameters, $passOnWhen); abstract protected function callOnLastSeenOn($id, $method, $parameters, $passOnWhen);
/** /**
* @param $id * @param string $id
* @param $method * @param string $method
* @param $parameters * @param array $parameters
* @return mixed * @return mixed
*/ */
abstract protected function walkBackends($id, $method, $parameters); abstract protected function walkBackends($id, $method, $parameters);
/** /**
* @brief Takes care of the request to the User backend * @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 string $method string, the method of the user backend that shall be called
* @param array $parameters an array of parameters to be passed * @param array $parameters an array of parameters to be passed
* @param bool $passOnWhen * @param bool $passOnWhen
@ -106,7 +106,7 @@ abstract class Proxy {
} }
/** /**
* @param $key * @param string|null $key
* @return string * @return string
*/ */
private function getCacheKey($key) { private function getCacheKey($key) {
@ -118,7 +118,7 @@ abstract class Proxy {
} }
/** /**
* @param $key * @param string $key
* @return mixed|null * @return mixed|null
*/ */
public function getFromCache($key) { public function getFromCache($key) {
@ -131,7 +131,7 @@ abstract class Proxy {
} }
/** /**
* @param $key * @param string $key
* @return bool * @return bool
*/ */
public function isCached($key) { public function isCached($key) {
@ -140,8 +140,8 @@ abstract class Proxy {
} }
/** /**
* @param $key * @param string $key
* @param $value * @param mixed $value
*/ */
public function writeToCache($key, $value) { public function writeToCache($key, $value) {
$key = $this->getCacheKey($key); $key = $this->getCacheKey($key);

View File

@ -641,7 +641,7 @@ class Wizard extends LDAPUtility {
//assuming only groups have their cn cached :) //assuming only groups have their cn cached :)
continue; continue;
} }
$filter = strtolower($filterPrefix . $dn . $filterSuffix); $filter = strtolower($filterPrefix . $dn . $filterSuffix);
$rr = $this->ldap->search($cr, $base, $filter, array('dn')); $rr = $this->ldap->search($cr, $base, $filter, array('dn'));
if(!$this->ldap->isResource($rr)) { if(!$this->ldap->isResource($rr)) {
continue; continue;
@ -776,7 +776,7 @@ class Wizard extends LDAPUtility {
if(is_array($attrsToFilter) && count($attrsToFilter) > 0) { if(is_array($attrsToFilter) && count($attrsToFilter) > 0) {
$filterAttributes = '(|'; $filterAttributes = '(|';
foreach($attrsToFilter as $attribute) { foreach($attrsToFilter as $attribute) {
$filterAttributes .= '(' . $attribute . $loginpart . ')'; $filterAttributes .= '(' . $attribute . $loginpart . ')';
} }
$filterAttributes .= ')'; $filterAttributes .= ')';
$parts++; $parts++;
@ -909,7 +909,7 @@ class Wizard extends LDAPUtility {
* specified attribute * specified attribute
* @param string[] $filters array, the filters that shall be used in the search * @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 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 * be processed if there were already findings, defaults to true
* @param int $dnReadLimit the amount of how many DNs should be analyzed. * @param int $dnReadLimit the amount of how many DNs should be analyzed.
* The lower, the faster * 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 $dbkey the dbkey of the setting the feature is connected to
* @param string $confkey the confkey counterpart for the $dbkey as used in the * @param string $confkey the confkey counterpart for the $dbkey as used in the
* Configuration class * 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 * shall be pre-selected via the result
* @return array, list of found items. * @return array, list of found items.
* @throws \Exception * @throws \Exception
@ -1041,9 +1041,9 @@ class Wizard extends LDAPUtility {
/** /**
* @brief appends a list of values fr * @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 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, * @return int, state on of the class constants LRESULT_PROCESSED_OK,
* LRESULT_PROCESSED_INVALID or LRESULT_PROCESSED_SKIP * LRESULT_PROCESSED_INVALID or LRESULT_PROCESSED_SKIP
*/ */

View File

@ -29,8 +29,8 @@ class WizardResult {
protected $markedChange = false; protected $markedChange = false;
/** /**
* @param $key * @param string $key
* @param $value * @param mixed $value
*/ */
public function addChange($key, $value) { public function addChange($key, $value) {
$this->changes[$key] = $value; $this->changes[$key] = $value;
@ -72,4 +72,4 @@ class WizardResult {
} }
return $result; return $result;
} }
} }

View File

@ -71,7 +71,7 @@ $tmpl->assign('settingControls', $sControls);
$config = new \OCA\user_ldap\lib\Configuration('', false); $config = new \OCA\user_ldap\lib\Configuration('', false);
$defaults = $config->getDefaults(); $defaults = $config->getDefaults();
foreach($defaults as $key => $default) { foreach($defaults as $key => $default) {
$tmpl->assign($key.'_default', $default); $tmpl->assign($key.'_default', $default);
} }
return $tmpl->fetchPage(); return $tmpl->fetchPage();

View File

@ -79,7 +79,7 @@ class Test_User_Ldap_Direct extends \PHPUnit_Framework_TestCase {
/** /**
* @brief Prepares the Access mock for checkPassword tests * @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 * @return void
*/ */
private function prepareAccessForCheckPassword(&$access) { 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 * @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 * @return void
*/ */
private function prepareAccessForGetUsers(&$access) { private function prepareAccessForGetUsers(&$access) {
@ -557,4 +557,4 @@ class Test_User_Ldap_Direct extends \PHPUnit_Framework_TestCase {
$result = $backend->countUsers(); $result = $backend->countUsers();
$this->assertFalse($result); $this->assertFalse($result);
} }
} }

View File

@ -70,8 +70,8 @@ class USER_LDAP extends BackendUtility implements \OCP\UserInterface {
/** /**
* @brief reads jpegPhoto and set is as avatar if available * @brief reads jpegPhoto and set is as avatar if available
* @param $uid string ownCloud user name * @param string $uid ownCloud user name
* @param $dn string the user's LDAP DN * @param string $dn the user's LDAP DN
* @return void * @return void
*/ */
private function updateAvatar($uid, $dn) { 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 * @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 * @return boolean either the user can or cannot
*/ */
public function canChangeAvatar($uid) { 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 * @brief reads the image from LDAP that shall be used as Avatar
* @param $uid string, the ownCloud user name * @param string $uid the ownCloud user name
* @param $dn string, the user DN * @param string $dn the user DN
* @return string data (provided by LDAP) | false * @return string data (provided by LDAP) | false
*/ */
private function getAvatarImage($uid, $dn) { private function getAvatarImage($uid, $dn) {
@ -200,7 +200,7 @@ class USER_LDAP extends BackendUtility implements \OCP\UserInterface {
/** /**
* @brief Get a list of all users * @brief Get a list of all users
* @returns array with all uids * @return string[] with all uids
* *
* Get a list of all users. * Get a list of all users.
*/ */
@ -272,8 +272,8 @@ class USER_LDAP extends BackendUtility implements \OCP\UserInterface {
/** /**
* @brief delete a user * @brief delete a user
* @param $uid The username of the user to delete * @param string $uid The username of the user to delete
* @returns true/false * @return bool
* *
* Deletes a user * Deletes a user
*/ */
@ -326,8 +326,8 @@ class USER_LDAP extends BackendUtility implements \OCP\UserInterface {
/** /**
* @brief get display name of the user * @brief get display name of the user
* @param $uid user ID of the user * @param string $uid user ID of the user
* @return display name * @return string display name
*/ */
public function getDisplayName($uid) { public function getDisplayName($uid) {
if(!$this->userExists($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 * @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. * Get a list of all display names and user ids.
*/ */
@ -372,10 +372,10 @@ class USER_LDAP extends BackendUtility implements \OCP\UserInterface {
return $displayNames; return $displayNames;
} }
/** /**
* @brief Check if backend implements actions * @brief Check if backend implements actions
* @param $actions bitwise-or'ed actions * @param int $actions bitwise-or'ed actions
* @returns boolean * @return boolean
* *
* Returns the supported actions as int to be * Returns the supported actions as int to be
* compared with OC_USER_BACKEND_CREATE_USER etc. * 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 * counts the users in LDAP
* *
* @return int | bool * @return int|bool
*/ */
public function countUsers() { public function countUsers() {
$filter = \OCP\Util::mb_str_replace( $filter = \OCP\Util::mb_str_replace(

View File

@ -31,12 +31,12 @@ class User_Proxy extends lib\Proxy implements \OCP\UserInterface {
/** /**
* @brief Constructor * @brief Constructor
* @param $serverConfigPrefixes array containing the config Prefixes * @param array $serverConfigPrefixes array containing the config Prefixes
*/ */
public function __construct($serverConfigPrefixes, ILDAPWrapper $ldap) { public function __construct($serverConfigPrefixes, ILDAPWrapper $ldap) {
parent::__construct($ldap); parent::__construct($ldap);
foreach($serverConfigPrefixes as $configPrefix) { foreach($serverConfigPrefixes as $configPrefix) {
$this->backends[$configPrefix] = $this->backends[$configPrefix] =
new \OCA\user_ldap\USER_LDAP($this->getAccess($configPrefix)); new \OCA\user_ldap\USER_LDAP($this->getAccess($configPrefix));
if(is_null($this->refBackend)) { if(is_null($this->refBackend)) {
$this->refBackend = &$this->backends[$configPrefix]; $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 * @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 string $uid the uid connected to the request
* @param $method string, the method of the user backend that shall be called * @param string $method the method of the user backend that shall be called
* @param $parameters an array of parameters to be passed * @param array $parameters an array of parameters to be passed
* @return mixed, the result of the method or false * @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); $cacheKey = $this->getUserCacheKey($uid);
foreach($this->backends as $configPrefix => $backend) { foreach($this->backends as $configPrefix => $backend) {
$instance = $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. * @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 string $uid the uid connected to the request
* @param $method string, the method of the user backend that shall be called * @param string $method the method of the user backend that shall be called
* @param $parameters an array of parameters to be passed * @param array $parameters an array of parameters to be passed
* @param $passOnWhen the result matches this variable * @param mixed $passOnWhen the result matches this variable
* @return mixed, the result of the method or false * @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); $cacheKey = $this->getUserCacheKey($uid);
$prefix = $this->getFromCache($cacheKey); $prefix = $this->getFromCache($cacheKey);
//in case the uid has been found in the past, try this stored connection first //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 * @brief Check if backend implements actions
* @param $actions bitwise-or'ed actions * @param int $actions bitwise-or'ed actions
* @returns boolean * @return boolean
* *
* Returns the supported actions as int to be * Returns the supported actions as int to be
* compared with OC_USER_BACKEND_CREATE_USER etc. * 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 * @brief Get a list of all users
* @returns array with all uids * @return string[] with all uids
* *
* Get a list of all users. * 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 * @brief Check if the password is correct
* @param $uid The username * @param string $uid The username
* @param $password The password * @param string $password The password
* @returns true/false * @return bool
* *
* Check if the password is correct without logging in the user * 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 * @brief get display name of the user
* @param $uid user ID of the user * @param string $uid user ID of the user
* @return display name * @return string display name
*/ */
public function getDisplayName($uid) { public function getDisplayName($uid) {
return $this->handleRequest($uid, 'getDisplayName', array($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 * @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 * @return boolean either the user can or cannot
*/ */
public function canChangeAvatar($uid) { 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 * @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. * 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 * @brief delete a user
* @param $uid The username of the user to delete * @param string $uid The username of the user to delete
* @returns true/false * @return bool
* *
* Deletes a user * Deletes a user
*/ */
@ -221,7 +221,7 @@ class User_Proxy extends lib\Proxy implements \OCP\UserInterface {
/** /**
* @brief Count the number of users * @brief Count the number of users
* @returns int | bool * @return int|bool
*/ */
public function countUsers() { public function countUsers() {
$users = false; $users = false;