From f2cc41bb3a360d460c1fe4b16d077656ec2dbf37 Mon Sep 17 00:00:00 2001 From: Mark Story Date: Thu, 14 Jan 2010 22:15:06 -0500 Subject: [PATCH] Fixing php4 issues for AclShell test case. --- cake/console/libs/acl.php | 10 ++++++---- cake/libs/controller/components/acl.php | 4 ++-- 2 files changed, 8 insertions(+), 6 deletions(-) diff --git a/cake/console/libs/acl.php b/cake/console/libs/acl.php index 6bd6bc0bf..68c234062 100644 --- a/cake/console/libs/acl.php +++ b/cake/console/libs/acl.php @@ -92,7 +92,7 @@ class AclShell extends Shell { 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); } @@ -257,9 +257,9 @@ class AclShell extends Shell { 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); } } @@ -560,6 +560,8 @@ class AclShell extends Shell { 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); @@ -574,7 +576,7 @@ class AclShell extends Shell { $action = '*'; } } - return compact('aro', 'aco', 'action'); + return compact('aro', 'aco', 'action', 'aroName', 'acoName'); } /** diff --git a/cake/libs/controller/components/acl.php b/cake/libs/controller/components/acl.php index 93be871b4..1e15fcb78 100644 --- a/cake/libs/controller/components/acl.php +++ b/cake/libs/controller/components/acl.php @@ -225,8 +225,8 @@ class DbAcl extends AclBase { * @access public */ function initialize(&$component) { - $component->Aro = $this->Aro; - $component->Aco = $this->Aco; + $component->Aro =& $this->Aro; + $component->Aco =& $this->Aco; } /**