Procedure Model Type: ( )Web Page ( )CGI Script (X)Shared Library ( )System API Name: lib/Login.pm Assigned to: Reference: |
|
Description |
This module manages login sessions for the system. Its public methods are called by CGI scripts to determine if the user is properly authenticated on the system and has currently valid credentials. The Constructor assumes that the user has been authenticated by the login.cgi script. As such, it accepts the call to create the session token, but does no additional checks on the authenticity of the user. |
Implementation Skills |
PERL, SQL, MySQL |
Parameter List |
Username, access_level |
Called By: |
user/login.cgi |
Can Call: |
Http_Sessions database. |
Function Description |
HTTP_Sessions database Sessions table: +-------------+---------------+------+-----+---------+-------+ | Field | Type | Null | Key | Default | Extra | +-------------+---------------+------+-----+---------+-------+ | User_Name | varchar(20) | | PRI | | | | Session_Tok | varchar(32) | | | | | | Access_Level| int | | | 0 | | | TimeStamp | timestamp(14) | YES | | NULL | | +-------------+---------------+------+-----+---------+-------+ Constructor(UserName, Access_Level) method:
getLogin() method:
getUserName(Login) method:
getAccessLevel(Login) method:
destroy(UserName) method:
|
Possible Exit Conditions and Return Values |
A Login object with undefined properties indicates that the system failed to find any credentials for this user. This test is usually performed by using the getLogin() method to get a Login object and then calling the getUserName(Login) method with the Login object returned by the getLogin method. If the getUserName method returns an undefined value, then the credentials do not exist or there is a system problem. Note that this class does not test for the age of a set of credentials although such a test can be included by having the getLogin method test the age of the session token by looking at the timestamp value in the Sessions table. |
Sign Off by: |
Project Manager. |