mirror of
https://github.com/kamilwylegala/cakephp2-php8.git
synced 2025-02-07 12:36:25 +00:00
Adding fix for #2478 corrects issue on php 4
git-svn-id: https://svn.cakephp.org/repo/branches/1.2.x.x@4921 3807eeeb-6ff5-0310-8944-8be069107fe0
This commit is contained in:
parent
027f7838b5
commit
815b159ab3
1 changed files with 7 additions and 7 deletions
|
@ -62,7 +62,7 @@ class DB_ACL extends AclBase {
|
||||||
* @return unknown
|
* @return unknown
|
||||||
*/
|
*/
|
||||||
function check($aro, $aco, $action = "*") {
|
function check($aro, $aco, $action = "*") {
|
||||||
$Perms = new Permission();
|
$Permission = new Permission();
|
||||||
$Aro = new Aro();
|
$Aro = new Aro();
|
||||||
$Aco = new Aco();
|
$Aco = new Aco();
|
||||||
|
|
||||||
|
@ -70,7 +70,7 @@ class DB_ACL extends AclBase {
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
$permKeys = $this->_getAcoKeys($Perms->loadInfo());
|
$permKeys = $this->_getAcoKeys($Permission->loadInfo());
|
||||||
$aroPath = $Aro->node($aro);
|
$aroPath = $Aro->node($aro);
|
||||||
$acoPath = new Set($Aco->node($aco));
|
$acoPath = new Set($Aco->node($aco));
|
||||||
|
|
||||||
|
@ -93,7 +93,7 @@ class DB_ACL extends AclBase {
|
||||||
}
|
}
|
||||||
|
|
||||||
for($i = count($aroPath) - 1; $i >= 0; $i--) {
|
for($i = count($aroPath) - 1; $i >= 0; $i--) {
|
||||||
$perms = $Perms->findAll(
|
$perms = $Permission->findAll(
|
||||||
array(
|
array(
|
||||||
'Permission.aro_id' => $aroPath[$i]['Aro']['id'],
|
'Permission.aro_id' => $aroPath[$i]['Aro']['id'],
|
||||||
'Permission.aco_id' => $acoPath->extract('{n}.Aco.id')
|
'Permission.aco_id' => $acoPath->extract('{n}.Aco.id')
|
||||||
|
@ -138,9 +138,9 @@ class DB_ACL extends AclBase {
|
||||||
* @return boolean
|
* @return boolean
|
||||||
*/
|
*/
|
||||||
function allow($aro, $aco, $action = "*", $value = 1) {
|
function allow($aro, $aco, $action = "*", $value = 1) {
|
||||||
$Perms = new Permission();
|
$Permission = new Permission();
|
||||||
$perms = $this->getAclLink($aro, $aco);
|
$perms = $this->getAclLink($aro, $aco);
|
||||||
$permKeys = $this->_getAcoKeys($Perms->loadInfo());
|
$permKeys = $this->_getAcoKeys($Permission->loadInfo());
|
||||||
$save = array();
|
$save = array();
|
||||||
|
|
||||||
if ($perms == false) {
|
if ($perms == false) {
|
||||||
|
@ -153,7 +153,7 @@ class DB_ACL extends AclBase {
|
||||||
}
|
}
|
||||||
|
|
||||||
if ($action == "*") {
|
if ($action == "*") {
|
||||||
$permKeys = $this->_getAcoKeys($Perms->loadInfo());
|
$permKeys = $this->_getAcoKeys($Permission->loadInfo());
|
||||||
|
|
||||||
foreach($permKeys as $key) {
|
foreach($permKeys as $key) {
|
||||||
$save[$key] = $value;
|
$save[$key] = $value;
|
||||||
|
@ -173,7 +173,7 @@ class DB_ACL extends AclBase {
|
||||||
if ($perms['link'] != null && count($perms['link']) > 0) {
|
if ($perms['link'] != null && count($perms['link']) > 0) {
|
||||||
$save['id'] = $perms['link'][0]['Permission']['id'];
|
$save['id'] = $perms['link'][0]['Permission']['id'];
|
||||||
}
|
}
|
||||||
return $Perms->save(array('Permission' => $save));
|
return $Permission->save(array('Permission' => $save));
|
||||||
}
|
}
|
||||||
/**
|
/**
|
||||||
* Deny
|
* Deny
|
||||||
|
|
Loading…
Add table
Reference in a new issue