Blame view

sources/apps/files_external/ajax/addMountPoint.php 747 Bytes
03e52840d   Kload   Init
1
2
3
4
5
6
  <?php
  
  OCP\JSON::checkAppEnabled('files_external');
  OCP\JSON::callCheck();
  
  if ($_POST['isPersonal'] == 'true') {
6d9380f96   Cédric Dupont   Update sources OC...
7
  	OCP\JSON::checkLoggedIn();
03e52840d   Kload   Init
8
9
10
11
12
  	$isPersonal = true;
  } else {
  	OCP\JSON::checkAdminUser();
  	$isPersonal = false;
  }
6d9380f96   Cédric Dupont   Update sources OC...
13
14
15
16
17
18
19
20
21
22
23
24
25
  
  $mountPoint = $_POST['mountPoint'];
  $oldMountPoint = $_POST['oldMountPoint'];
  $class = $_POST['class'];
  $options = $_POST['classOptions'];
  $type = $_POST['mountType'];
  $applicable = $_POST['applicable'];
  
  if ($oldMountPoint and $oldMountPoint !== $mountPoint) {
  	OC_Mount_Config::removeMountPoint($oldMountPoint, $type, $applicable, $isPersonal);
  }
  
  $status = OC_Mount_Config::addMountPoint($mountPoint, $class, $options, $type, $applicable, $isPersonal);
31b7f2792   Kload   Upgrade to ownclo...
26
  OCP\JSON::success(array('data' => array('message' => $status)));