summaryrefslogtreecommitdiff
path: root/inc/auth.php
diff options
context:
space:
mode:
authorAnika Henke <anika@selfthinker.org>2014-02-02 14:43:06 +0000
committerAnika Henke <anika@selfthinker.org>2014-02-02 14:43:06 +0000
commita051c2744a397f5ccbb688e0edab307451dc522d (patch)
treed9744944e50f2c23df22bd6856779bd228e129c4 /inc/auth.php
parent3641199a253e8f92f378f03926af80724ef04146 (diff)
parenta8895ef5de970d5e6b1e273c3fe111b606611244 (diff)
downloadrpg-a051c2744a397f5ccbb688e0edab307451dc522d.tar.gz
rpg-a051c2744a397f5ccbb688e0edab307451dc522d.tar.bz2
Merge remote-tracking branch 'origin/master' into video-audio
Diffstat (limited to 'inc/auth.php')
-rw-r--r--inc/auth.php28
1 files changed, 25 insertions, 3 deletions
diff --git a/inc/auth.php b/inc/auth.php
index b793f5d12..6000ea6d7 100644
--- a/inc/auth.php
+++ b/inc/auth.php
@@ -661,17 +661,39 @@ function auth_quickaclcheck($id) {
}
/**
- * Returns the maximum rights a user has for
- * the given ID or its namespace
+ * Returns the maximum rights a user has for the given ID or its namespace
*
* @author Andreas Gohr <andi@splitbrain.org>
- *
+ * @triggers AUTH_ACL_CHECK
* @param string $id page ID (needs to be resolved and cleaned)
* @param string $user Username
* @param array|null $groups Array of groups the user is in
* @return int permission level
*/
function auth_aclcheck($id, $user, $groups) {
+ $data = array(
+ 'id' => $id,
+ 'user' => $user,
+ 'groups' => $groups
+ );
+
+ return trigger_event('AUTH_ACL_CHECK', $data, 'auth_aclcheck_cb');
+}
+
+/**
+ * default ACL check method
+ *
+ * DO NOT CALL DIRECTLY, use auth_aclcheck() instead
+ *
+ * @author Andreas Gohr <andi@splitbrain.org>
+ * @param array $data event data
+ * @return int permission level
+ */
+function auth_aclcheck_cb($data) {
+ $id =& $data['id'];
+ $user =& $data['user'];
+ $groups =& $data['groups'];
+
global $conf;
global $AUTH_ACL;
/* @var DokuWiki_Auth_Plugin $auth */