From e29e0e5018ee0f783ad8d5b8a6a93fec1d5800b3 Mon Sep 17 00:00:00 2001
From: Cesar G This is an explanation of how to use the phpBB auth/acl API This is an explanation of how to use the phpBB auth/acl API. This is an explanation of how to use the phpBB auth/acl API. To use any methods contained with the Once an instance of the class has been created you are free to call the various methods it contains. Please note that should you wish to use the The Where userdata is the array containing the aforementioned data. This method is the primary way of determining what a user can and cannot do for a given option globally or in a given forum. The method should be called in the following way: Where option is a string representing the required option, e.g. 'f_list', 'm_edit', 'a_adduser', etc. By adding a ! in front of the option, e.g. '!f_list' the result of this method will be negated. The optional forum term is the integer forum_id. The method should be called thus: As with the This method is used to find out in which forums a user is allowed to carry out an operation or to find out in which forums he is not allowed to carry out an operation. The method should be called in the following way: Just like in the The method returns an associative array of the form: Where option is the option passed to the method and integer is either zero or a positive integer and the same Auth API
@@ -73,7 +73,7 @@
1. Introduction
@@ -103,7 +103,7 @@ $auth = new phpbb\auth\auth();
2. Methods
@@ -238,7 +238,7 @@ $result = $auth->acl_get_list($user_id, $permissions, $forum_id);
3. Admin related functions
@@ -264,7 +264,7 @@ $auth_admin = new auth_admin();
4. Copyright and disclaimer
+
Auth API
Auth API
--
cgit v1.2.1
From 4df853abccd48d89e1dfce6dfc1a0b9c5a34c7ee Mon Sep 17 00:00:00 2001
From: Cesar G auth
class it first needs to be instantiated. This is best achieved early in the execution of the script in the following manner:
-$auth = new phpbb\auth\auth();
-
auth_admin
methods you will need to instantiate this separately but in the same way.acl
method is the initialisation routine for all the acl functions. If you intend calling any acl method you must first call this. The method takes as its one and only required parameter an associative array containing user information as stored in the database. This array must contain at least the following information; user_id, user_permissions and user_type. It is called in the following way:
-$auth->acl(
userdata
);
- userdata
);
+ userdata
);
-$result = $auth->acl_get(
option
[, forum
]);
- option
[, forum
]);
+ option
[, forum
]);
-$result = $auth->acl_gets(
option1
[, option2
, ..., optionN
, forum
]);
- option1
[, option2
, ..., optionN
, forum
]);
+ acl_get
method the options are strings representing the required permissions to check. The forum again is an integer representing a given forum_id.option1
[, option2
, ..., <
-$result = $auth->acl_getf(
option
[, clean
]);
- option
[, clean
]);
+ acl_get
method the option is a string specifying the permission which has to be checked (negation using ! is allowed). The second parameter is a boolean. If it is set to false this method returns all forums with either zero or a positive integer. If it is set to true only those forums with a positive integer as the result will be returned.
-array(forum_id1 => array(option => integer), forum_id2 => ...)
-
acl_get(option, forum_id)
would return.acl_getf(option, true)
returned one or more forums but it's faster. It should be called in the following way:
-$result = $auth->acl_getf_global(option
)
-
option
)
+
As with the previous methods option is a string specifying the permission which has to be checked.
@@ -247,8 +247,8 @@ $result = $auth->acl_get_list($user_id, $permissions, $forum_id);To use any methods this class contains it first needs to be instantiated separately from auth
. This is achieved in the same way as auth
:
-$auth_admin = new auth_admin(); -
This instance gives you access to both the methods of this specific class and that of auth
.