summaryrefslogtreecommitdiffstats
path: root/apps/files_external/ajax
diff options
context:
space:
mode:
authorJörn Friedrich Dreyer <jfd@butonic.de>2012-11-30 16:27:11 +0100
committerJörn Friedrich Dreyer <jfd@butonic.de>2012-11-30 16:27:11 +0100
commit92df70b6e5c4cba373cf0b24af02c328881cdd2d (patch)
treecaa914884d58cb9118330c3823c4525c7dfd65cf /apps/files_external/ajax
parentdf21ebeaf73bed10e972af6ef09f2bfb0df68e1c (diff)
downloadnextcloud-server-92df70b6e5c4cba373cf0b24af02c328881cdd2d.tar.gz
nextcloud-server-92df70b6e5c4cba373cf0b24af02c328881cdd2d.zip
fix checkstyle for files_external app, add whitespace for readability
Diffstat (limited to 'apps/files_external/ajax')
-rw-r--r--apps/files_external/ajax/addMountPoint.php7
-rw-r--r--apps/files_external/ajax/addRootCertificate.php10
-rw-r--r--apps/files_external/ajax/dropbox.php15
-rw-r--r--apps/files_external/ajax/google.php27
4 files changed, 43 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 72eb30009d1..be60b415e1b 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,7 @@ fclose($fh);
$filename = $_FILES['rootcert_import']['name'];
$view = new \OC_FilesystemView('/'.\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 +29,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;