Re: javascript alert after auth login

2009-11-10 Thread Marcelo Andrade
On Mon, Nov 9, 2009 at 10:29 PM, O.J. Tibi  wrote:
>
> Hi Marcelo,
>
> Since you were saying "Javascript alert box", I guess this wouldn't be
> a CakePHP specific question.
>
> Anyway, let me answer (using jQuery, of course)
>
> 1.) Set aside a div (or any container you deem fit) on your layout to
> contain the $session->flash('auth') message. Place an ID for this div.
> 2.) Style this div like display: hidden
> 3.) On jQuery document.ready, get the contents of this div, and put it
> in an alert box as you would in normal Javascript.
>
> Cheers,
> OJ

Thanks OJ.  In fac I was not clear, but it was a CakePHP specific
question.  I didn't like to use $this->Session->setFlash to output
a welcome message when user logs in, bug just a javascript alert.

But your answer was insightful.  I'm settings a variable to the view
in the UsersController's login method, so I can check it in my view.
It works, besides it's not not the most elegant solution. :-}

Best regards.

--
MARCELO DE F. ANDRADE
Belem, PA, Amazonia, Brazil
Linux User #221105

--

You received this message because you are subscribed to the Google Groups 
"CakePHP" group.
To post to this group, send email to cake-...@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=.




Re: javascript alert after auth login

2009-11-09 Thread O.J. Tibi

Hi Marcelo,

Since you were saying "Javascript alert box", I guess this wouldn't be
a CakePHP specific question.

Anyway, let me answer (using jQuery, of course)

1.) Set aside a div (or any container you deem fit) on your layout to
contain the $session->flash('auth') message. Place an ID for this div.
2.) Style this div like display: hidden
3.) On jQuery document.ready, get the contents of this div, and put it
in an alert box as you would in normal Javascript.

Cheers,
OJ

On Nov 9, 4:47 am, Marcelo Andrade  wrote:
> Hi there,
>
> Maybe it's a newbie question, but what's the proper way to
> show a javascript alert after a successfull auth login?
>
> Best regards.
>
> --
> MARCELO DE F. ANDRADE
> Belem, PA, Amazonia, Brazil
> Linux User #221105
--~--~-~--~~~---~--~~
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
-~--~~~~--~~--~--~---



Re: javascript alert after auth login

2009-11-08 Thread robustsolution

javascript? alert? after Auth
m sorry m not a fan of this kind of debugging issues
m not a fan of classic javascript validation... alert...etc

On Nov 8, 8:47 pm, Marcelo Andrade  wrote:
> Hi there,
>
> Maybe it's a newbie question, but what's the proper way to
> show a javascript alert after a successfull auth login?
>
> Best regards.
>
> --
> MARCELO DE F. ANDRADE
> Belem, PA, Amazonia, Brazil
> Linux User #221105
--~--~-~--~~~---~--~~
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
-~--~~~~--~~--~--~---



javascript alert after auth login

2009-11-08 Thread Marcelo Andrade

Hi there,

Maybe it's a newbie question, but what's the proper way to
show a javascript alert after a successfull auth login?

Best regards.

--
MARCELO DE F. ANDRADE
Belem, PA, Amazonia, Brazil
Linux User #221105

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