aboutsummaryrefslogtreecommitdiffstats
path: root/admin/include
diff options
context:
space:
mode:
authorvdigital <vdigital@piwigo.org>2008-10-19 15:37:43 +0000
committervdigital <vdigital@piwigo.org>2008-10-19 15:37:43 +0000
commitaa1a71488f556c24eac6171dbde569faea3faeaf (patch)
treec1c76e2ab6431b9e90fdb90375770af6dcfed68a /admin/include
parenta48c2e52816441e40d69bfd145813c2cd2d056af (diff)
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/branches/2.0@2776 68402e56-0260-453c-a942-63ccdbb3a9ee
Diffstat (limited to 'admin/include')
-rw-r--r--admin/include/functions.php23
1 files changed, 23 insertions, 0 deletions
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