Summary
- File
- Package hierarchy Member\authorization
- Class hierarchy \Authorizations
This class contains only static methods, it souldn't be instantiated.
This class contains only static methods, it souldn't be instantiated.
build_auth_array_from_form() : array
Returns an array with the authorizations given by variable number of arrays passed in argument.
This returned array is used to be serialized.
The array of authorizations.
static |
auth_array_simple(integer $bit_value, string $idselect, boolean $admin_auth_default = true) : Array
Returns an array with the authorizations given by variable number of arrays passed in argument.
integer | $bit_value | The bit emplacement in the authorization array. |
string | $idselect | Html id of the html select field of authorizations (in most case the same value as $bit_value). |
boolean | $admin_auth_default | Give authorization for the administrator by default. |
with the authorization for the bit specified.
static |
generate_select(integer $auth_bit, array $array_auth = array(), array $array_ranks_default = array(), string $idselect = '', integer $disabled = false, boolean $disabled_advanced_auth = false, array<mixed,mixed> $disabled_ranks = array()) : String
Generate a multiple select field for the form which create authorization for ranks, groups and members.
integer | $auth_bit | The bit emplacement used to set it. |
array | $array_auth | Array of authorization, allow you to select value authorized for this bit. |
array | $array_ranks_default | Array of ranks selected by default. |
string | $idselect | Html id used for the select. |
integer | $disabled | Disabled all options for the select. Set to true to disable all options. |
boolean | $disabled_advanced_auth | Disable advanced authorizations. |
array<mixed,mixed> | $disabled_ranks | The ranks to disable in select. |
The formated select.
static |
check_auth(integer $type, integer $value, array $array_auth, integer $bit) : boolean
Check authorizations for a member, a group or a rank
integer | $type | Type of check, used RANK_TYPE for ranks, GROUP_TYPE for groups and USER_TYPE for users. |
integer | $value | Value int the authorization array to check. |
array | $array_auth | Array of authorization. |
integer | $bit | Bit emplacement for the check |
True if authorized, false otherwise.
static |
merge_auth(array $parent, array $child, integer $auth_bit, integer $mode) : array
Merge two authorizations array, first is the parent, second is the inherited child.
array | $parent | Array of authorizations. |
array | $child | Array of authorizations. |
integer | $auth_bit | Bit emplacement for the merge. |
integer | $mode | Mode used for the merge. Use Authorizations::AUTH_PARENT_PRIORITY to give to the parent the priority for the authorization, Authorizations::AUTH_CHILD_PRIORITY otherwise. |
The new array merged.
static |
capture_and_shift_bit_auth(array $auth, integer $original_bit, integer $final_bit = 1) : array
Capture authorizations and shift a particular bit to an another bit (1 is used by default).
array | $auth | Array of authorizations. |
integer | $original_bit | The bit to shift. |
integer | $final_bit | Bit distination (1 is used by default). |
The new authorization array.
static |
get_auth_array(integer $bit_value, string $idselect, array $array_auth_all, array $sum_auth)
Get authorization array from the form.
integer | $bit_value | The bit emplacement in the authorization array used to set it. |
string | $idselect | Html id used for the select. |
array | $array_auth_all | Array where the authorizations collected are stored. |
array | $sum_auth | Sum up all authorizations for the authorization array. |
static |