I got the new AuthComponent going by doing this in UsersController: function beforeFilter() { $this->Auth->allow('index', 'register', 'login', 'logout'); }
I'm reading cake/libs/controller/components/auth.php as I go along. My next step is to figure out how to use $this->Auth->login(). I'm sure I can figure it out, but I'm always concerned about best practices. Any ideas? I understand that Cake 1.2 is still an alpha release, but the new features are just awesome sounding. If I get a, "piss off and wait" response from one of the developers, I'll understand and still be happy with Cake 1.2. On Feb 28, 2:54 pm, "joradom" <[EMAIL PROTECTED]> wrote: > you have to set up the Auth object with the allowed actions in your > controller: > > i.e. in my users_controller > > function beforeFilter() { > $this->Auth->userModel = 'User'; > $this->Auth->sessionKey = 'My'; > $this->Auth->loginRedirect = '/users/index'; > $this->Auth->allowedActions = array('index', 'register', > 'logout','login'); > } > > there is a set function wich takes an array as argument, surely a > better way to setup your object. > > I'm not sure if it is better to have a call to Auth in each controller > or put it in the app_controller, may depend on your application i > guess. > > Hope this helps, because I'm struggling too with this component and > these are just experiments, not good code :) > > On 27 feb, 17:08, "Digital Spaghetti" > > <[EMAIL PROTECTED]> wrote: > > Hey guys, > > > I'm reasonably new to CakePHP, really only had a play about with it so > > far but I am ready to take it to the next level. > > > The first thing I am building into my app is the user system, so users > > can log in and get access to specific areas. I've decided to go with > > 1.2.x.x branch since it has the newAuth componentbut I've come > > across problems already. > > > In my AppController class, I have added theAuth component, but now > > every page I look at, it's asking me to log in as a user (via /users/ > > login as the default in Auth), but of course I don't want this on > > every page, only pages that are under admin. > > > Can anyone direct me the proper usage of this component, as it's not > > well documented yet (at least to a level I can read) and how to only > > have it ask for login on certain controller functions (like /admin/ > > posts/add for example). > > > Tane --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Cake PHP" group. To post to this group, send email to cake-php@googlegroups.com To unsubscribe from this group, send email to [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/cake-php?hl=en -~----------~----~----~----~------~----~------~--~---