Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
Fixing php4 issues for AclShell test case.
  • Loading branch information
markstory committed Jan 15, 2010
1 parent adb0c80 commit f2cc41b
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 6 deletions.
10 changes: 6 additions & 4 deletions cake/console/libs/acl.php
Expand Up @@ -92,7 +92,7 @@ function startup() {
require_once (CONFIGS.'database.php');

if (!in_array($this->command, array('initdb'))) {
$this->Acl = new AclComponent();
$this->Acl =& new AclComponent();
$controller = null;
$this->Acl->startup($controller);
}
Expand Down Expand Up @@ -257,9 +257,9 @@ function check() {
extract($this->__getParams());

if ($this->Acl->check($aro, $aco, $action)) {
$this->out(sprintf(__("%s is allowed.", true), $aro), true);
$this->out(sprintf(__("%s is allowed.", true), $aroName), true);
} else {
$this->out(sprintf(__("%s is not allowed.", true), $aro), true);
$this->out(sprintf(__("%s is not allowed.", true), $aroName), true);
}
}

Expand Down Expand Up @@ -560,6 +560,8 @@ function _getNodeId($class, $identifier) {
function __getParams() {
$aro = is_numeric($this->args[0]) ? intval($this->args[0]) : $this->args[0];
$aco = is_numeric($this->args[1]) ? intval($this->args[1]) : $this->args[1];
$aroName = $aro;
$acoName = $aco;

if (is_string($aro)) {
$aro = $this->parseIdentifier($aro);
Expand All @@ -574,7 +576,7 @@ function __getParams() {
$action = '*';
}
}
return compact('aro', 'aco', 'action');
return compact('aro', 'aco', 'action', 'aroName', 'acoName');
}

/**
Expand Down
4 changes: 2 additions & 2 deletions cake/libs/controller/components/acl.php
Expand Up @@ -225,8 +225,8 @@ function __construct() {
* @access public
*/
function initialize(&$component) {
$component->Aro = $this->Aro;
$component->Aco = $this->Aco;
$component->Aro =& $this->Aro;
$component->Aco =& $this->Aco;
}

/**
Expand Down

0 comments on commit f2cc41b

Please sign in to comment.