mirror of
https://github.com/nextcloud/server.git
synced 2026-06-10 17:23:59 -04:00
Fix removing personal mounts
This commit is contained in:
parent
b650f46698
commit
618a3c1d94
1 changed files with 8 additions and 3 deletions
|
|
@ -157,12 +157,17 @@ class OC_Mount_Config {
|
|||
*/
|
||||
public static function removeMountPoint($mountPoint, $mountType, $applicable, $isPersonal = false) {
|
||||
// Verify that the mount point applies for the current user
|
||||
if ($isPersonal && $applicable != OCP\User::getUser()) {
|
||||
return false;
|
||||
if ($isPersonal) {
|
||||
if ($applicable != OCP\User::getUser()) {
|
||||
return false;
|
||||
}
|
||||
$mountPoint = '/'.$applicable.'/files/'.ltrim($mountPoint, '/');
|
||||
} else {
|
||||
$mountPoint = '/$user/files/'.ltrim($mountPoint, '/');
|
||||
}
|
||||
$mountPoints = self::readData($isPersonal);
|
||||
// Remove mount point
|
||||
unset($mountPoints[$mountType][$applicable]['/$user/files/'.$mountPoint]);
|
||||
unset($mountPoints[$mountType][$applicable][$mountPoint]);
|
||||
// Unset parent arrays if empty
|
||||
if (empty($mountPoints[$mountType][$applicable])) {
|
||||
unset($mountPoints[$mountType][$applicable]);
|
||||
|
|
|
|||
Loading…
Reference in a new issue