mirror of
https://github.com/kamilwylegala/cakephp2-php8.git
synced 2024-11-15 03:18:26 +00:00
Merging fixes to trunk
Revision: [1831] *Finally* fixing ACL.... again. Are you all happy now?!? git-svn-id: https://svn.cakephp.org/repo/trunk/cake@1832 3807eeeb-6ff5-0310-8944-8be069107fe0
This commit is contained in:
parent
3984795205
commit
35f20cb06e
5 changed files with 10 additions and 19 deletions
|
@ -6,4 +6,4 @@
|
|||
// +---------------------------------------------------------------------------------------------------+ //
|
||||
///////////////////////////////////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
0.10.6.1830 RC 2
|
||||
0.10.6.1832 RC 2
|
|
@ -80,7 +80,7 @@ class DB_ACL extends AclBase
|
|||
$tmpAcoPath = $Aco->getPath($aco);
|
||||
$acoPath = array();
|
||||
|
||||
if($action != '*' && !in_array($permKeys, '_' . $action))
|
||||
if($action != '*' && !in_array('_' . $action, $permKeys))
|
||||
{
|
||||
trigger_error('ACO permissions key "' . $action . '" does not exist in DB_ACL::check()', E_USER_ERROR);
|
||||
}
|
||||
|
|
|
@ -28,10 +28,6 @@
|
|||
* @license http://www.opensource.org/licenses/mit-license.php The MIT License
|
||||
*/
|
||||
|
||||
/**
|
||||
* Short description.
|
||||
*/
|
||||
require_once(CAKE . 'app_model.php');
|
||||
|
||||
/**
|
||||
* Short description for file.
|
||||
|
@ -46,20 +42,14 @@ require_once(CAKE . 'app_model.php');
|
|||
class AclNode extends AppModel
|
||||
{
|
||||
|
||||
/**
|
||||
* Enter description here...
|
||||
*
|
||||
* @var unknown_type
|
||||
*/
|
||||
var $useTable = false;
|
||||
/**
|
||||
* Enter description here...
|
||||
*
|
||||
*/
|
||||
function __construct()
|
||||
{
|
||||
$this->setSource();
|
||||
parent::__construct();
|
||||
$this->__setTable();
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -225,7 +215,7 @@ class AclNode extends AppModel
|
|||
{
|
||||
return null;
|
||||
}
|
||||
return $this->findAll("lft <= {$item[$class]['lft']} and rght >= {$item[$class]['rght']}");
|
||||
return $this->findAll("{$data_name}.lft <= {$item[$class]['lft']} and {$data_name}.rght >= {$item[$class]['rght']}");
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -244,7 +234,7 @@ class AclNode extends AppModel
|
|||
extract($this->__dataVars());
|
||||
|
||||
$item = $this->find($this->_resolveID($id, $secondary_id));
|
||||
return $this->findAll("lft > {$item[$class]['lft']} and rght < {$item[$class]['rght']}");
|
||||
return $this->findAll("{$data_name}.lft > {$item[$class]['lft']} and {$data_name}.rght < {$item[$class]['rght']}");
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -271,9 +261,11 @@ class AclNode extends AppModel
|
|||
*/
|
||||
function _syncTable($table, $dir, $lft, $rght)
|
||||
{
|
||||
pr('...Syncing...');
|
||||
$shift = ($dir == 2 ? 1 : 2);
|
||||
$this->db->query("UPDATE $table SET rght = rght " . ($dir > 0 ? "+" : "-") . " {$shift} WHERE rght > " . $rght);
|
||||
$this->db->query("UPDATE $table SET lft = lft " . ($dir > 0 ? "+" : "-") . " {$shift} WHERE lft > " . $lft);
|
||||
pr('...Done Syncing...');
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -296,9 +288,9 @@ class AclNode extends AppModel
|
|||
* Enter description here...
|
||||
*
|
||||
*/
|
||||
function __setTable()
|
||||
function setSource()
|
||||
{
|
||||
$this->table = strtolower(get_class($this)) . "s";
|
||||
$this->table = low(get_class($this)) . "s";
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -46,7 +46,7 @@ class Aco extends AclNode
|
|||
*
|
||||
* @var unknown_type
|
||||
*/
|
||||
var $hasMany = 'ArosAco,AcoAction';
|
||||
var $hasMany = 'ArosAco';
|
||||
|
||||
}
|
||||
|
||||
|
|
|
@ -640,7 +640,6 @@ class DboSource extends DataSource
|
|||
case 'belongsTo':
|
||||
if ($external)
|
||||
{
|
||||
pr('external');
|
||||
$conditions = $assocData['conditions'];
|
||||
$sql = 'SELECT * FROM '.$this->name($linkModel->table).' AS '.$this->name($alias);
|
||||
|
||||
|
|
Loading…
Reference in a new issue