diff options
author | Robin Appelman <icewind@owncloud.com> | 2013-01-16 19:04:50 +0100 |
---|---|---|
committer | Robin Appelman <icewind@owncloud.com> | 2013-01-16 19:04:50 +0100 |
commit | 5445b94416f50bb040e7426cadfa458607893f07 (patch) | |
tree | 337b12362333030e0ebda37acb7f25073723a7af /lib/public | |
parent | 7debfac0dc8f602168d8db480cfd4757b4d612b0 (diff) | |
parent | 1d57a2e2a9d5e392bb1061479543cd1dec860c4b (diff) | |
download | nextcloud-server-5445b94416f50bb040e7426cadfa458607893f07.tar.gz nextcloud-server-5445b94416f50bb040e7426cadfa458607893f07.zip |
merge master into filesystem
Diffstat (limited to 'lib/public')
-rw-r--r-- | lib/public/api.php | 4 | ||||
-rw-r--r-- | lib/public/app.php | 7 | ||||
-rw-r--r-- | lib/public/constants.php | 1 | ||||
-rw-r--r-- | lib/public/db.php | 6 | ||||
-rw-r--r-- | lib/public/files.php | 3 | ||||
-rw-r--r-- | lib/public/response.php | 14 | ||||
-rw-r--r-- | lib/public/share.php | 18 | ||||
-rw-r--r-- | lib/public/user.php | 6 | ||||
-rw-r--r-- | lib/public/util.php | 4 |
9 files changed, 34 insertions, 29 deletions
diff --git a/lib/public/api.php b/lib/public/api.php index a85daa1935c..95d333f2165 100644 --- a/lib/public/api.php +++ b/lib/public/api.php @@ -26,7 +26,7 @@ namespace OCP; * This class provides functions to manage apps in ownCloud */ class API { - + /** * registers an api call * @param string $method the http method @@ -40,5 +40,5 @@ class API { public static function register($method, $url, $action, $app, $authLevel = OC_API::USER_AUTH, $defaults = array(), $requirements = array()){ \OC_API::register($method, $url, $action, $app, $authLevel, $defaults, $requirements); } - + } diff --git a/lib/public/app.php b/lib/public/app.php index 809a656f17f..a1ecf524cc8 100644 --- a/lib/public/app.php +++ b/lib/public/app.php @@ -89,7 +89,7 @@ class App { * @param $page string page to be included */ public static function registerPersonal( $app, $page ) { - return \OC_App::registerPersonal( $app, $page ); + \OC_App::registerPersonal( $app, $page ); } /** @@ -98,7 +98,7 @@ class App { * @param $page string page to be included */ public static function registerAdmin( $app, $page ) { - return \OC_App::registerAdmin( $app, $page ); + \OC_App::registerAdmin( $app, $page ); } /** @@ -125,10 +125,9 @@ class App { /** * @brief Check if the app is enabled, redirects to home if not * @param $app app - * @returns true/false */ public static function checkAppEnabled( $app ) { - return \OC_Util::checkAppEnabled( $app ); + \OC_Util::checkAppEnabled( $app ); } /** diff --git a/lib/public/constants.php b/lib/public/constants.php index bc979c9031f..1495c620dc9 100644 --- a/lib/public/constants.php +++ b/lib/public/constants.php @@ -35,4 +35,3 @@ const PERMISSION_UPDATE = 2; const PERMISSION_DELETE = 8; const PERMISSION_SHARE = 16; const PERMISSION_ALL = 31; - diff --git a/lib/public/db.php b/lib/public/db.php index 5d4aadd22ae..932e79d9ef1 100644 --- a/lib/public/db.php +++ b/lib/public/db.php @@ -49,9 +49,9 @@ class DB { * @brief Insert a row if a matching row doesn't exists. * @param $table string The table name (will replace *PREFIX*) to perform the replace on. * @param $input array - * + * * The input array if in the form: - * + * * array ( 'id' => array ( 'value' => 6, * 'key' => true * ), @@ -65,7 +65,7 @@ class DB { public static function insertIfNotExist($table, $input) { return(\OC_DB::insertIfNotExist($table, $input)); } - + /** * @brief gets last value of autoincrement * @param $table string The optional table name (will replace *PREFIX*) and add sequence suffix diff --git a/lib/public/files.php b/lib/public/files.php index 2d6775e01f1..f6b3e0ee38a 100644 --- a/lib/public/files.php +++ b/lib/public/files.php @@ -38,9 +38,10 @@ class Files { * @brief Recusive deletion of folders * @param string $dir path to the folder * + * @return bool */ static function rmdirr( $dir ) { - \OC_Helper::rmdirr( $dir ); + return \OC_Helper::rmdirr( $dir ); } /** diff --git a/lib/public/response.php b/lib/public/response.php index bfb84eda5d1..de0c3f25347 100644 --- a/lib/public/response.php +++ b/lib/public/response.php @@ -42,7 +42,7 @@ class Response { * null cache indefinitly */ static public function enableCaching( $cache_time = null ) { - return(\OC_Response::enableCaching( $cache_time )); + \OC_Response::enableCaching( $cache_time ); } /** @@ -51,7 +51,7 @@ class Response { * @param string $lastModified time when the reponse was last modified */ static public function setLastModifiedHeader( $lastModified ) { - return(\OC_Response::setLastModifiedHeader( $lastModified )); + \OC_Response::setLastModifiedHeader( $lastModified ); } /** @@ -59,7 +59,7 @@ class Response { * @see enableCaching with cache_time = 0 */ static public function disableCaching() { - return(\OC_Response::disableCaching()); + \OC_Response::disableCaching(); } /** @@ -68,7 +68,7 @@ class Response { * @param string $etag token to use for modification check */ static public function setETagHeader( $etag ) { - return(\OC_Response::setETagHeader( $etag )); + \OC_Response::setETagHeader( $etag ); } /** @@ -76,7 +76,7 @@ class Response { * @param string $filepath of file to send */ static public function sendFile( $filepath ) { - return(\OC_Response::sendFile( $filepath )); + \OC_Response::sendFile( $filepath ); } /** @@ -86,7 +86,7 @@ class Response { * DateTime object when to expire response */ static public function setExpiresHeader( $expires ) { - return(\OC_Response::setExpiresHeader( $expires )); + \OC_Response::setExpiresHeader( $expires ); } /** @@ -94,6 +94,6 @@ class Response { * @param string $location to redirect to */ static public function redirect( $location ) { - return(\OC_Response::redirect( $location )); + \OC_Response::redirect( $location ); } } diff --git a/lib/public/share.php b/lib/public/share.php index 7722e0b86cc..9d2a64b4590 100644 --- a/lib/public/share.php +++ b/lib/public/share.php @@ -248,14 +248,14 @@ class Share { //delete the old share self::delete($checkExists['id']); } - + // Generate hash of password - same method as user passwords if (isset($shareWith)) { $forcePortable = (CRYPT_BLOWFISH != 1); $hasher = new \PasswordHash(8, $forcePortable); $shareWith = $hasher->HashPassword($shareWith.\OC_Config::getValue('passwordsalt', '')); } - + // Generate token if (isset($oldToken)) { $token = $oldToken; @@ -305,7 +305,9 @@ class Share { if ($parentFolder && $files = \OC\Files\Filesystem::getDirectoryContent($itemSource)) { for ($i = 0; $i < count($files); $i++) { $name = substr($files[$i]['name'], strpos($files[$i]['name'], $itemSource) - strlen($itemSource)); - if ($files[$i]['mimetype'] == 'httpd/unix-directory' && $children = \OC\Files\Filesystem::getDirectoryContent($name, '/')) { + if ($files[$i]['mimetype'] == 'httpd/unix-directory' + && $children = \OC\Files\Filesystem::getDirectoryContent($name, '/') + ) { // Continue scanning into child folders array_push($files, $children); } else { @@ -681,8 +683,14 @@ class Share { } } else { if ($fileDependent) { - if (($itemType == 'file' || $itemType == 'folder') && $format == \OC_Share_Backend_File::FORMAT_GET_FOLDER_CONTENTS || $format == \OC_Share_Backend_File::FORMAT_FILE_APP_ROOT) { - $select = '`*PREFIX*share`.`id`, `item_type`, `*PREFIX*share`.`parent`, `uid_owner`, `share_type`, `share_with`, `file_source`, `path`, `file_target`, `permissions`, `expiration`, `storage`, `*PREFIX*filecache`.`parent` as `file_parent`, `name`, `mtime`, `mimetype`, `mimepart`, `size`, `encrypted`'; + if (($itemType == 'file' || $itemType == 'folder') + && $format == \OC_Share_Backend_File::FORMAT_FILE_APP + || $format == \OC_Share_Backend_File::FORMAT_FILE_APP_ROOT + ) { + $select = '`*PREFIX*share`.`id`, `item_type`, `*PREFIX*share`.`parent`, `uid_owner`, ' + .'`share_type`, `share_with`, `file_source`, `path`, `file_target`, `permissions`, ' + .'`expiration`, `name`, `ctime`, `mtime`, `mimetype`, `size`, `encrypted`, ' + .'`versioned`, `writable`'; } else { $select = '`*PREFIX*share`.`id`, `item_type`, `item_source`, `item_target`, `*PREFIX*share`.`parent`, `share_type`, `share_with`, `uid_owner`, `file_source`, `path`, `file_target`, `permissions`, `stime`, `expiration`, `token`'; } diff --git a/lib/public/user.php b/lib/public/user.php index 9e50115ab70..204d8e4c0f1 100644 --- a/lib/public/user.php +++ b/lib/public/user.php @@ -65,7 +65,7 @@ class User { /** * @brief check if a user exists * @param string $uid the username - * @param string $excludingBackend (default none) + * @param string $excludingBackend (default none) * @return boolean */ public static function userExists( $uid, $excludingBackend = null ) { @@ -73,12 +73,10 @@ class User { } /** * @brief Loggs the user out including all the session data - * @returns true - * * Logout, destroys session */ public static function logout() { - return \OC_USER::logout(); + \OC_USER::logout(); } /** diff --git a/lib/public/util.php b/lib/public/util.php index df09ea81ae1..8197482c0dd 100644 --- a/lib/public/util.php +++ b/lib/public/util.php @@ -203,7 +203,7 @@ class Util { $host_name = self::getServerHostName(); // handle localhost installations if ($host_name === 'localhost') { - $host_name = "example.com"; + $host_name = "example.com"; } return $user_part.'@'.$host_name; } @@ -298,7 +298,7 @@ class Util { * Todo: Write howto */ public static function callCheck() { - return(\OC_Util::callCheck()); + \OC_Util::callCheck(); } /** |