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