5/15/2009

Workshop 6 -part 2

To D0 - part2.
B. Create login page
B1. Create a controller named checkauth for handling some events, for example, logout, session timeout, logged-in redirection(see figure 1.)


Figure 1.
B2. Edit the checkauth controller with the following code (see figure 2.)
i.) pass_login method is used when the user login information has been verified.
ii.) logout method is used when the user logs out the system.
iii.) check_auth is used when the session is invaild.


Figure 2.


B3. Create a method name login in the user controller with following code. (see figure 3.)
The login method mainly is doing:
i.) Collect value of the variable named "login" and "password".
ii.)Check the user name and password whether is vaild, if it is correct, redirect to passengers' index page, if it is incorrect, prompt out an error message.


Figure 3.

B4. Create a user view named register.rhtml with following code. (see figure 4.)

Figure 4.


B5. Restart the TaxiApp project and navigate to login page. (see figure 5.)


Figure 5.

B6. Test login page

i.) Input a wrong login info. (see figure 6.)

Figure 6.


ii.) Input a correct login information. (see figure 7.)

Figure 7.

iii.) Click the link named "Register here". (see figure 8.)


Figure 8.

沒有留言:

發佈留言