mirror of
https://github.com/Piwigo/Piwigo.git
synced 2026-03-28 17:42:57 +01:00
fixes #1182 with inheritance_by_default, copy only permissions from parents and do not add admins
This commit is contained in:
@@ -1571,7 +1571,7 @@ SELECT id, uppercats, global_rank, visible, status
|
||||
WHERE cat_id = '.$insert['id_uppercat'].'
|
||||
;';
|
||||
$granted_users = query2array($query, null, 'user_id');
|
||||
add_permission_on_category($inserted_id, array_unique(array_merge(get_admins(), array($user['id']), $granted_users)));
|
||||
add_permission_on_category($inserted_id, $granted_users);
|
||||
}
|
||||
elseif ('private' == $insert['status'])
|
||||
{
|
||||
|
||||
@@ -314,7 +314,7 @@ SELECT id_uppercat, MAX(`rank`)+1 AS next_rank
|
||||
pwg_activity('album', $category_ids, 'add', array('sync'=>true));
|
||||
|
||||
$category_up=implode(',',array_unique($category_up));
|
||||
if ($conf['inheritance_by_default'])
|
||||
if ($conf['inheritance_by_default'] and !empty($category_up))
|
||||
{
|
||||
$query = '
|
||||
SELECT *
|
||||
@@ -395,13 +395,6 @@ SELECT id_uppercat, MAX(`rank`)+1 AS next_rank
|
||||
);
|
||||
}
|
||||
}
|
||||
foreach (get_admins() as $granted_user)
|
||||
{
|
||||
$insert_granted_users[] = array(
|
||||
'user_id' => $granted_user,
|
||||
'cat_id' => $ids
|
||||
);
|
||||
}
|
||||
}
|
||||
}
|
||||
mass_inserts(GROUP_ACCESS_TABLE, array('group_id','cat_id'), $insert_granted_grps);
|
||||
|
||||
Reference in New Issue
Block a user