Dreamhost's support panel supports either...regardless, I agree that
it's pretty rare to allow one OR the other - though it is possible to
use an email AS the username.

On Feb 3, 1:06 pm, brian <bally.z...@gmail.com> wrote:
> I suppose you could put the logic in beforeFilter(). If the
> $this->params['action'] == 'login' check for
> $this->data['User']['username'] and, if it's empty (and email isn't)
> do"
>
> $this->data['User']['username'] $this->data['User']['email'];
>
> I don't understand why you'd want to do this, though. Are you sure
> that these other sites which allow email for username don't simply do
> that for all users? That's pretty common. I don't recall ever seeing a
> site which allowed either.
>
> On Tue, Feb 3, 2009 at 11:54 AM, Mike Digital Egg
>
>
>
> <mikedigital...@gmail.com> wrote:
>
> > Hi,
>
> > I was wondering if anyone knows how to set the Auth component to allow
> > login using either:
>
> > Email + Password
>
> > OR
>
> > Username + Password
>
> > I have seen lots of site that do this but can't work out how to do it
> > in Cake.
>
> > I have tried the below which doesn't work:
>
> > [CODE]
> >                                if ( $this->Auth->login( $this->data ) ) {
> >                                        $this->render('success');
> >                                } else {
> >                                        $this->Auth->fields = 
> > array('username' => 'username', 'password'
> > => 'password');
> >                                        $this->data['User']['username'] = 
> > $this->data['User']['email'];
> >                                        if ( $this->Auth->login( $this->data 
> > ) ) {
> >                                                $this->render('success');
> >                                        } else {
> >                                                echo "Login Failed";
> >                                        }
> >                                }
> > [/CODE]
>
> > Any other ideas?
>
> > Cheers
>
> > Mike- Hide quoted text -
>
> - Show quoted text -
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"CakePHP" group.
To post to this group, send email to cake-php@googlegroups.com
To unsubscribe from this group, send email to 
cake-php+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to