Skip to content

Commit f2cc41b

Browse files
committed
Fixing php4 issues for AclShell test case.
1 parent adb0c80 commit f2cc41b

File tree

2 files changed

+8
-6
lines changed

2 files changed

+8
-6
lines changed

cake/console/libs/acl.php

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -92,7 +92,7 @@ function startup() {
9292
require_once (CONFIGS.'database.php');
9393

9494
if (!in_array($this->command, array('initdb'))) {
95-
$this->Acl = new AclComponent();
95+
$this->Acl =& new AclComponent();
9696
$controller = null;
9797
$this->Acl->startup($controller);
9898
}
@@ -257,9 +257,9 @@ function check() {
257257
extract($this->__getParams());
258258

259259
if ($this->Acl->check($aro, $aco, $action)) {
260-
$this->out(sprintf(__("%s is allowed.", true), $aro), true);
260+
$this->out(sprintf(__("%s is allowed.", true), $aroName), true);
261261
} else {
262-
$this->out(sprintf(__("%s is not allowed.", true), $aro), true);
262+
$this->out(sprintf(__("%s is not allowed.", true), $aroName), true);
263263
}
264264
}
265265

@@ -560,6 +560,8 @@ function _getNodeId($class, $identifier) {
560560
function __getParams() {
561561
$aro = is_numeric($this->args[0]) ? intval($this->args[0]) : $this->args[0];
562562
$aco = is_numeric($this->args[1]) ? intval($this->args[1]) : $this->args[1];
563+
$aroName = $aro;
564+
$acoName = $aco;
563565

564566
if (is_string($aro)) {
565567
$aro = $this->parseIdentifier($aro);
@@ -574,7 +576,7 @@ function __getParams() {
574576
$action = '*';
575577
}
576578
}
577-
return compact('aro', 'aco', 'action');
579+
return compact('aro', 'aco', 'action', 'aroName', 'acoName');
578580
}
579581

580582
/**

cake/libs/controller/components/acl.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -225,8 +225,8 @@ function __construct() {
225225
* @access public
226226
*/
227227
function initialize(&$component) {
228-
$component->Aro = $this->Aro;
229-
$component->Aco = $this->Aco;
228+
$component->Aro =& $this->Aro;
229+
$component->Aco =& $this->Aco;
230230
}
231231

232232
/**

0 commit comments

Comments
 (0)