Blame view
sources/apps/files_external/ajax/addMountPoint.php
751 Bytes
|
03e52840d
|
1 2 3 |
<?php
OCP\JSON::checkAppEnabled('files_external');
|
|
837968727
|
4 |
OCP\JSON::checkLoggedIn(); |
|
03e52840d
|
5 6 7 |
OCP\JSON::callCheck();
if ($_POST['isPersonal'] == 'true') {
|
|
837968727
|
8 9 10 11 12 |
// Check whether the user has permissions to add personal storage backends
if(OCP\Config::getAppValue('files_external', 'allow_user_mounting', 'yes') !== 'yes') {
OCP\JSON::error(array('data' => array('message' => 'no permission')));
return;
}
|
|
03e52840d
|
13 14 15 16 17 18 19 20 21 22 23 |
$isPersonal = true;
} else {
OCP\JSON::checkAdminUser();
$isPersonal = false;
}
$status = OC_Mount_Config::addMountPoint($_POST['mountPoint'],
$_POST['class'],
$_POST['classOptions'],
$_POST['mountType'],
$_POST['applicable'],
$isPersonal);
|
|
31b7f2792
|
24 |
OCP\JSON::success(array('data' => array('message' => $status)));
|