Re: [phplib] login page help From: giancarlo pinerolo (giancarlo <email protected>)
Date: 07/12/01

step 1
activate default_authentication in your auth subclass ($nobody=true)
step 2
add user, auth, perm everywhere
step 3
make this form
<FORM action="/welcome_new_user.php?enter=yes" method=post>
Login
<INPUT name=username size=10 value="">
Password
<INPUT name=password type=password size=10 value="">
<INPUT type=submit value="login"><BR>
</FORM>

step 4

make welcome_new_user.php3 like this
<?
#normal includes and stuff here
if ($enter):
        if ($auth->auth["uid"]=$auth->auth_validatelogin()):
                page_close();
                header("Location: ". $sess->url("$PHP_SELF"));
        else:
                $login_error="TRY AGAIN;
        endif;
endif;
?>
WELCOME NEW USER

Step 5
come back and tell me. This may be everything.
                     
Giancarlo

Cresta Johnson wrote:
>
> Sorry, this may be a really lame question (I'm kind of a newbie with OOadd this form where you
> classes). When I look at the auth class (where the auth_preauth function is
> defined, it doesn't seem to do anything other than return false - which
> would invoke the login form, right?). Do I need to define my own
> auth_preauth function in a sub class?
>
> I'm worried that I'm being to confusing about what I want to accomplish. I
> am able to use phplib authentication just fine to protect the pages that I
> want to protect. When trying to access a protected page, the login page is
> invoked and then (if authenticated) the protected page is displayed. But I
> was hoping to also add a little login box to my index page (which is NOT
> protected & I don't want the login page to be called) which would allow the
> user (if they wanted to - not a requirement) to login directly from the
> index page & redirect him to the protected area. What I can't seem to do is
> save the login, password info that they type in at the index page without
> requiring them to login.
>
> Again, I'm really sorry - I might not be understanding phplib completely.
> But I've been working on this for two weeks and my deadline is looming!
>
> Thanks for your help!
>
> ----- Original Message -----
> From: "Jesse Swensen" <swensenj <email protected>>
> To: "Cresta Johnson" <cjohnson <email protected>>; <phplib <email protected>>
> Sent: Thursday, July 12, 2001 6:33 AM
> Subject: Re: [phplib] login page help
>
> > This functionality is already built into PHPLib. Use the auth_preauth
> > method in your subclass of Auth. Auth_preauth always gets called first
> and
> > returns either a uid, in which your user is authorized and your
> application
> > goes on it's merry way. Or it returns false, in which the regular
> > authorization takes place, by bringing up you login page, etc...
> >
> > So, you can do anything it the auth_preauth method to authorize the user.
> > Maybe you have a user id/password on your index page and auth_preauth
> check
> > for the existence of those variables and uses them to do the
> authorization.
> > If they don't exist returns false.
> > --
> > Jesse Swensen
> > swensenj <email protected>
> >
> > > From: "Cresta Johnson" <cjohnson <email protected>>
> > > Organization: Dzign Studio
> > > Reply-To: "Cresta Johnson" <cjohnson <email protected>>
> > > Date: Wed, 11 Jul 2001 16:48:33 -0600
> > > To: <phplib <email protected>>
> > > Subject: [phplib] login page help
> > >
> > > Hi All!
> > >
> > > I was wondering if it was possible to have a login page that wasn't
> > > protected by the phplib auth/perm functions? What I want to do is have a
> > > "quick" login button on the index page of my site (which wouldn't be
> > > protected) and after verifying the login information would redirect the
> user
> > > to another page that is protected by the phplib auth/perm functions.
> What
> > > I've tried to do so far is to send the user & password (via html
> > > form)directly to the page (that's protected) & I've also tried to send
> the
> > > information to another php script that processes the information & then
> > > redirects to the protected page. Either way, I am still having the
> > > login.ihtml page invoked. Is there anyone that's done this before and
> has a
> > > code sample that I can look at?
> > >
> > > Thanks so much!
> > >
> > > Cresta
> > >
> > >
> > > --
> > > Abbestellen mit Mail an: phplib-unsubscribe <email protected>
> > > Kommandoliste mit Mail an: phplib-help <email protected>
> > >
> >
> >
> >
> > --
> > Abbestellen mit Mail an: phplib-unsubscribe <email protected>
> > Kommandoliste mit Mail an: phplib-help <email protected>
> >
>
> --
> Abbestellen mit Mail an: phplib-unsubscribe <email protected>
> Kommandoliste mit Mail an: phplib-help <email protected>

-- 
Abbestellen mit Mail an:   phplib-unsubscribe <email protected>
Kommandoliste mit Mail an: phplib-help <email protected>