I will try and muck around with the ACL and Auth components, so i can
build the application, but i could not find any tutorial really useful
about ACL, there are some, but none of them is targeted for the
beginners or they are not written with the reader in mind. I know how
it works, but i cannot implement it in the application. There is also
an article in the bakery where the guy simply puts one hack function
into the bootstrap file like this:
function adminHack($adminTypes)
{
$bits = explode('/', $_GET['url'], 3);
if(in_array($bits[0], $adminTypes))
{
Configure::write('Routing.admin', $bits[0]);
}
else
{
$matches = array();
$morebits = explode('_', $bits[1]);
if(preg_match('/^(' . implode('|', $adminTypes) . ')\_/', $bits[1],
$matches))
{
$url = $matches[1].'/'.$bits[0].'/'.$morebits[1];
header('Location: /'.$url);
}
}
}
and then he uses the function underneath:
adminHack(array('admin', 'member'));
and in the controllers he checks in the beforeFilter
if(isset($this->params['admin']))
$this->checkAccess('admin');
if(isset($this->params['member']))
$this->checkAccess('member');
This looks much more programming to me than the ACL, cause i could
simply add more user types in the function. But i don't understand
that after this: $bits = explode('/', $_GET['url'], 3); , if the $_GET
['url'] is admin/controller/action, then $bits[0] = admin, $bits[1] =
controller, $bits[2] = action, but he is saying after in this line:
$morebits = explode('_', $bits[1]); //He is exploding the action that
contains _, like admin_add, or member_delete, but why not $bits[2]
cause that is what contains the action, according to me $bits[1] gets
the controller? Where i am doing wrong?
As of MooTools i find it very very nice to use, much easier than
prototype or jquery and i would go for it..
Thanks again for your answer.
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups "CakePHP" group.
To post to this group, send email to cake-php@googlegroups.com
To unsubscribe from this group, send email to cake-php+unsubscribe@googlegroups.com
For more options, visit this group at http://groups.google.com/group/cake-php?hl=en
-~----------~----~----~----~------~----~------~--~---
No comments:
Post a Comment