summaryrefslogtreecommitdiffstats
path: root/apps/files_external/ajax/removeRootCertificate.php
diff options
context:
space:
mode:
Diffstat (limited to 'apps/files_external/ajax/removeRootCertificate.php')
-rw-r--r--apps/files_external/ajax/removeRootCertificate.php10
1 files changed, 4 insertions, 6 deletions
diff --git a/apps/files_external/ajax/removeRootCertificate.php b/apps/files_external/ajax/removeRootCertificate.php
index 664b3937e97..e6795800e03 100644
--- a/apps/files_external/ajax/removeRootCertificate.php
+++ b/apps/files_external/ajax/removeRootCertificate.php
@@ -4,10 +4,8 @@ OCP\JSON::checkAppEnabled('files_external');
OCP\JSON::checkLoggedIn();
OCP\JSON::callCheck();
-$view = \OCP\Files::getStorage("files_external");
-$file = 'uploads/'.ltrim($_POST['cert'], "/\\.");
-
-if ( $view->file_exists($file) ) {
- $view->unlink($file);
- OC_Mount_Config::createCertificateBundle();
+$name = $_POST['cert'];
+$certificateManager = \OC::$server->getCertificateManager();
+if (\OC\Files\Filesystem::isValidPath($name)) {
+ $certificateManager->removeCertificate($name);
}