HttpAuthPlus:
Authentication | Administration
| Method Documentation
HttpAuthPlus
Methods
- Method: HttpAuthPlus()
- Arguments: none
- Usage: constructor;
sets the defaults for variables
- Returns: nothing
- Method: setAuthEncrypt($type)
- Arguments: $type;
options are: 'crypt' or 'plain-text'; default is 'plain-text'
- Usage: sets
the way in which passwords are stored
- Returns: nothing
- Method: setAuthType($type)
- Arguments: $type;
options are: 'file' or 'db'; deafult is 'db'
- Usage: determines
if a database or flat-file will be used for authentication
- Returns: nothing
- Method: setAuthFile($file)
- Arguments: $file;
password file; default is '~/users/password'
- Usage: sets
the full pathto the file to use for authentication
- Returns: nothing
- Method: setFieldDel($delimeter)
- Arguments: $delimeter;
string; default is '|'
- Usage: sets
the delimeter to use when parsing & writing user records to a flat-file.
- Returns: nothing
- Method: setAuthRealm($realm)
- Arguments: $realm;
string; default is 'HttpAuthPlus'
- Usage: sets
the string displayed as the 'Realm' in the login prompt
- Returns: nothing
- Method: setDbType($type)
- Arguments: $type;
options are: ibase, msql, mssql, mysql, oci8, odbc, pgsql and sybase; default
is 'mysql'
- Usage: sets
the type of database to use for authentication
- Returns: nothing
- Method: setDbProtocol($protocol)
- Arguments: $protocol;
options are: 'tcp', 'unix', more?; default is 'tcp'
- Usage: sets
the protocol to use when connecting to the database
- Returns: nothing
- Method: setDbPort($port)
- Arguments: $port;
the port to connect to on the database server; default is '3306'
- Usage: sets
the port to connect to on the database server
- Returns: nothing
- Method: setDbHost($host)
- Arguments: $host;
string; hostname or ip; default is 'localhost'
- Usage: sets
the hostname of the database server to connect to
- Returns: nothing
- Method: setDbUser($username)
- Arguments: $username;
string; default is '' aka NULL
- Usage: sets
the username to use when connecting to the database server
- Returns: nothing
- Method: setDbPass($password)
- Arguments: $password;
string; default is '' aka NULL
- Usage: sets
the password to use when connecting to the database server
- Returns: nothing
- Method: setDbName($db_name)
- Arguments: $db_name;
string; default is '' aka NULL
- Usage: sets
the name of the database to use once connected
- Returns: nothing
- Method: setTableName($tbl_name)
- Arguments: $tbl_name;
string; default is 'user'
- Usage: sets
the name of the table in the database that will be used for authentication
- Returns: nothing
- Method: setUsernameField($field_name)
- Arguments: $field_name;
string; default is 'username'
- Usage: sets
the name of the field that contains the username
- Returns: nothing
- Method: setPasswordField($field_name)
- Arguments: $field_name;
string; default is 'password'
- Usage: sets
the name of the field that contains the password
- Returns: nothing
- Method: setEmailField($field_name)
- Arguments: $field_name;
string; default is 'email'
- Usage: sets
the name of the field that contains the email
- Returns: nothing
- Method: setLoginFailedMsg($string)
- Arguments: $string;
string; default is 'Authentication Failed'
- Usage: sets
the message a user gets when they fail authentication
- Returns: nothing
- Method: getAuthStatus()
- Arguments: none
- Usage: returns
a users current login status; false = not logged in; true = already logged
in
- Returns: true
or false
- Method: AuthUser()
- Arguments: none
- Usage: forces
a user to authenticate if they have not already
- Returns: true
if user authenticates successfully; false on error; loops on login failure
until browser quits allowing attempts
- Method: AddUser($username,
$password, $email)
- Arguments: $username
string; $password string; $email string
- Usage: adds
a new user to the database or file
- Returns: true
on success; false on failure
- Method: EditUser($username,
$newusername, $password, $email, $newemail)
- Arguments:
$username string - the original username of the user you are editing,
$newusername string - the new username for $username,
$password string -the new password for $username,
$email string - the original email address for $username
$newemail string - the new email address for $username
- Usage: updates
a user's record in either a database or file
- Returns: true
on success; false on failure
- Method: RmUser($username)
- Arguments: $username;
string
- Usage: removes
the record for $username
- Returns: true
on success; false on failure
- Method: setMailFrom($email)
- Arguments: $email;
string email address; default is '' aka NULL
- Usage: sets
the FROM header to be used when send users their forgotten passwords via email
- Returns: nothing
- Method: setLostPassMsg($string)
- Arguments: $string;
string; default is '' aka NULL
- Usage: sets
the message to be used when sending users their forgotten username/password
special values must be present somewhere in the string for user specific username/password
substitution. '<username>' gets substituted with $user's username, '<password>'
gets substituted with $user's password
- Returns: nothing
HttpAuthPlus:
Authentication | Administration
| Method Documentation