mirror of
https://github.com/kamilwylegala/cakephp2-php8.git
synced 2025-01-18 18:46:17 +00:00
adding patch for AclShell::setParent(), fixes #4240
git-svn-id: https://svn.cakephp.org/repo/branches/1.2.x.x@6486 3807eeeb-6ff5-0310-8944-8be069107fe0
This commit is contained in:
parent
b5d0baf98b
commit
815983cd74
1 changed files with 10 additions and 3 deletions
|
@ -204,7 +204,14 @@ class AclShell extends Shell {
|
|||
$this->_checkArgs(3, 'setParent');
|
||||
$this->checkNodeType();
|
||||
extract($this->__dataVars());
|
||||
if (!$this->Acl->{$class}->setParent($this->args[2], $this->args[1])) {
|
||||
$data = array(
|
||||
$class => array(
|
||||
'id' => $this->args[1],
|
||||
'parent_id' => $this->args[2]
|
||||
)
|
||||
);
|
||||
$this->Acl->{$class}->create();
|
||||
if(!$this->Acl->{$class}->save($data)) {
|
||||
$this->out(__("Error in setting new parent. Please make sure the parent node exists, and is not a descendant of the node specified.", true), true);
|
||||
} else {
|
||||
$this->out(sprintf(__("Node parent set to %s", true), $this->args[2]) . "\n", true);
|
||||
|
@ -367,7 +374,7 @@ class AclShell extends Shell {
|
|||
|
||||
'setparent' => "\tsetParent aro|aco <node> <parent>\n" .
|
||||
"\t\t" . __("Moves the ACL object specified by <node> beneath the parent ACL object specified by <parent>.", true) . "\n" .
|
||||
"\t\t" . __("For more detailed parameter usage info, see help for the 'create' command.", true) . "\n",
|
||||
"\t\t" . __("To identify the node and parent, use the row id.", true) . "\n",
|
||||
|
||||
'getpath' => "\tgetPath aro|aco <node>\n" .
|
||||
"\t\t" . __("Returns the path to the ACL object specified by <node>. This command", true) . "\n" .
|
||||
|
@ -493,4 +500,4 @@ class AclShell extends Shell {
|
|||
return $vars;
|
||||
}
|
||||
}
|
||||
?>
|
||||
?>
|
||||
|
|
Loading…
Add table
Reference in a new issue