Re: Login box in layout

2008-03-24 Thread Nick Timchenko

Thank you very much for advices, Dave! I think I'll try AJAX - it will
be good practice for me ;)

Cheers,
Nick

Dave J wrote:
> Hey Nick,
>
> You're right about that. I guess you can tackle it either two ways.
>
> 1) Submit the form using AJAX, so if there's any errors, you get them
> back without a page refresh. And on successful login, you could either
> hide the login form and replace it with a 'logged-in' message. Or send
> back a JS command to refresh the page, so the page would reflect the
> new logged-in status
>
> 2) Or use the flash feature of the Session Component/Helper to return
> any errors as soon as the page refreshes. (Just make sure you have
> $session->flash() somewhere in your layout)
>

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



Re: Login box in layout

2008-03-23 Thread Dardo Sordi Bogado

Store referer in session (if referer is different from actual action)
and redirect to it when login is successful.  Storing referer in
session is an idea of AD7six (http://bin.cakephp.org/view/316159681)
and it let you do some interesting tricks.

On Sun, Mar 23, 2008 at 7:20 PM, Dave J <[EMAIL PROTECTED]> wrote:
>
>  Hey Nick,
>
>  You're right about that. I guess you can tackle it either two ways.
>
>  1) Submit the form using AJAX, so if there's any errors, you get them
>  back without a page refresh. And on successful login, you could either
>  hide the login form and replace it with a 'logged-in' message. Or send
>  back a JS command to refresh the page, so the page would reflect the
>  new logged-in status
>
>  2) Or use the flash feature of the Session Component/Helper to return
>  any errors as soon as the page refreshes. (Just make sure you have
>  $session->flash() somewhere in your layout)
>
>
>
>
>
>  On Mar 23, 8:00 pm, Nick Timchenko <[EMAIL PROTECTED]> wrote:
>  > Yeah, I was trying it, but that way I lose any data according to
>  > validation/authentication errors. Is there any solution?
>  >
>  > Regards,
>  > Nick
>  >
>  > Dave J wrote:
>  > > How about in the action which processes the form data, you pick up the
>  > > referer URL  ($this->referer() )  and at the end - after the user
>  > > successfully authenticates - you just redirect to that URL
>  > > basically leaving him on the same page.
>  >
>  > > Dave
>  >
>

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



Re: Login box in layout

2008-03-23 Thread Dave J

Hey Nick,

You're right about that. I guess you can tackle it either two ways.

1) Submit the form using AJAX, so if there's any errors, you get them
back without a page refresh. And on successful login, you could either
hide the login form and replace it with a 'logged-in' message. Or send
back a JS command to refresh the page, so the page would reflect the
new logged-in status

2) Or use the flash feature of the Session Component/Helper to return
any errors as soon as the page refreshes. (Just make sure you have
$session->flash() somewhere in your layout)



On Mar 23, 8:00 pm, Nick Timchenko <[EMAIL PROTECTED]> wrote:
> Yeah, I was trying it, but that way I lose any data according to
> validation/authentication errors. Is there any solution?
>
> Regards,
> Nick
>
> Dave J wrote:
> > How about in the action which processes the form data, you pick up the
> > referer URL  ($this->referer() )  and at the end - after the user
> > successfully authenticates - you just redirect to that URL
> > basically leaving him on the same page.
>
> > Dave
--~--~-~--~~~---~--~~
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
-~--~~~~--~~--~--~---



Re: Login box

2007-12-10 Thread dr. Hannibal Lecter

Elements are the way to go, just create the loginbox element and
optionbox element and switch them depending on user presence.

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



Re: Login box

2007-12-06 Thread Baz
$this->element and
requestAction

On Dec 6, 2007 5:47 PM, Miguel XT <[EMAIL PROTECTED]> wrote:

>
> I have a 3 columns layout, I'm thinking on putting a login box on the
> right side. I want to know what is the best way to put this box there.
> I want to switch it to a an option box when the user logins.
>
> What do you think of this?
>
> >
>

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