mirror of
https://github.com/Piwigo/Piwigo.git
synced 2026-08-07 09:13:02 +02:00
fixes #1361 check related albums against permissions
This commit is contained in:
@@ -661,7 +661,7 @@ SELECT id
|
|||||||
* @param int[] $excluded_cat_ids
|
* @param int[] $excluded_cat_ids
|
||||||
* @return array [id, name, counter, url_name]
|
* @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))
|
if (empty($items))
|
||||||
{
|
{
|
||||||
@@ -677,6 +677,16 @@ SELECT
|
|||||||
INNER JOIN '.CATEGORIES_TABLE.' c ON category_id = id
|
INNER JOIN '.CATEGORIES_TABLE.' c ON category_id = id
|
||||||
WHERE image_id IN ('.implode(',', $items).')';
|
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))
|
if (!empty($excluded_cat_ids))
|
||||||
{
|
{
|
||||||
$query.='
|
$query.='
|
||||||
|
|||||||
Reference in New Issue
Block a user