Thread: [Phplib-users] auth_validatelogin() excecuting twice
Brought to you by:
nhruby,
richardarcher
From: Rob H. <rob...@ws...> - 2002-10-21 02:18:31
|
Gian - Sorry to keep bothering you, I don't have a test bed set up yet. When I post from the login screen then auth_validatelogin() is being excecuted twice. Do you see the same behavior? (I'm setting up a test bed tommarrow) Rob Hutton Web Safe www.wsafe.com |
From: Giancarlo <gia...@na...> - 2002-10-21 07:26:31
|
> When I post from the login screen then auth_validatelogin() is being > excecuted twice. Do you see the same behavior? > It's when you use the login_if() further down the page, I think. Login_if reinvokes the auth->start() method. So the start method is run twice: first when the page_open is called, and again when login_if() is called. Login_if is a second, thighter check, that can be placed by hand inside particular pages that need extra login constraints, like having perm admin etc. In practice there are two 'modus operandi' in phplib's auth check: the first is relying on the general initialization of the auth class at page_open, and not touch each and every page. The second is the possibility to insert manually extra conditions in determinate pages by placing a login_if() check, that will re-pass the cascade auth->start() method, included trying to validate a login form. the auth->start() in page_open returns OK as long as you bear *any* valid auth[uid], logoin_if() then can block you, although you have a valid auth, on extra constraints. G |
From: Rob H. <rob...@ws...> - 2002-10-21 12:09:04
|
OK, Duh. One other thing. Can you give me the .10 tour of what happens when you enter an invalid user name or password. It looks to me like auth_validatelogin() returns true and nobody then recalls auth_displayform. |
From: Rob H. <rob...@ws...> - 2002-10-21 12:16:02
|
Sorry, auth_validatelogin() returns false, not true. But then auth_displayform() is never called by anyone else? > -----Original Message----- > From: php...@li... > [mailto:php...@li...]On Behalf Of Rob Hutton > Sent: Monday, October 21, 2002 8:12 AM > To: Giancarlo; Phplib-Users > Subject: RE: [Phplib-users] auth_validatelogin() excecuting twice > > > OK, Duh. > > One other thing. Can you give me the .10 tour of what happens when you > enter an invalid user name or password. It looks to me like > auth_validatelogin() returns true and nobody then recalls > auth_displayform. > > > > > > ------------------------------------------------------- > This sf.net email is sponsored by:ThinkGeek > Welcome to geek heaven. > http://thinkgeek.com/sf > _______________________________________________ > Phplib-users mailing list > Php...@li... > https://lists.sourceforge.net/lists/listinfo/phplib-users > |
From: Rob H. <rob...@ws...> - 2002-10-21 12:36:59
|
Sorry to answer myself, I figured it out. I was striping the again= in the template from this->url. One other quick note. With the current regex removal of again=, if I have more than one parameter like url?param1=something&again=log&parm2=something then after the regex I get url?param1=something&¶m2=something the url url?again=log results in url? so can the regex be added to remove duplicate && after the first or remove the ? if there are no other parameters? Thanks, Rob Hutton Web Safe www.wsafe.com > -----Original Message----- > From: php...@li... > [mailto:php...@li...]On Behalf Of Rob Hutton > Sent: Monday, October 21, 2002 8:20 AM > To: rob...@ws...; Giancarlo; Phplib-Users > Subject: RE: [Phplib-users] auth_validatelogin() excecuting twice > > > Sorry, auth_validatelogin() returns false, not true. But then > auth_displayform() is never called by anyone else? |
From: Giancarlo <gia...@na...> - 2002-10-21 19:34:40
|
> then after the regex I get > > url?param1=something&¶m2=something .. > so can the regex be added to remove duplicate && after the first or remove > the ? if there are no other parameters? I am really no good at regexp. If you say it's so it seems I'd have to fix a couple more ereg_replace around. I never learnt regexp ;-). But I can't try to fix that now Gian |
From: Aric C. <gre...@pe...> - 2002-10-21 23:51:22
|
I just happened across this function. I'm assuming that this is meant as an alternative to an auto increment field? Or to generating a random and hopefully unique number? I'm rewriting a project that uses a lot of MD5() calls to get unique numbers for things like categories and such. I thought to myself why not just use auto increment in the database. I had read that the MD5 technique was being used specificaly to reduce possible colisions when inserting new records over using auto increment. Is this nextid() function meant to solve the same problem? Because I rather like it as opposed to MD5 which returns a big long ugly string... |
From: Rob H. <rob...@ws...> - 2002-10-22 00:03:40
|
nextid is meant to replace the auto_increment functions in dbs where it either does not exist, or is hard to access. It is meant as an equalizer. There is a table, whose name is settable, that holds a list of names and values. NextID simply locks the record, increments the value by one, then unlocks it. It is a fairly sexy solution to one of those obnoxious problems that you run into when trying to write portable apps. In the setup scripts, one of them has sql to set up the table. Thanks, Rob Hutton Web Safe www.wsafe.com > -----Original Message----- > From: php...@li... > [mailto:php...@li...]On Behalf Of Aric Caley > Sent: Monday, October 21, 2002 7:51 PM > To: Phplib-Users > Subject: [Phplib-users] db->nextid() > > > I just happened across this function. > > I'm assuming that this is meant as an alternative to an auto increment > field? Or to generating a random and hopefully unique number? > > I'm rewriting a project that uses a lot of MD5() calls to get > unique numbers > for things like categories and such. I thought to myself why not just use > auto increment in the database. I had read that the MD5 > technique was being > used specificaly to reduce possible colisions when inserting new records > over using auto increment. Is this nextid() function meant to solve the > same problem? Because I rather like it as opposed to MD5 which returns a > big long ugly string... > _______________________________________________ > Phplib-users mailing list > Php...@li... > https://lists.sourceforge.net/lists/listinfo/phplib-users > |