diff options
author | Bart Visscher <bartv@thisnet.nl> | 2013-02-22 17:21:57 +0100 |
---|---|---|
committer | Bart Visscher <bartv@thisnet.nl> | 2013-02-22 19:05:36 +0100 |
commit | bb75dfc021a68bcd9526ef40f78bca4910798345 (patch) | |
tree | 30185c8198f4da87f180214bf1f2076ec48f3777 /lib | |
parent | 78fce834058a38a7dbcc5310e16095c743434bc6 (diff) | |
download | nextcloud-server-bb75dfc021a68bcd9526ef40f78bca4910798345.tar.gz nextcloud-server-bb75dfc021a68bcd9526ef40f78bca4910798345.zip |
Whitespace fixes
Diffstat (limited to 'lib')
-rw-r--r-- | lib/connector/sabre/directory.php | 12 | ||||
-rw-r--r-- | lib/connector/sabre/file.php | 8 | ||||
-rw-r--r-- | lib/files/cache/legacy.php | 6 | ||||
-rw-r--r-- | lib/files/filesystem.php | 2 | ||||
-rw-r--r-- | lib/files/storage/common.php | 4 | ||||
-rw-r--r-- | lib/group.php | 50 | ||||
-rw-r--r-- | lib/group/backend.php | 34 | ||||
-rw-r--r-- | lib/group/database.php | 32 | ||||
-rw-r--r-- | lib/hook.php | 16 | ||||
-rw-r--r-- | lib/image.php | 2 | ||||
-rw-r--r-- | lib/public/share.php | 6 | ||||
-rw-r--r-- | lib/public/user.php | 34 | ||||
-rwxr-xr-x | lib/request.php | 2 | ||||
-rw-r--r-- | lib/search.php | 4 | ||||
-rw-r--r-- | lib/setup.php | 10 | ||||
-rw-r--r-- | lib/user.php | 2 | ||||
-rw-r--r-- | lib/user/backend.php | 4 | ||||
-rw-r--r-- | lib/user/database.php | 12 |
18 files changed, 120 insertions, 120 deletions
diff --git a/lib/connector/sabre/directory.php b/lib/connector/sabre/directory.php index a9aa891d409..953692f80a9 100644 --- a/lib/connector/sabre/directory.php +++ b/lib/connector/sabre/directory.php @@ -62,12 +62,12 @@ class OC_Connector_Sabre_Directory extends OC_Connector_Sabre_Node implements Sa } } else { $newPath = $this->path . '/' . $name; - + // mark file as partial while uploading (ignored by the scanner) $partpath = $newPath . '.part'; - + \OC\Files\Filesystem::file_put_contents($partpath, $data); - + //detect aborted upload if (isset ($_SERVER['REQUEST_METHOD']) && $_SERVER['REQUEST_METHOD'] === 'PUT' ) { if (isset($_SERVER['CONTENT_LENGTH'])) { @@ -80,10 +80,10 @@ class OC_Connector_Sabre_Directory extends OC_Connector_Sabre_Node implements Sa } } } - + // rename to correct path \OC\Files\Filesystem::rename($partpath, $newPath); - + // allow sync clients to send the mtime along in a header $mtime = OC_Request::hasModificationTime(); if ($mtime !== false) { @@ -91,7 +91,7 @@ class OC_Connector_Sabre_Directory extends OC_Connector_Sabre_Node implements Sa header('X-OC-MTime: accepted'); } } - + return OC_Connector_Sabre_Node::getETagPropertyForPath($newPath); } diff --git a/lib/connector/sabre/file.php b/lib/connector/sabre/file.php index c4c27e92251..91646312e90 100644 --- a/lib/connector/sabre/file.php +++ b/lib/connector/sabre/file.php @@ -47,9 +47,9 @@ class OC_Connector_Sabre_File extends OC_Connector_Sabre_Node implements Sabre_D // mark file as partial while uploading (ignored by the scanner) $partpath = $this->path . '.part'; - + \OC\Files\Filesystem::file_put_contents($partpath, $data); - + //detect aborted upload if (isset ($_SERVER['REQUEST_METHOD']) && $_SERVER['REQUEST_METHOD'] === 'PUT' ) { if (isset($_SERVER['CONTENT_LENGTH'])) { @@ -62,10 +62,10 @@ class OC_Connector_Sabre_File extends OC_Connector_Sabre_Node implements Sabre_D } } } - + // rename to correct path \OC\Files\Filesystem::rename($partpath, $this->path); - + //allow sync clients to send the mtime along in a header $mtime = OC_Request::hasModificationTime(); if ($mtime !== false) { diff --git a/lib/files/cache/legacy.php b/lib/files/cache/legacy.php index 6d1ffa7b40b..2b8689fcbda 100644 --- a/lib/files/cache/legacy.php +++ b/lib/files/cache/legacy.php @@ -51,12 +51,12 @@ class Legacy { $this->cacheHasItems = false; return false; } - + if ($result === false || property_exists($result, 'error_message_prefix')) { $this->cacheHasItems = false; return false; - } - + } + $this->cacheHasItems = (bool)$result->fetchRow(); return $this->cacheHasItems; } diff --git a/lib/files/filesystem.php b/lib/files/filesystem.php index 401ee8417e5..0bbd7550d74 100644 --- a/lib/files/filesystem.php +++ b/lib/files/filesystem.php @@ -221,7 +221,7 @@ class Filesystem { $root = \OC_User::getHome($user); self::mount('\OC\Files\Storage\Local', array('datadir' => $root), $user); - + // Load system mount points if (is_file(\OC::$SERVERROOT . '/config/mount.php') or is_file(\OC::$SERVERROOT . '/config/mount.json')) { if (is_file(\OC::$SERVERROOT . '/config/mount.json')) { diff --git a/lib/files/storage/common.php b/lib/files/storage/common.php index 4e7a73e5d4a..8faacdf01d8 100644 --- a/lib/files/storage/common.php +++ b/lib/files/storage/common.php @@ -278,7 +278,7 @@ abstract class Common implements \OC\Files\Storage\Storage { return uniqid(); } } - + /** * clean a path, i.e. remove all redundant '.' and '..' * making sure that it can't point to higher than '/' @@ -289,7 +289,7 @@ abstract class Common implements \OC\Files\Storage\Storage { if (strlen($path) == 0 or $path[0] != '/') { $path = '/' . $path; } - + $output = array(); foreach (explode('/', $path) as $chunk) { if ($chunk == '..') { diff --git a/lib/group.php b/lib/group.php index 8c06ddc0fd0..88f0a2a032c 100644 --- a/lib/group.php +++ b/lib/group.php @@ -286,31 +286,31 @@ class OC_Group { } return $users; } - - /**
- * @brief get a list of all display names in a group
- * @returns array with display names (value) and user ids(key)
- */
- public static function displayNamesInGroup($gid, $search = '', $limit = -1, $offset = 0) {
- $displayNames=array();
- foreach(self::$_usedBackends as $backend) {
- $displayNames = array_merge($backend->displayNamesInGroup($gid, $search, $limit, $offset), $displayNames);
- }
- return $displayNames;
+ + /** + * @brief get a list of all display names in a group + * @returns array with display names (value) and user ids(key) + */ + public static function displayNamesInGroup($gid, $search = '', $limit = -1, $offset = 0) { + $displayNames=array(); + foreach(self::$_usedBackends as $backend) { + $displayNames = array_merge($backend->displayNamesInGroup($gid, $search, $limit, $offset), $displayNames); + } + return $displayNames; } - - /**
- * @brief get a list of all display names in several groups
- * @param array $gids
- * @param string $search
- * @param int $limit
- * @param int $offset
- * @return array with display names (Key) user ids (value)
- */
- public static function displayNamesInGroups($gids, $search = '', $limit = -1, $offset = 0) {
+ + /** + * @brief get a list of all display names in several groups + * @param array $gids + * @param string $search + * @param int $limit + * @param int $offset + * @return array with display names (Key) user ids (value) + */ + public static function displayNamesInGroups($gids, $search = '', $limit = -1, $offset = 0) { $displayNames = array(); - foreach ($gids as $gid) {
- // TODO Need to apply limits to groups as total
+ foreach ($gids as $gid) { + // TODO Need to apply limits to groups as total $diff = array_diff( self::displayNamesInGroup($gid, $search, $limit, $offset), $displayNames @@ -318,7 +318,7 @@ class OC_Group { if ($diff) { $displayNames = array_merge($diff, $displayNames); } - }
- return $displayNames;
+ } + return $displayNames; } } diff --git a/lib/group/backend.php b/lib/group/backend.php index 4f6570c3be3..e7b7b21d957 100644 --- a/lib/group/backend.php +++ b/lib/group/backend.php @@ -133,23 +133,23 @@ abstract class OC_Group_Backend implements OC_Group_Interface { public function usersInGroup($gid, $search = '', $limit = -1, $offset = 0) { return array(); } - - /**
- * @brief get a list of all display names in a group
- * @param string $gid
- * @param string $search
- * @param int $limit
- * @param int $offset
- * @return array with display names (value) and user ids (key)
- */
- public function DisplayNamesInGroup($gid, $search = '', $limit = -1, $offset = 0) {
- $displayNames = '';
- $users = $this->usersInGroup($gid, $search, $limit, $offset);
- foreach ( $users as $user ) {
- $DisplayNames[$user] = $user;
- }
-
- return $DisplayNames;
+ + /** + * @brief get a list of all display names in a group + * @param string $gid + * @param string $search + * @param int $limit + * @param int $offset + * @return array with display names (value) and user ids (key) + */ + public function DisplayNamesInGroup($gid, $search = '', $limit = -1, $offset = 0) { + $displayNames = ''; + $users = $this->usersInGroup($gid, $search, $limit, $offset); + foreach ( $users as $user ) { + $DisplayNames[$user] = $user; + } + + return $DisplayNames; } } diff --git a/lib/group/database.php b/lib/group/database.php index 93dc05c53a1..40e9b0d4147 100644 --- a/lib/group/database.php +++ b/lib/group/database.php @@ -210,16 +210,16 @@ class OC_Group_Database extends OC_Group_Backend { } return $users; } - - /**
- * @brief get a list of all display names in a group
- * @param string $gid
- * @param string $search
- * @param int $limit
- * @param int $offset
- * @return array with display names (value) and user ids (key)
- */
- public function DisplayNamesInGroup($gid, $search = '', $limit = -1, $offset = 0) {
+ + /** + * @brief get a list of all display names in a group + * @param string $gid + * @param string $search + * @param int $limit + * @param int $offset + * @return array with display names (value) and user ids (key) + */ + public function DisplayNamesInGroup($gid, $search = '', $limit = -1, $offset = 0) { $displayNames = ''; $stmt = OC_DB::prepare('SELECT `*PREFIX*users`.`uid`, `*PREFIX*users`.`displayname`' @@ -228,12 +228,12 @@ class OC_Group_Database extends OC_Group_Backend { .' WHERE `gid` = ? AND `*PREFIX*group_user`.`uid` LIKE ?', $limit, $offset); - $result = $stmt->execute(array($gid, $search.'%'));
- $users = array();
+ $result = $stmt->execute(array($gid, $search.'%')); + $users = array(); while ($row = $result->fetchRow()) { - $displayName = trim($row['displayname'], ' ');
- $displayNames[$row['uid']] = empty($displayName) ? $row['uid'] : $displayName;
- }
- return $displayNames;
+ $displayName = trim($row['displayname'], ' '); + $displayNames[$row['uid']] = empty($displayName) ? $row['uid'] : $displayName; + } + return $displayNames; } } diff --git a/lib/hook.php b/lib/hook.php index 554381251d6..8516cf0dcff 100644 --- a/lib/hook.php +++ b/lib/hook.php @@ -20,23 +20,23 @@ class OC_Hook{ * TODO: write example */ static public function connect( $signalclass, $signalname, $slotclass, $slotname ) { - // If we're trying to connect to an emitting class that isn't + // If we're trying to connect to an emitting class that isn't // yet registered, register it if( !array_key_exists( $signalclass, self::$registered )) { self::$registered[$signalclass] = array(); } - // If we're trying to connect to an emitting method that isn't + // If we're trying to connect to an emitting method that isn't // yet registered, register it with the emitting class - if( !array_key_exists( $signalname, self::$registered[$signalclass] )) { + if( !array_key_exists( $signalname, self::$registered[$signalclass] )) { self::$registered[$signalclass][$signalname] = array(); } - + // Connect the hook handler to the requested emitter self::$registered[$signalclass][$signalname][] = array( "class" => $slotclass, "name" => $slotname ); - + // No chance for failure ;-) return true; } @@ -53,19 +53,19 @@ class OC_Hook{ * TODO: write example */ static public function emit( $signalclass, $signalname, $params = array()) { - + // Return false if no hook handlers are listening to this // emitting class if( !array_key_exists( $signalclass, self::$registered )) { return false; } - + // Return false if no hook handlers are listening to this // emitting method if( !array_key_exists( $signalname, self::$registered[$signalclass] )) { return false; } - + // Call all slots foreach( self::$registered[$signalclass][$signalname] as $i ) { try { diff --git a/lib/image.php b/lib/image.php index dc1c6df85ae..97b0231047b 100644 --- a/lib/image.php +++ b/lib/image.php @@ -765,7 +765,7 @@ class OC_Image { imagealphablending($process, false); imagesavealpha($process, true); } - + imagecopyresampled($process, $this->resource, 0, 0, $x, $y, $targetWidth, $targetHeight, $width, $height); if ($process == false) { OC_Log::write('core', diff --git a/lib/public/share.php b/lib/public/share.php index c0f35333e83..37cf0838ed1 100644 --- a/lib/public/share.php +++ b/lib/public/share.php @@ -384,7 +384,7 @@ class Share { 'itemSource' => $itemSource, 'shareType' => $shareType, 'shareWith' => $shareWith, - )); + )); self::delete($item['id']); return true; } @@ -404,7 +404,7 @@ class Share { 'itemType' => $itemType, 'itemSource' => $itemSource, 'shares' => $shares - )); + )); foreach ($shares as $share) { self::delete($share['id']); } @@ -848,7 +848,7 @@ class Share { if ( isset($row['uid_owner']) && $row['uid_owner'] != '') { $row['displayname_owner'] = \OCP\User::getDisplayName($row['uid_owner']); } - + $items[$row['id']] = $row; } if (!empty($items)) { diff --git a/lib/public/user.php b/lib/public/user.php index 86d1d0ccde8..9edebe0e7cf 100644 --- a/lib/public/user.php +++ b/lib/public/user.php @@ -52,25 +52,25 @@ class User { public static function getUsers($search = '', $limit = null, $offset = null) { return \OC_USER::getUsers(); } - - /**
- * @brief get the user display name of the user currently logged in.
- * @return string display name
- */
- public static function getDisplayName($user=null) {
- return \OC_USER::getDisplayName($user);
+ + /** + * @brief get the user display name of the user currently logged in. + * @return string display name + */ + public static function getDisplayName($user=null) { + return \OC_USER::getDisplayName($user); } - - /**
- * @brief Get a list of all display names
- * @returns array with all display names (value) and the correspondig uids (key)
- *
- * Get a list of all display names and user ids.
- */
- public static function getDisplayNames($search = '', $limit = null, $offset = null) {
- return \OC_USER::getDisplayNames($search, $limit, $offset);
+ + /** + * @brief Get a list of all display names + * @returns array with all display names (value) and the correspondig uids (key) + * + * Get a list of all display names and user ids. + */ + public static function getDisplayNames($search = '', $limit = null, $offset = null) { + return \OC_USER::getDisplayNames($search, $limit, $offset); } - + /** * @brief Check if the user is logged in * @returns true/false diff --git a/lib/request.php b/lib/request.php index 3af93289670..30a25df23ab 100755 --- a/lib/request.php +++ b/lib/request.php @@ -149,7 +149,7 @@ class OC_Request { return 'gzip'; return false; } - + /** * @brief Check if the requester sent along an mtime * @returns false or an mtime diff --git a/lib/search.php b/lib/search.php index e5a65f7157d..b9c75dfc333 100644 --- a/lib/search.php +++ b/lib/search.php @@ -57,14 +57,14 @@ class OC_Search{ } return $results; } - + /** * remove an existing search provider * @param string $provider class name of a OC_Search_Provider */ public static function removeProvider($provider) { self::$registeredProviders = array_filter( - self::$registeredProviders, + self::$registeredProviders, function ($element) use ($provider) { return ($element['class'] != $provider); } diff --git a/lib/setup.php b/lib/setup.php index faf011fccb1..19e4a82b51f 100644 --- a/lib/setup.php +++ b/lib/setup.php @@ -98,7 +98,7 @@ class OC_Setup { $error[] = array( 'error' => $e->getMessage(), 'hint' => $e->getHint() - ); + ); return($error); } catch (Exception $e) { $error[] = array( @@ -174,7 +174,7 @@ class OC_Setup { OC_Appconfig::setValue('core', 'lastupdatedat', microtime(true)); OC_AppConfig::setValue('core', 'remote_core.css', '/core/minimizer.php'); OC_AppConfig::setValue('core', 'remote_core.js', '/core/minimizer.php'); - + OC_Group::createGroup('admin'); OC_Group::addToGroup($username, 'admin'); OC_User::login($username, $password); @@ -276,7 +276,7 @@ class OC_Setup { $query = "CREATE USER '$name'@'%' IDENTIFIED BY '$password'"; $result = mysql_query($query, $connection); if (!$result) { - throw new DatabaseSetupException($l->t("MySQL user '%s'@'%%' already exists", array($name)), + throw new DatabaseSetupException($l->t("MySQL user '%s'@'%%' already exists", array($name)), $l->t("Drop this user from MySQL.")); } } @@ -550,7 +550,7 @@ class OC_Setup { $result = oci_execute($stmt); if(!$result) { $entry = $l->t('DB Error: "%s"', array(oci_error($connection))) . '<br />'; - $entry .= $l->t('Offending command was: "%s", name: %s, password: %s', + $entry .= $l->t('Offending command was: "%s", name: %s, password: %s', array($query, $name, $password)) . '<br />'; echo($entry); } @@ -582,7 +582,7 @@ class OC_Setup { $result = oci_execute($stmt); if(!$result) { $entry = $l->t('DB Error: "%s"', array(oci_error($connection))) . '<br />'; - $entry .= $l->t('Offending command was: "%s", name: %s, password: %s', + $entry .= $l->t('Offending command was: "%s", name: %s, password: %s', array($query, $name, $password)) . '<br />'; echo($entry); } diff --git a/lib/user.php b/lib/user.php index e69fef95a13..16f6d2787cb 100644 --- a/lib/user.php +++ b/lib/user.php @@ -437,7 +437,7 @@ class OC_User { } return false; } - + /** * @brief Check whether user can change his display name * @param $uid The username diff --git a/lib/user/backend.php b/lib/user/backend.php index 60b3cc6c5e4..93e8f17ca98 100644 --- a/lib/user/backend.php +++ b/lib/user/backend.php @@ -124,7 +124,7 @@ abstract class OC_User_Backend implements OC_User_Interface { public function getHome($uid) { return false; } - + /** * @brief get display name of the user * @param $uid user ID of the user @@ -133,7 +133,7 @@ abstract class OC_User_Backend implements OC_User_Interface { public function getDisplayName($uid) { return $uid; } - + /** * @brief Get a list of all display names * @returns array with all displayNames (value) and the corresponding uids (key) diff --git a/lib/user/database.php b/lib/user/database.php index a0ad03fe0a0..210c7f3e1eb 100644 --- a/lib/user/database.php +++ b/lib/user/database.php @@ -110,7 +110,7 @@ class OC_User_Database extends OC_User_Backend { return false; } } - + /** * @brief Set display name * @param $uid The username @@ -146,7 +146,7 @@ class OC_User_Database extends OC_User_Backend { } } } - + /** * @brief Get a list of all display names * @returns array with all displayNames (value) and the correspondig uids (key) @@ -162,7 +162,7 @@ class OC_User_Database extends OC_User_Backend { while ($row = $result->fetchRow()) { $displayNames[$row['uid']] = $row['displayname']; } - + // let's see if we can also find some users who don't have a display name yet $query = OC_DB::prepare('SELECT `uid`, `displayname` FROM `*PREFIX*users`' .' WHERE LOWER(`uid`) LIKE LOWER(?)', $limit, $offset); @@ -173,11 +173,11 @@ class OC_User_Database extends OC_User_Backend { $displayNames[$row['uid']] = $row['uid']; } } - - + + return $displayNames; } - + /** * @brief Check if the password is correct * @param $uid The username |