Re: NEWBIE QUESTION: code continues executing after this-redirect()?

2006-06-28 Thread jbernat

Thanks to all for the helpful responses.  Adding exit(0) fixed my
problem, and I will also consider a return.

Jim
http://www.biochartonline.com


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



NEWBIE QUESTION: code continues executing after this-redirect()?

2006-06-27 Thread jbernat

I am new to PHP and Cake.  I am baking my first website with Cake and
have implemented authentication as per the manual at
http://manual.cakephp.org/chapter/19 .

I added the call to CheckSession() to each of the methods in my
controller that require authentication, but noticed that even if the
person is not logged in, the method executes.  Upon stepping through
the code, I noticed that the this-redirect() which forwards them to
the login page falls through and the code after resumes executing.

Is this as you would expect?  I was expecting it would behave like an
ASP Response.Redirect() which terminates the current script.

If I wish to abandon all further method execution, what do I need to
call or execute following this-redirect()?

Many thanks!
Jim Bernatowicz
http://www.photips.com


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



Re: NEWBIE QUESTION: code continues executing after this-redirect()?

2006-06-27 Thread John David Anderson (_psychic_)


On Jun 27, 2006, at 12:54 PM, jbernat wrote:


 I am new to PHP and Cake.  I am baking my first website with Cake and
 have implemented authentication as per the manual at
 http://manual.cakephp.org/chapter/19 .

The example presented is very loose, and is only meant as a way to  
show you how to roll your own authentication, or integrate your Cake  
app with something else.

 If I wish to abandon all further method execution, what do I need to
 call or execute following this-redirect()?

exit(0);

-- John


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



Re: NEWBIE QUESTION: code continues executing after this-redirect()?

2006-06-27 Thread John Zimmerman [gmail]
A return would make more sense than an exit I suppose.Thanks for the explanations.On 6/27/06, [EMAIL PROTECTED]
 [EMAIL PROTECTED] wrote:
John Zimmerman [gmail] wrote: Is there a situation where you would not want to exit after a redirect?For myself I cannot think of any.afterFilter won't be called if you do an exit or die.
Now, I've never yet had to use afterFilter, but I try to structure sothat I can in the future. So the most I ever do after a redirect orrender is a return, ending method execution.
--~--~-~--~~~---~--~~
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  -~--~~~~--~~--~--~---