2011-07-20 17:34:16 +00:00
|
|
|
<?php
|
|
|
|
$RUNTIME_NOAPPS = true;
|
|
|
|
|
|
|
|
require_once('../../../lib/base.php');
|
|
|
|
require_once('../lib_share.php');
|
|
|
|
|
2011-08-01 00:47:53 +00:00
|
|
|
$sources = explode(";", $_POST['sources']);
|
|
|
|
$uid_shared_with = $_POST['uid_shared_with'];
|
|
|
|
$permissions = $_POST['permissions'];
|
2011-07-28 19:31:52 +00:00
|
|
|
foreach ($sources as $source) {
|
2011-08-12 21:22:32 +00:00
|
|
|
if ($source && OC_FILESYSTEM::file_exists($source) && OC_FILESYSTEM::is_readable($source)) {
|
|
|
|
$source = "/".OC_User::getUser()."/files".$source;
|
|
|
|
try {
|
2011-08-13 00:49:44 +00:00
|
|
|
if (OC_Group::groupExists($uid_shared_with)) {
|
|
|
|
new OC_Share($source, $uid_shared_with, $permissions, true);
|
|
|
|
} else {
|
|
|
|
new OC_Share($source, $uid_shared_with, $permissions);
|
|
|
|
}
|
2011-08-12 21:22:32 +00:00
|
|
|
} catch (Exception $exception) {
|
|
|
|
echo "false";
|
|
|
|
}
|
|
|
|
}
|
2011-07-28 19:31:52 +00:00
|
|
|
}
|
2011-07-20 17:34:16 +00:00
|
|
|
|
|
|
|
?>
|