diff --git a/apps/files_external/ajax/removeMountPoint.php b/apps/files_external/ajax/removeMountPoint.php index aa44642620..2f5dbcfdba 100644 --- a/apps/files_external/ajax/removeMountPoint.php +++ b/apps/files_external/ajax/removeMountPoint.php @@ -3,6 +3,15 @@ OCP\JSON::checkAppEnabled('files_external'); OCP\JSON::callCheck(); +if (!isset($_POST['isPersonal'])) + return; +if (!isset($_POST['mountPoint'])) + return; +if (!isset($_POST['mountType'])) + return; +if (!isset($_POST['applicable'])) + return; + if ($_POST['isPersonal'] == 'true') { OCP\JSON::checkLoggedIn(); $isPersonal = true; @@ -10,4 +19,5 @@ if ($_POST['isPersonal'] == 'true') { OCP\JSON::checkAdminUser(); $isPersonal = false; } + OC_Mount_Config::removeMountPoint($_POST['mountPoint'], $_POST['mountType'], $_POST['applicable'], $isPersonal); diff --git a/apps/files_external/lib/smb.php b/apps/files_external/lib/smb.php index 96778b0b2e..e17ce1168d 100644 --- a/apps/files_external/lib/smb.php +++ b/apps/files_external/lib/smb.php @@ -45,6 +45,7 @@ class SMB extends \OC\Files\Storage\StreamWrapper{ if (substr($path, -1)=='/') { $path=substr($path, 0, -1); } + $path = urlencode($path); return 'smb://'.$this->user.':'.$this->password.'@'.$this->host.$this->share.$this->root.$path; } @@ -59,11 +60,6 @@ class SMB extends \OC\Files\Storage\StreamWrapper{ } } - public function filetype($path) { - // using opendir causes the same amount of requests and caches the content of the folder in one go - return (bool)@$this->opendir($path) ? 'dir' : 'file'; - } - /** * check if a file or folder has been updated since $time * @param string $path diff --git a/apps/files_external/templates/settings.php b/apps/files_external/templates/settings.php index 78ca1c87fe..df8d7d6e2b 100644 --- a/apps/files_external/templates/settings.php +++ b/apps/files_external/templates/settings.php @@ -83,7 +83,7 @@