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
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) -
';
$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
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
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
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
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
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
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
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
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
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
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
13 matches
Mail list logo