Saturday, May 22, 2010

Workshop 6

DEVELOPER’S THREAD (RED team)

To Do:

Developers may continue to build upon work with the OTBS using the topic reading to help with user registration and advanced login features from Hartl et al (2008). Some examples of work to do includes:

o generating a controller and an action by adding a method(s) to a controller;
o creating a view template for each action and to link to actions from views;
o using AJAX to improve the user experience;

After browsing a lot of online materials, I will implement the REST programming (CRUD) concept in this user registration and advanced login features section for the OTBS systems.

New user registration, login, logout, edit user and unregister a user are handle in this login section.

Two models, Session and Person will be created. Session will authenticate a user by finding the username and password in the People table. Person model will encrypt every password with 256 bits SHA2 digestion accompanied with a unique salt. The layout and user experience will be my last consideration at this moment due to the time limitation.

Create two models by:

ruby script/generate resource session
ruby script/generate resource person






















Edit the db/migrate/2010052603610_create_sessions.rb and db/migrate/20100526030647_create_people.rb to create the table in the OTBS database

Then execute rake db:migrate, an error occur due to a wrong version of libmySQL.dll. Download the correct version then the problem fixed. (take me 2 hours to figure out)













Configure the session and person model according to the specification. The username is 4-16 letters, numbers or underscores and has no space and password is 4-16 characters.

Configure the routes.rb to change to a new root_url path
map.root :controller => 'people'
delete the public/index.html file

Configure all the related controllers and views (application, session and people)

The screen captures are shown as follow:-

Home Screen















Log-in with a new user --> error message pop-up


















Go to the register screen and enter the new username and password.




















New user register successful (Welcome message) and change into the Taxi booking screen.














The people table is inserted a new user data with encrypted password and a salt.











Try to change the password by the Edit Account tab.



















Password change successful.









Unregistered the lwyuen account and a warning message pop-up on the screen.
















By answering OK, the account is unregistered.











If time is allowed, I will come back this workshop to add more features and with AJAX enhancement.

Share your success by posting progress comments and links etc to the Developers sub-forum site that has been set up for the Red team.

No comments:

Post a Comment