diff options
author | Bart Visscher <bartv@thisnet.nl> | 2012-10-14 21:04:08 +0200 |
---|---|---|
committer | Bart Visscher <bartv@thisnet.nl> | 2012-10-14 21:04:08 +0200 |
commit | 4af5b016cc0bb4e5f7e73a50d38e16d3c539bf5f (patch) | |
tree | 04ea8615a228fb252473bef72eb8b763e558ea80 /apps/files_external/ajax | |
parent | 2c427f050e2bc263b5c4c2faabf73e3993f1d29d (diff) | |
download | nextcloud-server-4af5b016cc0bb4e5f7e73a50d38e16d3c539bf5f.tar.gz nextcloud-server-4af5b016cc0bb4e5f7e73a50d38e16d3c539bf5f.zip |
Whitespace cleanup
Diffstat (limited to 'apps/files_external/ajax')
-rw-r--r-- | apps/files_external/ajax/addRootCertificate.php | 12 | ||||
-rw-r--r-- | apps/files_external/ajax/removeRootCertificate.php | 1 |
2 files changed, 6 insertions, 7 deletions
diff --git a/apps/files_external/ajax/addRootCertificate.php b/apps/files_external/ajax/addRootCertificate.php index e0a0239c954..72eb30009d1 100644 --- a/apps/files_external/ajax/addRootCertificate.php +++ b/apps/files_external/ajax/addRootCertificate.php @@ -3,23 +3,23 @@ OCP\JSON::checkAppEnabled('files_external'); if ( !($filename = $_FILES['rootcert_import']['name']) ) { - header("Location: settings/personal.php");
+ header("Location: settings/personal.php"); exit; } -$fh = fopen($_FILES['rootcert_import']['tmp_name'], 'r');
-$data = fread($fh, filesize($_FILES['rootcert_import']['tmp_name']));
+$fh = fopen($_FILES['rootcert_import']['tmp_name'], 'r'); +$data = fread($fh, filesize($_FILES['rootcert_import']['tmp_name'])); fclose($fh); $filename = $_FILES['rootcert_import']['name']; -
-$view = new \OC_FilesystemView('/'.\OCP\User::getUser().'/files_external/uploads');
+ +$view = new \OC_FilesystemView('/'.\OCP\User::getUser().'/files_external/uploads'); if (!$view->file_exists('')) $view->mkdir(''); $isValid = openssl_pkey_get_public($data); //maybe it was just the wrong file format, try to convert it... if ($isValid == false) { - $data = chunk_split(base64_encode($data), 64, "\n");
+ $data = chunk_split(base64_encode($data), 64, "\n"); $data = "-----BEGIN CERTIFICATE-----\n".$data."-----END CERTIFICATE-----\n"; $isValid = openssl_pkey_get_public($data); } diff --git a/apps/files_external/ajax/removeRootCertificate.php b/apps/files_external/ajax/removeRootCertificate.php index 6871b0fd1d4..664b3937e97 100644 --- a/apps/files_external/ajax/removeRootCertificate.php +++ b/apps/files_external/ajax/removeRootCertificate.php @@ -11,4 +11,3 @@ if ( $view->file_exists($file) ) { $view->unlink($file); OC_Mount_Config::createCertificateBundle(); } - |