Final Project Implementation of Basic Authentication.

Post on 02-Jan-2016

223 views 2 download

transcript

Final ProjectFinal Project

Implementation of Basic Implementation of Basic AuthenticationAuthentication

DevelopersDevelopers

GirijaGirija

SujathaSujatha

PremalathaPremalatha

Definition of AuthenticationDefinition of Authentication

Authentication is the process of Authentication is the process of determining whether someone or determining whether someone or

something is, in fact, who or what it something is, in fact, who or what it is declared to be is declared to be

ModulesModules

File Management and Handling the File Management and Handling the DatabaseDatabase

Edit Users Email and ProgramsEdit Users Email and Programs Change Password and Delete User Change Password and Delete User

Account from .htpasswd and Account from .htpasswd and DatabaseDatabase

Project DescriptionProject Description

Design and implement a new web Design and implement a new web module, which allows an admin to module, which allows an admin to manage users - issuing them manage users - issuing them accounts, edit, and delete them, accounts, edit, and delete them, while providing the user the ability to while providing the user the ability to change their password. change their password.

The admin chooses the staff's email The admin chooses the staff's email from the database list and can from the database list and can

multiple-select programs (from the multiple-select programs (from the database), from which they may database), from which they may

belong to. belong to.

Code for verifying username and Code for verifying username and passwordpassword

if ( $userlist{$username} eq if ( $userlist{$username} eq crypt($password,crypt($password,$userlist{$username}))$userlist{$username}))

{{

Print “Successfully Logged in”;Print “Successfully Logged in”;

}}

Code for saving new password in .htpasswdCode for saving new password in .htpasswd

if ( ($userlist{$username} eq if ( ($userlist{$username} eq crypt($oldpassword,crypt($oldpassword,$userlist{$username}) ) {$userlist{$username}) ) {

$userlist{$username} = $userlist{$username} = crypt($newpassword,"giri");crypt($newpassword,"giri");

&save_passwd_to_file;&save_passwd_to_file;

}}&save_passwd_to_file&save_passwd_to_fileforeach (keys(%userlist)) foreach (keys(%userlist)) { { print OUT "$_:$userlist{$_}\n";print OUT "$_:$userlist{$_}\n"; }}

Admin PageAdmin Page

User PageUser Page

Difficulties FacedDifficulties Faced

Sending email to the recipient Sending email to the recipient addressaddress

Passing variable from one file to Passing variable from one file to another fileanother file

Dealing with password encryption.Dealing with password encryption.

What we have LearntWhat we have Learnt

Learned to use sql in perl cgi Learned to use sql in perl cgi programsprograms

Became familiar with Html and mysqlBecame familiar with Html and mysqlLearned to pass variables from one Learned to pass variables from one

file to another.file to another.Learned to use subroutines. Learned to use subroutines.

Admin Flow ChartAdmin Flow Chart

Admin

Create User Account Managing the filesEdit and Delete

User account

User Flow ChartUser Flow Chart

User

Change Password

OverviewOverview

Files we used for this Project are as Files we used for this Project are as follows:follows:

Finalproject.cgi-creates mainpage for Finalproject.cgi-creates mainpage for AdminAdmin

http://perl.cs.ohlone.edu/~gen19/Finhttp://perl.cs.ohlone.edu/~gen19/FinalProject.cgialProject.cgi

Create.cgi-It creates new user and saves Create.cgi-It creates new user and saves the username and encrypted password in the username and encrypted password in .htpasswd file .It will send the username .htpasswd file .It will send the username and password to the user’s email.and password to the user’s email.

Password = welcomePassword = welcome

http://perl.cs.ohlone.edu/~gen19/create.cgihttp://perl.cs.ohlone.edu/~gen19/create.cgi

login.cgi-It allows user to login after login.cgi-It allows user to login after checking username and passwordchecking username and password. .

http://perl.cs.ohlone.edu/~gen19/logihttp://perl.cs.ohlone.edu/~gen19/login.cgi n.cgi

changepass.cgi-It allows user to changepass.cgi-It allows user to change the passwordchange the password..

http://perl.cs.ohlone.edu/~gen19/chahttp://perl.cs.ohlone.edu/~gen19/changepass.cgingepass.cgi

editemail.cgi-it gets valid username to edit their editemail.cgi-it gets valid username to edit their emailsemails. .

http://perl.cs.ohlone.edu/~gen19/editemail.cgihttp://perl.cs.ohlone.edu/~gen19/editemail.cgi

newemail.cgi-It gets the new email to be editednewemail.cgi-It gets the new email to be edited. .

http://perl.cs.ohlone.edu/~gen19/newemail.cgi http://perl.cs.ohlone.edu/~gen19/newemail.cgi

updateemail.cgi-It updates new email in updateemail.cgi-It updates new email in database. [Tablename:gen19_userinfo]database. [Tablename:gen19_userinfo]

http://perl.cs.ohlone.edu/~gen19/updateemhttp://perl.cs.ohlone.edu/~gen19/updateemail.cgiail.cgi

editprogram.cgi-it gets valid username to editprogram.cgi-it gets valid username to edit their programsedit their programs..

http://perl.cs.ohlone.edu/~gen19/editprograhttp://perl.cs.ohlone.edu/~gen19/editprogram.cgim.cgi

newprogram.cgi-It gets the new program to be newprogram.cgi-It gets the new program to be editededited..

http://perl.cs.ohlone.edu/~gen19/newprogram.chttp://perl.cs.ohlone.edu/~gen19/newprogram.cgigi

updateprogram.cgi-It updates new program in updateprogram.cgi-It updates new program in database. [Tablename:gen19_userinfo]database. [Tablename:gen19_userinfo]

http://perl.cs.ohlone.edu/~gen19/updateprograhttp://perl.cs.ohlone.edu/~gen19/updateprogram.cgim.cgi

delete.cgi-It deletes the record from delete.cgi-It deletes the record from database and .htpasswd file.database and .htpasswd file.

http://perl.cs.ohlone.edu/~gen19/delhttp://perl.cs.ohlone.edu/~gen19/delete.cgiete.cgi

Thank YouThank You

Many thanks to Prof Jon Degallier for Many thanks to Prof Jon Degallier for helping us with our learning process.helping us with our learning process.

The Discussion Board is very useful The Discussion Board is very useful to help each other. We really to help each other. We really appreciate it and thanks to all. appreciate it and thanks to all.