Re: Using Auth
| From: | Justin Patrin | Date: | Sun, 28 Nov 2004 19:19:38 +0000 |
| Subject: | Re: Using Auth | ||
| References: | 1 | Groups: | php.pear.general |
| Request: | Send a blank email to pear-general+get-15875@lists.php.net to get a copy of this message | ||
On Sun, 28 Nov 2004 03:16:35 -0800 (PST), Rupsi Kegelmann
<rupsikegelmann@yahoo.com> wrote:
> Hi,
>
> I am planning on using PEAR for a new project. For the
> login process, I have the following requirements:
>
> 1. The user can login via a login form, requesting
> user name and password
> 2. If the login fails, the request is redirected back
> to the login page, displaying an error message ("Login
> failed - try again")
> 3. If the login succeeds, the main page is displayed
> 4. Whenever an unauthorized user tries to access a
> page within the application other than the login page,
> he is redirected to the login page
>
> I want to realize this procedure using the PEAR Auth
> package. However, the documentation seems relatively
> opaque to me. Regarding the example given at
>
> http://pear.php.net/manual/en/package.authentication.auth.intro.php,
>
> I have the following questions:
>
> 1. Is the Auth package appropriate for the intended
> use (as described above)?
> 2. At which point in the given example script is the
> login screen actually displayed (i.e. "loginFunction"
> called)?
> 3. What does a->start() actually do? The docs say, it
> starts the authentication process, but what does that
> mean?
> 4. How does the control flow in the script work? It
> seems to me that the script has to be called at least
> twice, the first time to output the login screen for
> the user, the second time to verify the login data,
> after the user has pressed the submit button.
> 5. The script shows how a successful login attempt is
> handled. But, how is it possible to react to an
> unsuccessful attempt as described above, by displaying
> the login screen with an error message?
> 6. How can point (4) of the requirements be realized?
>
Try actually running the example, it may clear things up. I'm positive
that you can do all of that with PEAR::Auth very easily.
--
Justin Patrin