[Phplib-users] Re: Default access and a log-in box
Brought to you by:
nhruby,
richardarcher
From: Michael F. <mai...@ya...> - 2001-08-21 07:27:13
|
Maybe optimistically, I'm trying for case B! > you want to show a login form in a common page that, when submitted, > comes back to that same page The top of the page, and the log-in box (modified loginform.ihtml) show up, but nothing below that. As you suggested, the mistake seems to be in calling $auth->auth_loginform rather than echoing it ... Anyway, now the archives are back, I'll follow the earlier thread and try and work out exactly what should be going on. Thanks Michael ----- Original Message ----- From: "giancarlo pinerolo" <gia...@na...> To: <php...@li...> Sent: Monday, August 20, 2001 9:33 PM Subject: [Phplib-users] Re: Default access and a log-in box > > I'm trying to include a log-in box within a normal page so that users = > > can register and access further information and functions.=20 > > > > I've managed default access but once I include the log-in box, it = > > protects the content further down the page. I'm sure I've over-looked = > > the obvious, but if anyone could suggest an example to learn from ... > > What do you mean by 'it protects the content further down the page'? > Does only a part of the page show up? or the loginform.ihtml page? > > There are two cases: > a) you want to show a login form in a common page that, when submitted, > drives to another page > b) you want to show a login form in a common page that, when submitted, > comes back to that same page > > > for case a) you don't need any feature in the containing page, not even > session. You need at least session and auth in the 'after login' page > for case b) you need session+default auth in the containing page, (which > is also the after login page) > > case a) is a lot simpler. you set a form in pagea with action=pageb.php > and the two input fields username and password, in pageb.php you do: > > <? > page_open(array("sess" => "Example_Session", > "auth" => "Example_Auth", // you need this > "perm" => "Example_Perm", "user" => "Example_User")); > > if (!$auth->auth["uid"]=$auth->auth_validatelogin()) > { > $auth->login_if("doit"); > } > ?> > WELCOME USER > <? > page_close(); > > > case b) is more compliacted. > as pagea.php, in this case acts as both the sending and receiving page, > you need default auth here. and redirect to itself. I'll like this > popular hack to be canonicized somehow. as the back button and > cancel-login button hacks. > get some ideas from > http://www.geocrawler.com/archives/3/195/2001/7/300/6167151/ > but set the action to $PHP_SELF and echo the form instead of calling > $auth->auth_loginform > > I can't tell you more about case b) , see if case a) fits for you first. > > Giancarlo > > > _______________________________________________ > Phplib-users mailing list > Php...@li... > http://lists.sourceforge.net/lists/listinfo/phplib-users > _________________________________________________________ Do You Yahoo!? Get your free @yahoo.com address at http://mail.yahoo.com |