Actions

API15

JAuthorization/acl check

From Joomla! Documentation

< API15:JAuthorization
Revision as of 17:25, 22 March 2010 by Doxiki (Talk | contribs)

(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Replacement filing cabinet.png
This Namespace has been archived - Please Do Not Edit or Create Pages in this namespace. Pages contain information for a Joomla! version which is no longer supported. It exists only as a historical reference, will not be improved and its content may be incomplete.

Contents

Description

Wraps the actual acl_query() function.

[Edit Descripton]

Description:JAuthorization/acl check

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;
}

[Edit See Also] SeeAlso:JAuthorization/acl check

Examples

<CodeExamplesForm />