phpBB API Documentation
Class

phpbb\auth\auth

class auth

Permission/Auth class

Properties

$acl
$cache
$acl_options
$acl_forum_ids

Methods

acl($userdata)

Init permissions

array obtain_user_data(int $user_id)

Retrieves data wanted by acl function from the database for the specified user.

_fill_acl($user_permissions)

Fill ACL array with relevant bitstrings from user_permissions column

acl_get($opt, $f)

Look up an option if the option is prefixed with !, then the result becomes negated

array acl_getf(string $opt, bool $clean = false)

Get forums with the specified permission setting

acl_getf_global($opt)

Get local permission state for any forum.

acl_gets()

Get permission settings (more than one)

acl_get_list($user_id = false, $opts = false, $forum_id = false)

Get permission listing based on userid/options/forumids

acl_cache($userdata)

Cache data to user_permissions row

build_bitstring($hold_ary)

Build bitstring from permission set

acl_clear_prefetch($user_id = false)

Clear one or all users cached permission settings

acl_role_data($user_type, $role_type, $ug_id = false, $forum_id = false)

Get assigned roles

acl_raw_data($user_id = false, $opts = false, $forum_id = false)

Get raw acl data based on user/option/forum

acl_user_raw_data($user_id = false, $opts = false, $forum_id = false)

Get raw user based permission settings

acl_group_raw_data($group_id = false, $opts = false, $forum_id = false)

Get raw group based permission settings

acl_raw_data_single_user($user_id)

Get raw acl data based on user for caching userpermissions This function returns the same data as aclraw_data(), but without the user id as the first key within the array.

_set_group_hold_ary($hold_ary, $option_id, $setting)

Private function snippet for setting a specific piece of the hold_ary

login($username, $password, $autologin = false, $viewonline = 1, $admin)

Authentication plug-ins is largely down to Sergey Kanareykin, our thanks to him.

build_auth_option_statement($key, $auth_options, $sql_opts)

Fill auth_option statement for later querying based on the supplied options

Details

at line 29
public acl($userdata)

Init permissions

Parameters

$userdata

at line 109
public array obtain_user_data(int $user_id)

Retrieves data wanted by acl function from the database for the specified user.

Parameters

int $user_id User ID

Return Value

array User attributes

at line 126
public _fill_acl($user_permissions)

Fill ACL array with relevant bitstrings from user_permissions column

Parameters

$user_permissions

at line 169
public acl_get($opt, $f)

Look up an option if the option is prefixed with !, then the result becomes negated

If a forum id is specified the local option will be combined with a global option if one exist. If a forum id is not specified, only the global option will be checked.

Parameters

$opt
$f

at line 218
public array acl_getf(string $opt, bool $clean = false)

Get forums with the specified permission setting

Parameters

string $opt The permission name to lookup. If prefixed with !, the result is negated.
bool $clean set to true if only values needs to be returned which are set/unset

Return Value

array Contains the forum ids with the specified permission set to true. This is a nested array: array => forum_id => permission => true

at line 299
public acl_getf_global($opt)

Get local permission state for any forum.

Returns true if user has the permission in one or more forums, false if in no forum. If global option is checked it returns the global state (same as acl_get($opt)) Local option has precedence...

Parameters

$opt

at line 343
public acl_gets()

Get permission settings (more than one)

at line 380
public acl_get_list($user_id = false, $opts = false, $forum_id = false)

Get permission listing based on userid/options/forumids

Be careful when using this function with permissions a_, m_, u_ and f_ ! It may not work correctly. When a user group grants an a* permission, e.g. afoo, but the user's afoo permission is set to "Never", then the user does not in fact have the a permission. But the user will still be listed as having the a_ permission.

For more information see: http://tracker.phpbb.com/browse/PHPBB3-10252

Parameters

$user_id
$opts
$forum_id

at line 412
public acl_cache($userdata)

Cache data to user_permissions row

Parameters

$userdata

at line 454
public build_bitstring($hold_ary)

Build bitstring from permission set

Parameters

$hold_ary

at line 515
public acl_clear_prefetch($user_id = false)

Clear one or all users cached permission settings

Parameters

$user_id

at line 572
public acl_role_data($user_type, $role_type, $ug_id = false, $forum_id = false)

Get assigned roles

Parameters

$user_type
$role_type
$ug_id
$forum_id

at line 605
public acl_raw_data($user_id = false, $opts = false, $forum_id = false)

Get raw acl data based on user/option/forum

Parameters

$user_id
$opts
$forum_id

at line 721
public acl_user_raw_data($user_id = false, $opts = false, $forum_id = false)

Get raw user based permission settings

Parameters

$user_id
$opts
$forum_id

at line 773
public acl_group_raw_data($group_id = false, $opts = false, $forum_id = false)

Get raw group based permission settings

Parameters

$group_id
$opts
$forum_id

at line 826
public acl_raw_data_single_user($user_id)

Get raw acl data based on user for caching userpermissions This function returns the same data as aclraw_data(), but without the user id as the first key within the array.

Parameters

$user_id

at line 909
public _set_group_hold_ary($hold_ary, $option_id, $setting)

Private function snippet for setting a specific piece of the hold_ary

Parameters

$hold_ary
$option_id
$setting

at line 938
public login($username, $password, $autologin = false, $viewonline = 1, $admin)

Authentication plug-ins is largely down to Sergey Kanareykin, our thanks to him.

Parameters

$username
$password
$autologin
$viewonline
$admin

at line 1070
public build_auth_option_statement($key, $auth_options, $sql_opts)

Fill auth_option statement for later querying based on the supplied options

Parameters

$key
$auth_options
$sql_opts