Using Auth
| From: | Rupsi Kegelmann | Date: | Sun, 28 Nov 2004 11:16:35 +0000 |
| Subject: | Using Auth | ||
| Groups: | php.pear.general | ||
| Request: | Send a blank email to pear-general+get-15866@lists.php.net to get a copy of this message | ||
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?
thx
rupsi
__________________________________
Do you Yahoo!?
Read only the mail you want - Yahoo! Mail SpamGuard.
http://promotions.yahoo.com/new_mail