That sound easy, i'll give it ago, thanks Grigri :)

On Feb 15, 11:51 pm, grigri <[EMAIL PROTECTED]> wrote:
> Just set $this->Auth->userScope = array('User.state_id' => WHATEVER);
> in your controller's beforeFilter callback.
>
> On Feb 15, 10:43 am, Tim W <[EMAIL PROTECTED]> wrote:
>
> > Hi all,
>
> > My user table/model has a state_id field. I'd like to configure Auth
> > so that it only lets people login is the state is a certain value. Is
> > there an easy way to do this?
>
> > Two lines in auth.php suggest it should be possible
>
> > 38: $conditions = $this->userScope;  // (previously $conditions is a
> > null parameter)
> > 77: $data = $model->find(array_merge($find, $conditions), null, null,
> > -1);
>
> > If I could work out how to pass a condition in that would do the job.
> > Has anyone done it?
>
> > Thanks
>
> > Tim
--~--~---------~--~----~------------~-------~--~----~
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
-~----------~----~----~----~------~----~------~--~---

Reply via email to