Re: Login script and posting
Lukas Smith <[email protected]>
| Newsgroups | gmane.comp.php.pear.liveuser |
|---|---|
| Organization | BackendMedia GbR |
| Message-ID | <[email protected]> |
Dan Rossi wrote: > > On 21/06/2005, at 3:05 AM, Lukas Smith wrote: > >> Dan Rossi wrote: >> >>> Here is my event dispatcher class, i may need to try and find the >>> method which is used when catching someone has not logged in and >>> forcing them to login, but before forcelogin, as that is what i >>> used for the login form :) I could use forcelogin as a method to >>> redirect to the actual login form ?? >> >> >> err .. why do you need an event before forceLogin? .. that makes no >> sense to me. do you just want to have the forceLogin event to be >> fired twice? if so you can register multiple event handler and they >> will be called in the order they have been registered. >> > > I require an event before forceLogin to do redirects, ie you have one > for a logout postLogout which can be used for redirects. The login > redirect is to redirect to a login script. Now what the issue is say my > index.php page calls the forcelogin which displays a form, I post back > to index.php to login, my index.php is loading a class which has a > methods to handle get and post, it will trigger the post method in the > index.php file too :) > > > Now say I made a redirect in forceLogin to login.php and my login.php > also requires the login class its redirecting itself. I am attempting > to get the login script which is posting to itself to use a different > events class to the rest of the scripts. However somehow now even using > the right login details i am getting a forceLogin when it was working > last night :| thats why i dont like event based programming. anyways you can get the liveuser instance inside your event handler. so you should be able to modify the observers inside any event. at the same time you could store some property inside your observers to handle this. here are the docs for the event dispatcher http://pear.php.net/manual/en/package.event.event-dispatcher.php regards, Lukas regards, Lukas Smith [email protected] _______________________________ BackendMedia www.backendmedia.com [email protected] Linn Zwoch Smith GbR Pariser Str. 44 D-10707 Berlin Tel +49 30 83 22 50 00 Fax +49 30 83 22 50 07