diff options
author | Robin Appelman <icewind@owncloud.com> | 2012-12-03 18:02:22 +0100 |
---|---|---|
committer | Robin Appelman <icewind@owncloud.com> | 2012-12-03 18:02:22 +0100 |
commit | be30b1a8de2c7858be3f1dfa792504478af70eb4 (patch) | |
tree | eb3f69b006041c1a586479bb59dbf557df48eec0 /apps/files_external/ajax | |
parent | 18663100d9f68400fba1fc344874aacb62bb4659 (diff) | |
parent | 4cb760a92402ab3eb8550fb05b05eae800030680 (diff) | |
download | nextcloud-server-be30b1a8de2c7858be3f1dfa792504478af70eb4.tar.gz nextcloud-server-be30b1a8de2c7858be3f1dfa792504478af70eb4.zip |
merge master into filesystem
Diffstat (limited to 'apps/files_external/ajax')
-rw-r--r-- | apps/files_external/ajax/addMountPoint.php | 7 | ||||
-rw-r--r-- | apps/files_external/ajax/addRootCertificate.php | 12 | ||||
-rw-r--r-- | apps/files_external/ajax/dropbox.php | 15 | ||||
-rw-r--r-- | apps/files_external/ajax/google.php | 27 |
4 files changed, 45 insertions, 16 deletions
diff --git a/apps/files_external/ajax/addMountPoint.php b/apps/files_external/ajax/addMountPoint.php index e08f805942f..4cd8871b310 100644 --- a/apps/files_external/ajax/addMountPoint.php +++ b/apps/files_external/ajax/addMountPoint.php @@ -10,4 +10,9 @@ if ($_POST['isPersonal'] == 'true') { OCP\JSON::checkAdminUser(); $isPersonal = false; } -OC_Mount_Config::addMountPoint($_POST['mountPoint'], $_POST['class'], $_POST['classOptions'], $_POST['mountType'], $_POST['applicable'], $isPersonal); +OC_Mount_Config::addMountPoint($_POST['mountPoint'], + $_POST['class'], + $_POST['classOptions'], + $_POST['mountType'], + $_POST['applicable'], + $isPersonal);
\ No newline at end of file diff --git a/apps/files_external/ajax/addRootCertificate.php b/apps/files_external/ajax/addRootCertificate.php index 6fef9aac1ed..2f67e801b2c 100644 --- a/apps/files_external/ajax/addRootCertificate.php +++ b/apps/files_external/ajax/addRootCertificate.php @@ -2,7 +2,7 @@ OCP\JSON::checkAppEnabled('files_external'); -if ( !($filename = $_FILES['rootcert_import']['name']) ) { +if ( ! ($filename = $_FILES['rootcert_import']['name']) ) { header("Location: settings/personal.php"); exit; } @@ -13,7 +13,9 @@ fclose($fh); $filename = $_FILES['rootcert_import']['name']; $view = new \OC\Files\View('/'.\OCP\User::getUser().'/files_external/uploads'); -if (!$view->file_exists('')) $view->mkdir(''); +if (!$view->file_exists('')){ + $view->mkdir(''); +} $isValid = openssl_pkey_get_public($data); @@ -29,8 +31,10 @@ if ( $isValid ) { $view->file_put_contents($filename, $data); OC_Mount_Config::createCertificateBundle(); } else { - OCP\Util::writeLog("files_external", "Couldn't import SSL root certificate ($filename), allowed formats: PEM and DER", OCP\Util::WARN); + OCP\Util::writeLog('files_external', + 'Couldn\'t import SSL root certificate ('.$filename.'), allowed formats: PEM and DER', + OCP\Util::WARN); } -header("Location: settings/personal.php"); +header('Location: settings/personal.php'); exit; diff --git a/apps/files_external/ajax/dropbox.php b/apps/files_external/ajax/dropbox.php index f5923940dc9..58c41d69062 100644 --- a/apps/files_external/ajax/dropbox.php +++ b/apps/files_external/ajax/dropbox.php @@ -16,9 +16,13 @@ if (isset($_POST['app_key']) && isset($_POST['app_secret'])) { $callback = null; } $token = $oauth->getRequestToken(); - OCP\JSON::success(array('data' => array('url' => $oauth->getAuthorizeUrl($callback), 'request_token' => $token['token'], 'request_token_secret' => $token['token_secret']))); + OCP\JSON::success(array('data' => array('url' => $oauth->getAuthorizeUrl($callback), + 'request_token' => $token['token'], + 'request_token_secret' => $token['token_secret']))); } catch (Exception $exception) { - OCP\JSON::error(array('data' => array('message' => 'Fetching request tokens failed. Verify that your Dropbox app key and secret are correct.'))); + OCP\JSON::error(array('data' => array('message' => + 'Fetching request tokens failed. Verify that your Dropbox app key and secret are correct.') + )); } break; case 2: @@ -26,9 +30,12 @@ if (isset($_POST['app_key']) && isset($_POST['app_secret'])) { try { $oauth->setToken($_POST['request_token'], $_POST['request_token_secret']); $token = $oauth->getAccessToken(); - OCP\JSON::success(array('access_token' => $token['token'], 'access_token_secret' => $token['token_secret'])); + OCP\JSON::success(array('access_token' => $token['token'], + 'access_token_secret' => $token['token_secret'])); } catch (Exception $exception) { - OCP\JSON::error(array('data' => array('message' => 'Fetching access tokens failed. Verify that your Dropbox app key and secret are correct.'))); + OCP\JSON::error(array('data' => array('message' => + 'Fetching access tokens failed. Verify that your Dropbox app key and secret are correct.') + )); } } break; diff --git a/apps/files_external/ajax/google.php b/apps/files_external/ajax/google.php index 4cd01c06cc9..c76c7618e4d 100644 --- a/apps/files_external/ajax/google.php +++ b/apps/files_external/ajax/google.php @@ -14,7 +14,9 @@ if (isset($_POST['step'])) { } else { $callback = null; } - $scope = 'https://docs.google.com/feeds/ https://docs.googleusercontent.com/ https://spreadsheets.google.com/feeds/'; + $scope = 'https://docs.google.com/feeds/' + .' https://docs.googleusercontent.com/' + .' https://spreadsheets.google.com/feeds/'; $url = 'https://www.google.com/accounts/OAuthGetRequestToken?scope='.urlencode($scope); $params = array('scope' => $scope, 'oauth_callback' => $callback); $request = OAuthRequest::from_consumer_and_token($consumer, null, 'GET', $url, $params); @@ -24,24 +26,35 @@ if (isset($_POST['step'])) { parse_str($response, $token); if (isset($token['oauth_token']) && isset($token['oauth_token_secret'])) { $authUrl = 'https://www.google.com/accounts/OAuthAuthorizeToken?oauth_token='.$token['oauth_token']; - OCP\JSON::success(array('data' => array('url' => $authUrl, 'request_token' => $token['oauth_token'], 'request_token_secret' => $token['oauth_token_secret']))); + OCP\JSON::success(array('data' => array('url' => $authUrl, + 'request_token' => $token['oauth_token'], + 'request_token_secret' => $token['oauth_token_secret']))); } else { - OCP\JSON::error(array('data' => array('message' => 'Fetching request tokens failed. Error: '.$response))); + OCP\JSON::error(array('data' => array( + 'message' => 'Fetching request tokens failed. Error: '.$response + ))); } break; case 2: - if (isset($_POST['oauth_verifier']) && isset($_POST['request_token']) && isset($_POST['request_token_secret'])) { + if (isset($_POST['oauth_verifier']) + && isset($_POST['request_token']) + && isset($_POST['request_token_secret']) + ) { $token = new OAuthToken($_POST['request_token'], $_POST['request_token_secret']); $url = 'https://www.google.com/accounts/OAuthGetAccessToken'; - $request = OAuthRequest::from_consumer_and_token($consumer, $token, 'GET', $url, array('oauth_verifier' => $_POST['oauth_verifier'])); + $request = OAuthRequest::from_consumer_and_token($consumer, $token, 'GET', $url, + array('oauth_verifier' => $_POST['oauth_verifier'])); $request->sign_request($sigMethod, $consumer, $token); $response = send_signed_request('GET', $url, array($request->to_header()), null, false); $token = array(); parse_str($response, $token); if (isset($token['oauth_token']) && isset($token['oauth_token_secret'])) { - OCP\JSON::success(array('access_token' => $token['oauth_token'], 'access_token_secret' => $token['oauth_token_secret'])); + OCP\JSON::success(array('access_token' => $token['oauth_token'], + 'access_token_secret' => $token['oauth_token_secret'])); } else { - OCP\JSON::error(array('data' => array('message' => 'Fetching access tokens failed. Error: '.$response))); + OCP\JSON::error(array('data' => array( + 'message' => 'Fetching access tokens failed. Error: '.$response + ))); } } break; |