2012-07-30 14:25:41 +04:00
|
|
|
<?php
|
|
|
|
/**
|
|
|
|
* Copyright (c) 2012, Tom Needham <tom@owncloud.com>
|
|
|
|
* 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';
|
2012-07-30 17:14:29 +04:00
|
|
|
OC_Util::checkLoggedIn();
|
2012-07-30 14:25:41 +04:00
|
|
|
// Example
|
|
|
|
$consumer = array(
|
|
|
|
'name' => 'Firefox Bookmark Sync',
|
|
|
|
'scopes' => array('bookmarks'),
|
|
|
|
);
|
|
|
|
|
|
|
|
$t = new OC_Template('settings', 'oauth', 'guest');
|
2012-07-30 14:51:48 +04:00
|
|
|
OC_Util::addStyle('settings', 'oauth');
|
2012-07-30 14:25:41 +04:00
|
|
|
$t->assign('consumer', $consumer);
|
|
|
|
$t->printPage();
|
|
|
|
break;
|
|
|
|
|
|
|
|
case 'access_token';
|
|
|
|
break;
|
|
|
|
|
|
|
|
default:
|
|
|
|
// Something went wrong
|
|
|
|
header('Location: /');
|
|
|
|
break;
|
|
|
|
|
|
|
|
}
|