So, your login works fine? Users get logged in? But they are not allowed access?
Just out of curiosity why are you using isAuthorized at all?
As for the problem at hand, it seems to me that you do all the checks, Auth->alllow and isAuthorized in the AppController. However, I suspect that you need to do Auth->allow() in the Users controller as well. I may be wrong of course. But I would try to make sure that the right methods are called first with a deliberate dose of debug() all over the place.
On Wednesday, July 4, 2012 2:52:23 PM UTC+2, Paulo Victor wrote:
Hum, right. I checked and this is the correct.--But the problem remains. Aparently i have to keep reading the most recent docs. Must be something like that.2012/7/4 tigr
Accordsing to documentation, it should bearray('authorize' => 'Controller'),
and notCould this be the problem?
'authorize'=>array('Controller'),
On Tuesday, July 3, 2012 5:34:51 PM UTC+2, Paulo Victor wrote:I don't know what do do anymore. My login system is up and runnig, but no matter what, always denyes access, even with registered users, with hashed password.My AppController:class AppController extends Controller {public $components = array('Session','Auth'=>array('authenticate' => array('Form' => array('fields' => array('username'=>'Login','password'=>'Senha'), 'userModel'=> 'Usuario'),),'loginAction' =>array('controller' => 'Usuarios','action' => 'login'),'loginRedirect'=>array('controller'=>'usuarios', 'action'=>'index'), 'logoutRedirect'=>array('controller'=>'usuarios', 'action'=>'index'), 'authError'=>"You can't access that page",'authorize'=>array('Controller'), 'loginError'=> 'Login errado'));public function isAuthorized($usuario=null) {return true;}public function beforeFilter() {$this->Auth->allow('index','view'); $this->set('logged_in', $this->Auth->loggedIn());$this->set('current_user', $this->Auth->user());}}?>Everytime, goes to the AuthError message "You can't acces that page".I did this using documentation and Andrew Perk videos.thanks a lot--
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
cake-php+unsubscribe@googlegroups.com For more options, visit this group at http://groups.google.com/group/cake-php
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
cake-php+unsubscribe@googlegroups.com For more options, visit this group at http://groups.google.com/group/cake-php
No comments:
Post a Comment