summaryrefslogtreecommitdiffstats
path: root/apps
diff options
context:
space:
mode:
authorRobin Appelman <icewind@owncloud.com>2014-08-15 17:18:46 +0200
committerRobin Appelman <icewind@owncloud.com>2014-08-31 10:47:50 +0200
commitc1b11571ea53748d57241598dec71750637416cd (patch)
treec823c19b77fe4aa62142299ffe5df6b6421be63a /apps
parent298011bf296a4eda62b787bb7c8fbfe30644d488 (diff)
downloadnextcloud-server-c1b11571ea53748d57241598dec71750637416cd.tar.gz
nextcloud-server-c1b11571ea53748d57241598dec71750637416cd.zip
Move certificate management interface from files_external to core
Diffstat (limited to 'apps')
-rw-r--r--apps/files_external/ajax/addRootCertificate.php25
-rw-r--r--apps/files_external/ajax/removeRootCertificate.php9
-rwxr-xr-xapps/files_external/personal.php2
-rw-r--r--apps/files_external/templates/settings.php27
4 files changed, 0 insertions, 63 deletions
diff --git a/apps/files_external/ajax/addRootCertificate.php b/apps/files_external/ajax/addRootCertificate.php
deleted file mode 100644
index 38b18605945..00000000000
--- a/apps/files_external/ajax/addRootCertificate.php
+++ /dev/null
@@ -1,25 +0,0 @@
-<?php
-
-OCP\JSON::checkAppEnabled('files_external');
-OCP\JSON::callCheck();
-
-if (!($filename = $_FILES['rootcert_import']['name'])) {
- header('Location:' . OCP\Util::linkToRoute("settings_personal"));
- exit;
-}
-
-$fh = fopen($_FILES['rootcert_import']['tmp_name'], 'r');
-$data = fread($fh, filesize($_FILES['rootcert_import']['tmp_name']));
-fclose($fh);
-$filename = $_FILES['rootcert_import']['name'];
-
-$certificateManager = \OC::$server->getCertificateManager();
-
-if (!$certificateManager->addCertificate($data, $filename)) {
- OCP\Util::writeLog('files_external',
- 'Couldn\'t import SSL root certificate (' . $filename . '), allowed formats: PEM and DER',
- OCP\Util::WARN);
-}
-
-header('Location:' . OCP\Util::linkToRoute("settings_personal"));
-exit;
diff --git a/apps/files_external/ajax/removeRootCertificate.php b/apps/files_external/ajax/removeRootCertificate.php
deleted file mode 100644
index 0931138ad4b..00000000000
--- a/apps/files_external/ajax/removeRootCertificate.php
+++ /dev/null
@@ -1,9 +0,0 @@
-<?php
-
-OCP\JSON::checkAppEnabled('files_external');
-OCP\JSON::checkLoggedIn();
-OCP\JSON::callCheck();
-
-$name = $_POST['cert'];
-$certificateManager = \OC::$server->getCertificateManager();
-$certificateManager->removeCertificate($name);
diff --git a/apps/files_external/personal.php b/apps/files_external/personal.php
index 9965303f21c..a279163ff70 100755
--- a/apps/files_external/personal.php
+++ b/apps/files_external/personal.php
@@ -23,12 +23,10 @@
OCP\Util::addScript('files_external', 'settings');
OCP\Util::addStyle('files_external', 'settings');
$backends = OC_Mount_Config::getPersonalBackends();
-$certificateManager = \OC::$server->getCertificateManager();
$tmpl = new OCP\Template('files_external', 'settings');
$tmpl->assign('isAdminPage', false);
$tmpl->assign('mounts', OC_Mount_Config::getPersonalMountPoints());
-$tmpl->assign('certs', $certificateManager->listCertificates());
$tmpl->assign('dependencies', OC_Mount_Config::checkDependencies());
$tmpl->assign('backends', $backends);
return $tmpl->fetchPage();
diff --git a/apps/files_external/templates/settings.php b/apps/files_external/templates/settings.php
index dd283f9ff55..072f856dfbd 100644
--- a/apps/files_external/templates/settings.php
+++ b/apps/files_external/templates/settings.php
@@ -119,30 +119,3 @@
</p>
<?php endif; ?>
</form>
-
-<?php if ( ! $_['isAdminPage']): ?>
-<form id="files_external" class="section"
- method="post"
- enctype="multipart/form-data"
- action="<?php p(OCP\Util::linkTo('files_external', 'ajax/addRootCertificate.php')); ?>">
- <h2><?php p($l->t('SSL root certificates'));?></h2>
- <table id="sslCertificate" data-admin='<?php print_unescaped(json_encode($_['isAdminPage'])); ?>'>
- <tbody>
- <?php foreach ($_['certs'] as $rootCert): ?>
- <tr id="<?php p($rootCert) ?>">
- <td class="rootCert"><?php p($rootCert) ?></td>
- <td <?php if ($rootCert != ''): ?>class="remove"
- <?php else: ?>style="visibility:hidden;"
- <?php endif; ?>><img alt="<?php p($l->t('Delete')); ?>"
- title="<?php p($l->t('Delete')); ?>"
- class="svg action"
- src="<?php print_unescaped(image_path('core', 'actions/delete.svg')); ?>" /></td>
- </tr>
- <?php endforeach; ?>
- </tbody>
- </table>
- <input type="hidden" name="requesttoken" value="<?php p($_['requesttoken']); ?>">
- <input type="file" id="rootcert_import" name="rootcert_import">
- <input type="submit" name="cert_import" value="<?php p($l->t('Import Root Certificate')); ?>" />
-</form>
-<?php endif; ?>