mirror of
https://github.com/Piwigo/Piwigo.git
synced 2026-03-28 17:42:57 +01:00
fixes #1361 check related albums against permissions
This commit is contained in:
@@ -661,7 +661,7 @@ SELECT id
|
||||
* @param int[] $excluded_cat_ids
|
||||
* @return array [id, name, counter, url_name]
|
||||
*/
|
||||
function get_common_categories($items, $max=null, $excluded_cat_ids=array())
|
||||
function get_common_categories($items, $max=null, $excluded_cat_ids=array(), $use_permissions=true)
|
||||
{
|
||||
if (empty($items))
|
||||
{
|
||||
@@ -677,6 +677,16 @@ SELECT
|
||||
INNER JOIN '.CATEGORIES_TABLE.' c ON category_id = id
|
||||
WHERE image_id IN ('.implode(',', $items).')';
|
||||
|
||||
if ($use_permissions)
|
||||
{
|
||||
$query.= get_sql_condition_FandF(
|
||||
array(
|
||||
'forbidden_categories' => 'category_id',
|
||||
),
|
||||
"\n AND"
|
||||
);
|
||||
}
|
||||
|
||||
if (!empty($excluded_cat_ids))
|
||||
{
|
||||
$query.='
|
||||
|
||||
Reference in New Issue
Block a user