diff options
author | Vincent Petry <pvince81@owncloud.com> | 2017-03-30 16:08:25 +0200 |
---|---|---|
committer | Morris Jobke <hey@morrisjobke.de> | 2017-08-21 09:59:10 +0200 |
commit | 2cb346114685ded69f5291812503c278298c1bce (patch) | |
tree | ff18f30b777d441dc167d874c61a55a041c23da3 /apps/files_external/ajax | |
parent | 6e3b8db98dd00ca0473e1a7d41174ed3dc9c7830 (diff) | |
download | nextcloud-server-2cb346114685ded69f5291812503c278298c1bce.tar.gz nextcloud-server-2cb346114685ded69f5291812503c278298c1bce.zip |
Move GDrive external storage to a separate repo
Signed-off-by: Morris Jobke <hey@morrisjobke.de>
Diffstat (limited to 'apps/files_external/ajax')
-rw-r--r-- | apps/files_external/ajax/oauth2.php | 41 |
1 files changed, 1 insertions, 40 deletions
diff --git a/apps/files_external/ajax/oauth2.php b/apps/files_external/ajax/oauth2.php index 8b257b77ef6..2510d6ba8cb 100644 --- a/apps/files_external/ajax/oauth2.php +++ b/apps/files_external/ajax/oauth2.php @@ -27,48 +27,9 @@ * along with this program. If not, see <http://www.gnu.org/licenses/> * */ -set_include_path(get_include_path().PATH_SEPARATOR. - \OC_App::getAppPath('files_external').'/3rdparty/google-api-php-client/src'); -require_once 'Google/autoload.php'; - OCP\JSON::checkAppEnabled('files_external'); OCP\JSON::checkLoggedIn(); OCP\JSON::callCheck(); $l = \OC::$server->getL10N('files_external'); -// FIXME: currently hard-coded to Google Drive -if (isset($_POST['client_id']) && isset($_POST['client_secret']) && isset($_POST['redirect'])) { - $client = new Google_Client(); - $client->setClientId((string)$_POST['client_id']); - $client->setClientSecret((string)$_POST['client_secret']); - $client->setRedirectUri((string)$_POST['redirect']); - $client->setScopes(array('https://www.googleapis.com/auth/drive')); - $client->setApprovalPrompt('force'); - $client->setAccessType('offline'); - if (isset($_POST['step'])) { - $step = (int) $_POST['step']; - if ($step === 1) { - try { - $authUrl = $client->createAuthUrl(); - OCP\JSON::success(array('data' => array( - 'url' => $authUrl - ))); - } catch (Exception $exception) { - OCP\JSON::error(array('data' => array( - 'message' => $l->t('Step 1 failed. Exception: %s', array($exception->getMessage())) - ))); - } - } else if ($step === 2 && isset($_POST['code'])) { - try { - $token = $client->authenticate((string)$_POST['code']); - OCP\JSON::success(array('data' => array( - 'token' => $token - ))); - } catch (Exception $exception) { - OCP\JSON::error(array('data' => array( - 'message' => $l->t('Step 2 failed. Exception: %s', array($exception->getMessage())) - ))); - } - } - } -} +// TODO: implement redirect to which storage backend requested this |