diff options
author | Bart Visscher <bartv@thisnet.nl> | 2013-01-14 20:30:39 +0100 |
---|---|---|
committer | Bart Visscher <bartv@thisnet.nl> | 2013-01-16 18:09:16 +0100 |
commit | 5bfe4adbaa9c402db5bd0d0f74fd9ad7bb037129 (patch) | |
tree | c0a4b2c32975ec45c5d7ec371f1a4dfcb7caab0b /lib/api.php | |
parent | a8f963d9cf5b243cae497450af78c20cbc367b4b (diff) | |
download | nextcloud-server-5bfe4adbaa9c402db5bd0d0f74fd9ad7bb037129.tar.gz nextcloud-server-5bfe4adbaa9c402db5bd0d0f74fd9ad7bb037129.zip |
Whitespace cleanup
Diffstat (limited to 'lib/api.php')
-rw-r--r-- | lib/api.php | 22 |
1 files changed, 11 insertions, 11 deletions
diff --git a/lib/api.php b/lib/api.php index c464cd04913..8d728d4311f 100644 --- a/lib/api.php +++ b/lib/api.php @@ -42,12 +42,12 @@ class OC_API { private static function init() { self::$server = new OC_OAuth_Server(new OC_OAuth_Store()); } - + /** * api actions */ protected static $actions = array(); - + /** * registers an api call * @param string $method the http method @@ -58,7 +58,7 @@ class OC_API { * @param array $defaults * @param array $requirements */ - public static function register($method, $url, $action, $app, + public static function register($method, $url, $action, $app, $authLevel = OC_API::USER_AUTH, $defaults = array(), $requirements = array()) { @@ -73,7 +73,7 @@ class OC_API { } self::$actions[$name] = array('app' => $app, 'action' => $action, 'authlevel' => $authLevel); } - + /** * handles an api call * @param array $parameters @@ -92,7 +92,7 @@ class OC_API { $response = call_user_func(self::$actions[$name]['action'], $parameters); } else { $response = new OC_OCS_Result(null, 998, 'Api method not found'); - } + } } else { $response = new OC_OCS_Result(null, 997, 'Unauthorised'); } @@ -103,7 +103,7 @@ class OC_API { // logout the user to be stateless OC_User::logout(); } - + /** * authenticate the api call * @param array $action the action details as supplied to OC_API::register() @@ -148,18 +148,18 @@ class OC_API { return false; break; } - } - + } + /** * http basic auth * @return string|false (username, or false on failure) */ - private static function loginUser(){ + private static function loginUser(){ $authUser = isset($_SERVER['PHP_AUTH_USER']) ? $_SERVER['PHP_AUTH_USER'] : ''; $authPw = isset($_SERVER['PHP_AUTH_PW']) ? $_SERVER['PHP_AUTH_PW'] : ''; return OC_User::login($authUser, $authPw) ? $authUser : false; } - + /** * respond to a call * @param int|array $result the result from the api method @@ -195,5 +195,5 @@ class OC_API { } } } - + } |