mirror of
https://github.com/EGroupware/egroupware.git
synced 2025-02-17 02:41:02 +01:00
- Accept an extra array from ajax_create
- Filter extra array by db columns
This commit is contained in:
parent
289e6079f7
commit
9be59b55bf
@ -520,6 +520,9 @@ class Sharing
|
|||||||
|
|
||||||
if (empty($name)) $name = $path;
|
if (empty($name)) $name = $path;
|
||||||
|
|
||||||
|
$table_def = static::$db->get_table_definitions(false,static::TABLE);
|
||||||
|
$extra = array_intersect_key($extra, $table_def['fd']);
|
||||||
|
|
||||||
// check if file has been shared before, with identical attributes
|
// check if file has been shared before, with identical attributes
|
||||||
if (($share = static::$db->select(static::TABLE, '*', $extra+array(
|
if (($share = static::$db->select(static::TABLE, '*', $extra+array(
|
||||||
'share_path' => $path,
|
'share_path' => $path,
|
||||||
@ -594,18 +597,19 @@ class Sharing
|
|||||||
* @param boolean $writable
|
* @param boolean $writable
|
||||||
* @param boolean $files
|
* @param boolean $files
|
||||||
*/
|
*/
|
||||||
public static function ajax_create($action, $path, $writable = false, $files = false)
|
public static function ajax_create($action, $path, $writable = false, $files = false, $extra = array())
|
||||||
{
|
{
|
||||||
$class = self::get_share_class(array('share_path' => $path));
|
$class = self::get_share_class(array('share_path' => $path));
|
||||||
|
$extra = $extra + array(
|
||||||
|
'share_writable' => $writable,
|
||||||
|
'include_files' => $files
|
||||||
|
);
|
||||||
$share = $class::create(
|
$share = $class::create(
|
||||||
$path,
|
$path,
|
||||||
$action == $writable ? Sharing::WRITABLE : Sharing::READONLY,
|
$writable ? Sharing::WRITABLE : Sharing::READONLY,
|
||||||
basename($path),
|
basename($path),
|
||||||
array(),
|
array(),
|
||||||
array(
|
$extra
|
||||||
'share_writable' => $writable,
|
|
||||||
'include_files' => $files
|
|
||||||
)
|
|
||||||
);
|
);
|
||||||
|
|
||||||
// Store share in session so Merge can find this one and not create a read-only one
|
// Store share in session so Merge can find this one and not create a read-only one
|
||||||
|
Loading…
Reference in New Issue
Block a user