class auth_admin extends auth

ACP Permission/Auth class

Properties

$acl from  auth
$cache from  auth
$acl_options from  auth
$acl_forum_ids from  auth

Methods

acl($userdata)

Init permissions

from  auth
array
obtain_user_data(int $user_id)

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

from  auth
acl_get($opt, $f = 0)

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

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

Get forums with the specified permission setting

from  auth
acl_getf_global($opt)

Get local permission state for any forum.

from  auth
acl_gets()

Get permission settings (more than one)

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

Get permission listing based on user_id/options/forum_ids

from  auth
acl_cache($userdata)

Cache data to user_permissions row

from  auth
build_bitstring($hold_ary)

Build bitstring from permission set

from  auth
acl_clear_prefetch($user_id = false)

Clear one or all users cached permission settings

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

Get assigned roles

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

Get raw acl data based on user/option/forum

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

Get raw user based permission settings

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

Get raw group based permission settings

from  auth
acl_raw_data_single_user($user_id)

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

from  auth
_set_group_hold_ary($hold_ary, $option_id, $setting)

Private function snippet for setting a specific piece of the hold_ary

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

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

from  auth
build_auth_option_statement($key, $auth_options, $sql_opts)

Fill auth_option statement for later querying based on the supplied options

from  auth
__construct()

Init auth settings

get_mask(set|view $mode, mixed $user_id = false, mixed $group_id = false, mixed $forum_id = false, string $auth_option = false, local|global $scope = false, ACL_NEVER|ACL_NO|ACL_YES $acl_fill = ACL_NEVER)

Get permission mask This function only supports getting permissions of one type (for example a_)

get_role_mask($role_id)

Get permission mask for roles This function only supports getting masks for one role

display_mask($mode, $permission_type, $hold_ary, $user_mode = 'user', $local = false, $group_display = true)

Display permission mask (assign to template)

display_role_mask($hold_ary)

Display permission mask for roles

acl_add_option($options)

NOTE: this function is not in use atm Add a new option to the list ... $options is a hash of form -> $options = array( 'local' => array('option1', 'option2', ...), 'global' => array('optionA', 'optionB', ...) );

acl_set($ug_type, $forum_id, $ug_id, $auth, $role_id = 0, $clear_prefetch = true)

Set a user or group ACL record

acl_set_role($role_id, $auth)

Set a role-specific ACL record

acl_delete($mode, $ug_id = false, $forum_id = false, $permission_type = false)

Remove local permission

assign_cat_array($category_array, $tpl_cat, $tpl_mask, $ug_id, $forum_id, $s_view, $show_trace = false)

Assign category to template used by display_mask()

build_permission_array($permission_row, $content_array, $categories, $key_sort_array)

Building content array from permission rows with explicit key ordering used by display_mask()

ghost_permissions($from_user_id, $to_user_id)

Use permissions from another user. This transferes a permission set from one user to another.

Details

in auth at line 29
acl($userdata)

Init permissions

Parameters

$userdata

in auth at line 109
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

in auth at line 169
acl_get($opt, $f = 0)

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

in auth at line 218
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

in auth at line 299
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

in auth at line 343
acl_gets()

Get permission settings (more than one)

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

Get permission listing based on user_id/options/forum_ids

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. a_foo, 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

in auth at line 412
acl_cache($userdata)

Cache data to user_permissions row

Parameters

$userdata

in auth at line 454
build_bitstring($hold_ary)

Build bitstring from permission set

Parameters

$hold_ary

in auth at line 515
acl_clear_prefetch($user_id = false)

Clear one or all users cached permission settings

Parameters

$user_id

in auth at line 572
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

in auth at line 605
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

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

Get raw user based permission settings

Parameters

$user_id
$opts
$forum_id

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

Get raw group based permission settings

Parameters

$group_id
$opts
$forum_id

in auth at line 829
acl_raw_data_single_user($user_id)

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

Parameters

$user_id

in auth at line 912
_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

in auth at line 941
login($username, $password, $autologin = false, $viewonline = 1, $admin = 0)

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

Parameters

$username
$password
$autologin
$viewonline
$admin

in auth at line 1074
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

at line 30
__construct()

Init auth settings

at line 76
get_mask(set|view $mode, mixed $user_id = false, mixed $group_id = false, mixed $forum_id = false, string $auth_option = false, local|global $scope = false, ACL_NEVER|ACL_NO|ACL_YES $acl_fill = ACL_NEVER)

Get permission mask This function only supports getting permissions of one type (for example a_)

Parameters

set|view $mode

defines the permissions we get, view gets effective permissions (checking user AND group permissions), set only gets the user or group permission set alone

mixed $user_id

user ids to search for (a user_id or a group_id has to be specified at least)

mixed $group_id

group ids to search for, return group related settings (a user_id or a group_id has to be specified at least)

mixed $forum_id

forum_ids to search for. Defining a forum id also means getting local settings

string $auth_option

the authoption defines the permission setting to look for (a for example)

local|global $scope

the scope defines the permission scope. If local, a forum_id is additionally required

ACL_NEVER|ACL_NO|ACL_YES $acl_fill

defines the mode those permissions not set are getting filled with

at line 229
get_role_mask($role_id)

Get permission mask for roles This function only supports getting masks for one role

Parameters

$role_id

at line 267
display_mask($mode, $permission_type, $hold_ary, $user_mode = 'user', $local = false, $group_display = true)

Display permission mask (assign to template)

Parameters

$mode
$permission_type
$hold_ary
$user_mode
$local
$group_display

at line 631
display_role_mask($hold_ary)

Display permission mask for roles

Parameters

$hold_ary

at line 716
acl_add_option($options)

NOTE: this function is not in use atm Add a new option to the list ... $options is a hash of form -> $options = array( 'local' => array('option1', 'option2', ...), 'global' => array('optionA', 'optionB', ...) );

Parameters

$options

at line 826
acl_set($ug_type, $forum_id, $ug_id, $auth, $role_id = 0, $clear_prefetch = true)

Set a user or group ACL record

Parameters

$ug_type
$forum_id
$ug_id
$auth
$role_id
$clear_prefetch

at line 959
acl_set_role($role_id, $auth)

Set a role-specific ACL record

Parameters

$role_id
$auth

at line 1022
acl_delete($mode, $ug_id = false, $forum_id = false, $permission_type = false)

Remove local permission

Parameters

$mode
$ug_id
$forum_id
$permission_type

at line 1130
assign_cat_array($category_array, $tpl_cat, $tpl_mask, $ug_id, $forum_id, $s_view, $show_trace = false)

Assign category to template used by display_mask()

Parameters

$category_array
$tpl_cat
$tpl_mask
$ug_id
$forum_id
$s_view
$show_trace

at line 1205
build_permission_array($permission_row, $content_array, $categories, $key_sort_array)

Building content array from permission rows with explicit key ordering used by display_mask()

Parameters

$permission_row
$content_array
$categories
$key_sort_array

at line 1269
ghost_permissions($from_user_id, $to_user_id)

Use permissions from another user. This transferes a permission set from one user to another.

The other user is always able to revert back to his permission set. This function does not check for lower/higher permissions, it is possible for the user to gain "more" permissions by this. Admin permissions will not be copied.

Parameters

$from_user_id
$to_user_id