From 5933d4390107224071f8265afd81222b69f98de7 Mon Sep 17 00:00:00 2001 From: Tom Needham Date: Mon, 30 Jul 2012 10:25:41 +0000 Subject: [PATCH] Basic template for authorising exernal apps with OAuth --- settings/oauth.php | 41 ++++++++++++++++++++++++++++++++++++ settings/templates/oauth.php | 19 +++++++++++++++++ 2 files changed, 60 insertions(+) create mode 100644 settings/oauth.php create mode 100644 settings/templates/oauth.php diff --git a/settings/oauth.php b/settings/oauth.php new file mode 100644 index 0000000000..bcf34b04af --- /dev/null +++ b/settings/oauth.php @@ -0,0 +1,41 @@ + + * This file is licensed under the Affero General Public License version 3 or later. + * See the COPYING-README file. + */ + +require_once('../lib/base.php'); + +// Logic +$operation = isset($_GET['operation']) ? $_GET['operation'] : ''; +switch($operation){ + + case 'register': + + break; + + case 'request_token': + break; + + case 'authorise'; + // Example + $consumer = array( + 'name' => 'Firefox Bookmark Sync', + 'scopes' => array('bookmarks'), + ); + + $t = new OC_Template('settings', 'oauth', 'guest'); + $t->assign('consumer', $consumer); + $t->printPage(); + break; + + case 'access_token'; + break; + + default: + // Something went wrong + header('Location: /'); + break; + +} diff --git a/settings/templates/oauth.php b/settings/templates/oauth.php new file mode 100644 index 0000000000..ce2584365b --- /dev/null +++ b/settings/templates/oauth.php @@ -0,0 +1,19 @@ + + * This file is licensed under the Affero General Public License version 3 or later. + * See the COPYING-README file. + */ +?> + +

is requesting permission to read, write, modify and delete data from the following apps:

+ + + \ No newline at end of file