#6103: incompatibility between auth->isAuthorized and iniAcl->check
--------------------------+-------------------------------------------------
    Reporter:  fain182    |          Type:  Bug   
      Status:  new        |      Priority:  High  
   Milestone:  1.2.x.x    |     Component:  Auth  
     Version:  1.2 Final  |      Severity:  Normal
    Keywords:             |   Php_version:  n/a   
Cake_version:             |  
--------------------------+-------------------------------------------------
 '''The problem'''

 In my iniAcl setup, cakephp gives me this error:
 {{{
 Illegal offset type [COREcake/libs/controller/components/acl.php, line
 490]
 }}}
 '''The code'''

 In cake/libs/controller/components/auth.php
 {{{
 line 438:
   * @param mixed $user The user to check the authorization of
 line 443-447:
                 if (empty($user) && !$this->user()) {
                         return false;
                 } elseif (empty($user)) {
                         $user = $this->user();
                 }
 line 460-461:
                         case 'actions':
                                 $valid = $this->Acl->check($user,
 $this->action());

 }}}
 In cake/libs/controller/components/acl.php
 {{{
 line 474-490:
 /**
  * Main ACL check function. Checks to see if the ARO (access request
 object) has access to the ACO (access control object).
  * Looks at the acl.ini.php file for permissions (see instructions in
 /config/acl.ini.php).
  *
  * @param string $aro ARO
  * @param string $aco ACO
  * @param string $aco_action Action
  * @return boolean Success
  * @access public
  */
         function check($aro, $aco, $aco_action = null) {
                 if ($this->config == null) {
                         $this->config = $this->readConfigFile(CONFIGS .
 'acl.ini.php');
                 }
                 $aclConfig = $this->config;

                 if (isset($aclConfig[$aro]['deny'])) {
 }}}
 '''The explanation'''

 isAuthorized() calls acl check() passing the wrong parameters, instead of
 pass the aro string, passes an array.

 '''patch ?'''

 I'm not sure, maybe something like susbtitute line 461 in auth.php with
 {{{
  $valid = $this->Acl->check($user['User']['username'], $this->action());
 }}}

 '''details'''

 The error with code and context [http://bin.cakephp.org/view/454637866]

-- 
Ticket URL: <https://trac.cakephp.org/ticket/6103>
CakePHP : The Rapid Development Framework for PHP <https://trac.cakephp.org/>
Cake is a rapid development framework for PHP which uses commonly known design 
patterns like ActiveRecord, Association Data Mapping, Front Controller and MVC. 
Our primary goal is to provide a structured framework that enables PHP users at 
all levels to rapidly develop robust web applications, without any loss to 
flexibility.
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"tickets cakephp" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to 
[email protected]
For more options, visit this group at 
http://groups.google.com/group/tickets-cakephp?hl=en
-~----------~----~----~----~------~----~------~--~---

  • [CakePHP : The Rapid Dev... CakePHP : The Rapid Development Framework for PHP

Reply via email to