From a6be0e500b91696013b1580915c21493ce6c39b1 Mon Sep 17 00:00:00 2001 From: vdigital Date: Sun, 19 Oct 2008 15:47:34 +0000 Subject: Merging revisions 2773-2776 - Default template and Piwigo domain ... - No metadata synchronization icon on a remote picture (Synchro failure) - Jump to category icon is removed on user forbidden categories (previously check_restrictions was leading administrators to the access denied page). git-svn-id: http://piwigo.org/svn/trunk@2777 68402e56-0260-453c-a942-63ccdbb3a9ee --- admin/cat_modify.php | 1 + admin/include/functions.php | 23 +++++++++++++++++++++++ admin/template/goto/cat_list.tpl | 2 ++ admin/template/goto/cat_modify.tpl | 2 ++ admin/template/goto/picture_modify.tpl | 2 ++ 5 files changed, 30 insertions(+) (limited to 'admin') diff --git a/admin/cat_modify.php b/admin/cat_modify.php index 4a385217d..b0876ecb8 100644 --- a/admin/cat_modify.php +++ b/admin/cat_modify.php @@ -235,6 +235,7 @@ if (!empty($category['id_uppercat'])) $template->assign( array( 'CATEGORIES_NAV' => $navigation, + 'CAT_ID' => $category['id'], 'CAT_NAME' => @htmlspecialchars($category['name']), 'CAT_COMMENT' => @htmlspecialchars($category['comment']), diff --git a/admin/include/functions.php b/admin/include/functions.php index 4b0713226..658033e0c 100644 --- a/admin/include/functions.php +++ b/admin/include/functions.php @@ -1899,4 +1899,27 @@ SELECT id ); } } + +/** + * Is the category accessible to the (Admin) user ? + * + * Note : if the user is not authorized to see this category, category jump + * will be replaced by admin cat_modify page + * + * @param int category id to verify + * @return bool + */ +function cat_admin_access($category_id) +{ + global $user; + + // $filter['visible_categories'] and $filter['visible_images'] + // are not used because it's not necessary (filter <> restriction) + if (in_array($category_id, explode(',', $user['forbidden_categories']))) + { + return false; + } + return true; +} + ?> \ No newline at end of file diff --git a/admin/template/goto/cat_list.tpl b/admin/template/goto/cat_list.tpl index 4bf158baf..9f26e1f9c 100644 --- a/admin/template/goto/cat_list.tpl +++ b/admin/template/goto/cat_list.tpl @@ -48,7 +48,9 @@