API15:JAuthorization/acl check
From Joomla! Documentation
Description
Wraps the actual acl_query() function.
<! removed transcluded page call, red link never existed >
Syntax
acl_check($aco_section_value, $aco_value, $aro_section_value, $aro_value, $axo_section_value=NULL, $axo_value=NULL, $root_aro_group=NULL, $root_axo_group=NULL)
| Parameter Name | Default Value | Description |
|---|---|---|
| $aco_section_value | The ACO section value | |
| $aco_value | The ACO value | |
| $aro_section_value | The ARO section value | |
| $aro_value | The ARO section | |
| $axo_section_value | NULL | The AXO section value (optional) |
| $axo_value | NULL | The AXO section value (optional) |
| $root_aro_group | NULL | The group id of the ARO ??Mike?? (optional) |
| $root_axo_group | NULL | The group id of the AXO ??Mike?? (optional) |
Returns
mixed Generally a zero (0) or (1) or the extended return value of the ACL
Defined in
libraries/joomla/user/authorization.php
Importing
jimport( 'joomla.user.authorization' );
Source Body
function acl_check( $aco_section_value, $aco_value, $aro_section_value, $aro_value, $axo_section_value=NULL, $axo_value=NULL, $root_aro_group=NULL, $root_axo_group=NULL )
{
if ($this->_checkMode === 1) {
return parent::acl_check( $aco_section_value, $aco_value, $aro_section_value, $aro_value, $axo_section_value, $axo_value, $root_aro_group, $root_axo_group );
}
$this->debug_text( "\n<br /> ACO=$aco_section_value:$aco_value, ARO=$aro_section_value:$aro_value, AXO=$axo_section_value|$axo_value" );
$acl_result = 0;
for ($i=0; $i < $this->acl_count; $i++)
{
$acl =& $this->acl[$i];
if (strcasecmp( $aco_section_value, $acl[0] ) == 0) {
if (strcasecmp( $aco_value, $acl[1] ) == 0) {
if (strcasecmp( $aro_section_value, $acl[2] ) == 0) {
if (strcasecmp( $aro_value, $acl[3] ) == 0) {
if ($axo_section_value && $acl[4]) {
if (strcasecmp( $axo_section_value, $acl[4] ) == 0) {
if (strcasecmp( $axo_value, $acl[5] ) == 0) {
$acl_result = @$acl[6] ? $acl[6] : 1;
break;
}
}
} else {
$acl_result = @$acl[6] ? $acl[6] : 1;
break;
}
}
}
}
}
}
return $acl_result;
}
<! removed transcluded page call, red link never existed >
Examples
Code Examples