Not sure how an unsuccessful login (you say you stay on login page
with error message) and creating a different login for admins and non-
admins are related.
If auth replies with 'wrong combinisation of username/password' then
the credentials you supplied were wrong, not matter which login form
you use.
For treating admins and non-admins differently check if an admin
prefix exists in $this->params and amend your Auth setup accordingly
(do this in app_controller):
if(isset($this->params['prefix']['admin'])) {
$this->Auth->userScope['UserGroup.id'] = 1; // my admin group
$this->layout = 'admin'; // use admin layout
// other admin related stuff
}
HTH, Paul.
On Nov 10, 12:33 pm, driss <[email protected]> wrote:
> Hi
> I worked a lot with the auth component and the routing but I'm still
> confused whether the 2 complement or there's ways to work with everyone
> alone. Here's my case and the problem I always get when working with the 2
> together:
> I use the auth component and let's say I want to create the backoffice for
> the admin so I add the admin routing
> the auth component I used like it is I use the table users and everything
> folowing the book so as predicted when I try to open mysite/admin/users it
> redirects me to my login page in mysite/users/login but entring the right
> combinisation of username and password doesn't take any were I stay in the
> same login page whitout any flash message telling me wrong combinisation of
> username/password
> so my question is :can I work with the admin routing alone but must give me
> the login logout actions for the admin??
> if not how can i work with the 2 ??
> if there's any pertinent tutorial out there that will help please write it
> ??
> thank you all
--
Our newest site for the community: CakePHP Video Tutorials
http://tv.cakephp.org
Check out the new CakePHP Questions site http://ask.cakephp.org and help others
with their CakePHP related questions.
To unsubscribe from this group, send email to
[email protected] For more options, visit this group at
http://groups.google.com/group/cake-php