Recipe 1. User Login

An intranet is a very different animal than the free-ranging Internet. Whereas designers building for the Web thrive on the number of eyeballs they capture, intranet developers place a premium on their pages being seen by just the right eyeballs. Critical to an intranet is the concept of user authentication. Before anyone can browse an intranet area, he must be authenticated against the company records, and the records, of course, are maintained in a data source by system administrators.

Much in many cases, all of a company's intranet is protected against unauthorized viewing. As you'll see in this application, the term "unauthorized" means more than "not registered." For robust authentication applications like the one you're about to build, it means "not cleared to view this particular content," and the content can be anything from an entire site down to an isolated area of a single page.

Macromedia Dreamweaver MX 2004 provides a solid foundation of user authentication tools, which we will use as the base to build our application. In all, there are eight separate pages in our application that fall into either the user or the administrator category. We do, of course, use our own authentication routines to isolate the administrator-oriented applications from those intended for all users.

graphics/50fig01.gif

Our application starts with the login page where registered users enter their usernames and passwords. If they had previously specified that it be remembered, the username field is automatically filled. If the login succeeds, users are taken to a confirmation or welcome page where they have an opportunity to update their login info. If the login fails, an error message appears on the login page itself, and they can try again. Users who have forgotten their password can visit a page to request that their password be emailed to them. The login page also provides a link for new users. After completing the registration successfully, the new users are returned to the login page, where their newly registered username is already in place.

All the pages in the application contain links to the administrative functions, but these links can only be seen by administrators, thanks to the conditional logic embedded on the page. The administrator's main page provides both a paged listing of all the users (sorted so that the newest are displayed first) and a form for entering new users. Each of the user listings is linked to a page where the administrator can modify or delete the user's record. On another page, the administrator can get an overview of user registration to see how many users are in the system and how much activity the registration system has seen over various time periods.



Macromedia Dreamweaver MX 2004 Web Application Recipes
Macromedia Dreamweaver MX 2004 Web Application Recipes
ISBN: 0735713200
EAN: 2147483647
Year: 2003
Pages: 131

flylib.com © 2008-2017.
If you may any questions please contact us: flylib@qtcs.net