Cake Auth userScope ?

2012-04-14 Thread heohni
Hi, if a user try to login and his account is not active yet the login will fail because of this: 'scope' = array('User.usr_active' = 1), Is there anyhow a way to catch this case to display a proper message to the user? Thanks for help!! -- Our newest site for the community: CakePHP Video

Re: Cake Auth userScope ?

2012-04-14 Thread euromark
Simply be creating your own AuthExt component which overrides the default login() method: https://github.com/dereuromark/tools/blob/2.0/Controller/AuthExtComponent.php#L108 PS: the class is not intended for public use (kind of ugly still from 2008, only upgraded without cleanup to 2.x) -

Re: Auth-userScope is getting ignored

2012-04-08 Thread heohni
'; $this-Auth-userScope = array('User.usr_active' = '1'); But still the active is not getting checked. -- 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

Re: Auth-userScope is getting ignored

2012-04-08 Thread heohni
Update: even if add this for testing $this-Auth-fields = array('username' = 'test', 'password' = 'test' ); This is also ignored... -- 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

Re: Auth-userScope is getting ignored

2012-04-08 Thread Vitor Pacheco
try this: $this-Auth-authenticate = array( AuthComponent::ALL = array( 'userModel' = 'User', 'fields' = array( 'username' = 'test', 'password' = 'test', ), 'scope' = array( 'User.usr_active' = 1, ) ), 'Form' ); http://book.cakephp.org/2.0/en/core-libraries/components/authentication.html

$this-Auth-userScope

2011-03-08 Thread DerekGardiner
In an effort to make sure that only active users can log into the application I've added the following in my app_controller function beforeFilter() { $this-Auth-userScope = array('User.active' = 1); } and the following in my login function under my users_controller function login

Re: $this-Auth-userScope

2011-03-08 Thread Stephen
app_controller function beforeFilter() { $this-Auth-userScope = array('User.active' = 1); } and the following in my login function under my users_controller function login() { if ($this-Session-read('Auth.User')) { $active = $this-Auth-user('active

Re: Problems with Auth-userScope

2011-02-12 Thread zero00
yes i tried that but the problem still persists. I think it may have something wrong in the code i wrote but i cant seem to find it -- 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

Re: Problems with Auth-userScope

2011-02-11 Thread zero00
I dont wanna use ACL. I was under the impresion if I had a db row that had usernamepassword admin user1 pass1 0 user2 pass2 1 by using Auth-userScope - user1 would be denied - user2 would be granted acess -- Our newest site for the community

Re: Problems with Auth-userScope

2011-02-11 Thread Stephen
2011 08:29, zero00 jmejia...@gmail.com wrote: I dont wanna use ACL. I was under the impresion if I had a db row that had usernamepassword admin user1 pass1 0 user2 pass2 1 by using Auth-userScope - user1 would be denied - user2 would

Re: Problems with Auth-userScope

2011-02-11 Thread ShadowCross
in your AdminsController. On Feb 11, 12:29 am, zero00 jmejia...@gmail.com wrote: I dont wanna use ACL.  I was under the impresion if I had a db row that had username    password     admin user1           pass1           0 user2           pass2           1 by using Auth-userScope -  user1 would

Problems with Auth-userScope

2011-02-10 Thread zero00
class class AdminsController extends AppController { var $name = 'Admins'; var $uses = array('User'); function beforeFilter() { parent::beforeFilter(); $this-Auth-loginAction = array('controller' = 'admins', 'action' = 'login'); $this-Auth-userScope

Re: Problems with Auth-userScope

2011-02-10 Thread Amit Badkas
Hi, I think you are talking about ACL, not authentication. $this-Auth-userScope used as condition while doing login and it doesn't provide mechanism to access or deny particular user to particular page. Hope that helps. Amit Badkas PHP Applications for E-Biz: http://www.sanisoft.com On Fri