mirror of
https://github.com/EGroupware/egroupware.git
synced 2024-12-23 07:09:20 +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;
|
||||
|
||||
$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
|
||||
if (($share = static::$db->select(static::TABLE, '*', $extra+array(
|
||||
'share_path' => $path,
|
||||
@ -594,18 +597,19 @@ class Sharing
|
||||
* @param boolean $writable
|
||||
* @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));
|
||||
$extra = $extra + array(
|
||||
'share_writable' => $writable,
|
||||
'include_files' => $files
|
||||
);
|
||||
$share = $class::create(
|
||||
$path,
|
||||
$action == $writable ? Sharing::WRITABLE : Sharing::READONLY,
|
||||
$writable ? Sharing::WRITABLE : Sharing::READONLY,
|
||||
basename($path),
|
||||
array(),
|
||||
array(
|
||||
'share_writable' => $writable,
|
||||
'include_files' => $files
|
||||
)
|
||||
$extra
|
||||
);
|
||||
|
||||
// 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