aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorrvelices <rv-github@modusoptimus.com>2011-07-25 18:06:48 +0000
committerrvelices <rv-github@modusoptimus.com>2011-07-25 18:06:48 +0000
commite83a606ea3dc18c9a599794a3c59e025012bbd52 (patch)
tree65e171e2c62d35ff0cd5691db17f5943d9132c10
parent4e4dc79e5162a7d1315b12e94153443552530b9e (diff)
partially revert one of my previous commits where I removed an obsolete function (was used directly in the tpls:-( )
git-svn-id: http://piwigo.org/svn/trunk@11828 68402e56-0260-453c-a942-63ccdbb3a9ee
-rw-r--r--admin/include/functions.php21
1 files changed, 21 insertions, 0 deletions
diff --git a/admin/include/functions.php b/admin/include/functions.php
index 2c9c9df39..afd6c7eaf 100644
--- a/admin/include/functions.php
+++ b/admin/include/functions.php
@@ -1721,6 +1721,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;
+}
/**
* Retrieve data from external URL