diff options
author | Tom Needham <needham.thomas@gmail.com> | 2012-08-03 11:47:05 +0000 |
---|---|---|
committer | Tom Needham <needham.thomas@gmail.com> | 2012-08-03 11:47:05 +0000 |
commit | a7906d813ad342f06d4834c10c1200002f7342d2 (patch) | |
tree | 3febe27bb1e19dfd93916856057f63cb0d699669 | |
parent | 88c6928bade99676ab44dd43519dd40d470515c6 (diff) | |
download | nextcloud-server-a7906d813ad342f06d4834c10c1200002f7342d2.tar.gz nextcloud-server-a7906d813ad342f06d4834c10c1200002f7342d2.zip |
Move OAuth classes into lib/oauth
-rw-r--r-- | lib/api.php | 4 | ||||
-rw-r--r-- | lib/oauth/server.php (renamed from lib/oauth.php) | 9 | ||||
-rw-r--r-- | lib/oauth/store.php | 29 | ||||
-rw-r--r-- | settings/oauth.php | 2 |
4 files changed, 40 insertions, 4 deletions
diff --git a/lib/api.php b/lib/api.php index c8bd0aec2fa..8fdfc63070b 100644 --- a/lib/api.php +++ b/lib/api.php @@ -23,7 +23,7 @@ * License along with this library. If not, see <http://www.gnu.org/licenses/>. * */ - + class OC_API { private static $server; @@ -32,7 +32,7 @@ class OC_API { * initialises the OAuth store and server */ private static function init() { - self::$server = new OC_OAuthServer(new OC_OAuthStore()); + self::$server = new OC_OAuth_Server(new OC_OAuth_Store()); } /** diff --git a/lib/oauth.php b/lib/oauth/server.php index b72d9aab446..c563c527601 100644 --- a/lib/oauth.php +++ b/lib/oauth/server.php @@ -22,7 +22,9 @@ * */ -class OC_OAuthServer extends OAuthServer { +require_once(OC::$THIRDPARTYROOT.'/3rdparty/OAuth/OAuth.php'); + +class OC_OAuth_Server extends OAuthServer { public function fetch_request_token(&$request) { $this->get_version($request); @@ -34,6 +36,11 @@ class OC_OAuthServer extends OAuthServer { return $this->data_store->new_request_token($consumer, $scope, $callback); } + /** + * authorises a request token + * @param string $request the request token to authorise + * @return What does it return? + */ public function authoriseRequestToken(&$request) { $this->get_version($request); $consumer = $this->get_consumer($request); diff --git a/lib/oauth/store.php b/lib/oauth/store.php new file mode 100644 index 00000000000..2f58e46b5b0 --- /dev/null +++ b/lib/oauth/store.php @@ -0,0 +1,29 @@ +<?php +/** +* ownCloud +* +* @author Tom Needham +* @author Michael Gapczynski +* @copyright 2012 Tom Needham tom@owncloud.com +* @copyright 2012 Michael Gapczynski mtgap@owncloud.com +* +* This library is free software; you can redistribute it and/or +* modify it under the terms of the GNU AFFERO GENERAL PUBLIC LICENSE +* License as published by the Free Software Foundation; either +* version 3 of the License, or any later version. +* +* This library is distributed in the hope that it will be useful, +* but WITHOUT ANY WARRANTY; without even the implied warranty of +* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +* GNU AFFERO GENERAL PUBLIC LICENSE for more details. +* +* You should have received a copy of the GNU Affero General Public +* License along with this library. If not, see <http://www.gnu.org/licenses/>. +* +*/ + +class OC_OAuth_Store extends OAuthDataStore { + + // To follow. + +}
\ No newline at end of file diff --git a/settings/oauth.php b/settings/oauth.php index b04c798b1b0..7f30161d852 100644 --- a/settings/oauth.php +++ b/settings/oauth.php @@ -9,7 +9,7 @@ require_once('../lib/base.php'); // Logic $operation = isset($_GET['operation']) ? $_GET['operation'] : ''; -$server = new OC_OAuthServer(new OC_OAuthStore()); +$server = new OC_OAuth_Server(new OC_OAuth_Store()); switch($operation){ case 'register': |