Methods summary
public static
array
|
#
build_auth_array_from_form( )
Returns an array with the authorizations given by variable number of arrays passed in argument.
This returned array is used to be serialized.
Returns an array with the authorizations given by variable number of arrays passed in argument.
This returned array is used to be serialized.
Returns
array The array of authorizations.
|
public static
Array
|
#
auth_array_simple( integer $bit_value, string $idselect, boolean $admin_auth_default = true )
Returns an array with the authorizations given by variable number of arrays passed in argument.
Returns an array with the authorizations given by variable number of arrays passed in argument.
Parameters
- $bit_value
- The bit emplacement in the authorization array.
- $idselect
- Html id of the html select field of authorizations (in most case the same value as $bit_value).
- $admin_auth_default
- Give authorization for the administrator by default.
Returns
Array with the authorization for the bit specified.
|
public static
String
|
#
generate_select( integer $auth_bit, array $array_auth = array(), array $array_ranks_default = array(), string $idselect = '', integer $disabled = false, boolean $disabled_advanced_auth = false, mixed[] $disabled_ranks = array() )
Generate a multiple select field for the form which create authorization for ranks, groups and members.
Generate a multiple select field for the form which create authorization for ranks, groups and members.
Parameters
- $auth_bit
- The bit emplacement used to set it.
- $array_auth
- Array of authorization, allow you to select value authorized for this bit.
- $array_ranks_default
- Array of ranks selected by default.
- $idselect
- Html id used for the select.
- $disabled
- Disabled all options for the select. Set to true to disable all options.
- $disabled_advanced_auth
- Disable advanced authorizations.
- $disabled_ranks
- The ranks to disable in select.
Returns
String The formated select.
|
public static
boolean
|
#
check_auth( integer $type, integer $value, array $array_auth, integer $bit )
Check authorizations for a member, a group or a rank
Check authorizations for a member, a group or a rank
Parameters
- $type
- Type of check, used RANK_TYPE for ranks, GROUP_TYPE for groups and USER_TYPE for users.
- $value
- Value int the authorization array to check.
- $array_auth
- Array of authorization.
- $bit
- Bit emplacement for the check
Returns
boolean True if authorized, false otherwise.
|
public static
array
|
#
merge_auth( array $parent, array $child, integer $auth_bit, integer $mode )
Merge two authorizations array, first is the parent, second is the inherited child.
Merge two authorizations array, first is the parent, second is the inherited child.
Parameters
- $parent
- Array of authorizations.
- $child
- Array of authorizations.
- $auth_bit
- Bit emplacement for the merge.
- $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.
Returns
array The new array merged.
|
public static
array
|
#
capture_and_shift_bit_auth( array $auth, integer $original_bit, integer $final_bit = 1 )
Capture authorizations and shift a particular bit to an another bit (1 is used by default).
Capture authorizations and shift a particular bit to an another bit (1 is used by default).
Parameters
- $auth
- Array of authorizations.
- $original_bit
- The bit to shift.
- $final_bit
- Bit distination (1 is used by default).
Returns
array The new authorization array.
|