Merge pull request #1636 from owncloud/fixing-smb-master
Fixing smb master
This commit is contained in:
commit
2507e0da1d
|
@ -3,6 +3,15 @@
|
||||||
OCP\JSON::checkAppEnabled('files_external');
|
OCP\JSON::checkAppEnabled('files_external');
|
||||||
OCP\JSON::callCheck();
|
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') {
|
if ($_POST['isPersonal'] == 'true') {
|
||||||
OCP\JSON::checkLoggedIn();
|
OCP\JSON::checkLoggedIn();
|
||||||
$isPersonal = true;
|
$isPersonal = true;
|
||||||
|
@ -10,4 +19,5 @@ if ($_POST['isPersonal'] == 'true') {
|
||||||
OCP\JSON::checkAdminUser();
|
OCP\JSON::checkAdminUser();
|
||||||
$isPersonal = false;
|
$isPersonal = false;
|
||||||
}
|
}
|
||||||
|
|
||||||
OC_Mount_Config::removeMountPoint($_POST['mountPoint'], $_POST['mountType'], $_POST['applicable'], $isPersonal);
|
OC_Mount_Config::removeMountPoint($_POST['mountPoint'], $_POST['mountType'], $_POST['applicable'], $isPersonal);
|
||||||
|
|
|
@ -45,6 +45,7 @@ class SMB extends \OC\Files\Storage\StreamWrapper{
|
||||||
if (substr($path, -1)=='/') {
|
if (substr($path, -1)=='/') {
|
||||||
$path=substr($path, 0, -1);
|
$path=substr($path, 0, -1);
|
||||||
}
|
}
|
||||||
|
$path = urlencode($path);
|
||||||
return 'smb://'.$this->user.':'.$this->password.'@'.$this->host.$this->share.$this->root.$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
|
* check if a file or folder has been updated since $time
|
||||||
* @param string $path
|
* @param string $path
|
||||||
|
|
|
@ -83,7 +83,7 @@
|
||||||
<select class="chzn-select"
|
<select class="chzn-select"
|
||||||
multiple style="width:20em;"
|
multiple style="width:20em;"
|
||||||
data-placeholder="<?php echo $l->t('None set'); ?>">
|
data-placeholder="<?php echo $l->t('None set'); ?>">
|
||||||
<option value="all"><?php echo $l->t('All Users'); ?></option>
|
<option value="all" <?php if (isset($mount['applicable']['users']) && in_array('all', $mount['applicable']['users'])) echo 'selected="selected"';?> ><?php echo $l->t('All Users'); ?></option>
|
||||||
<optgroup label="<?php echo $l->t('Groups'); ?>">
|
<optgroup label="<?php echo $l->t('Groups'); ?>">
|
||||||
<?php foreach ($_['groups'] as $group): ?>
|
<?php foreach ($_['groups'] as $group): ?>
|
||||||
<option value="<?php echo $group; ?>(group)"
|
<option value="<?php echo $group; ?>(group)"
|
||||||
|
|
Loading…
Reference in New Issue