Nice.  I'm looking good.... :)

Thanks a lot!

2007/5/9, soytuny <[EMAIL PROTECTED]>:
>
> You can render the home view with
>
> $this->render('../pages/home');
>
> If you would like to set an error message and redirect you can use
>
> $this->Session->setFlash('You ain't no user!');
>
> To display the flash message, you need this line in your layout (or
> view)
>
> if($session->check('Message.flash')) $session->flash();
>
> HTH,
>
> Russell Austin
>
> On May 9, 2:23 pm, "Greg Cerveny" <[EMAIL PROTECTED]> wrote:
> > Hello,
> >
> > I've created my default home page (/views/pages/home.thmtl) to include
> > a login form for my application.  This works fine, but if the login
> > fails, I am unsure how to handle it.  I would like to send the user
> > back to the front page and display an appropriate error message.
> >
> > Here is my existing logic (mostly from the tutorial):
> >
> > function login()
> >     {
> >         $this->set('error', false);
> >         if (!empty($this->data))
> >         {
> >             $someone =
> > $this->User->findByUsername($this->data['User']['username']);
> >             if(!empty($someone['User']['password']) &&
> > $someone['User']['password'] == md5($this->data['User']['password']))
> >             {
> >                 $this->Session->write('User', $someone['User']);
> >                 $this->redirect('/ideas');
> >             }
> >             else
> >             {
> >                 $this->redirect('/');
> >             }
> >         }
> >     }
> >
> > So, in the else statement...
> >
> > Should (Can?) I tell the controller to display the home.thtml view?
> > Should I redirect with a url param of the error message?
> > Should I render an action?
> >
> > Thanks!
> >
> > -greg
>
>
> >
>

--~--~---------~--~----~------------~-------~--~----~
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