Return to the EJW Associates home page About EJW | NEWS | Services | Who We help | Contact | Lightbox | Site Map | Home

HttpAuthPlus / Documentation

Authentication | Administration | Methods

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: setIdField($field_name)
  • Arguments: $field_name; string; default is 'id'
  • Usage: sets the name of the field that contains the primary key in your user table; important if you want addUser() to return the primary key of the user it just created.
  • 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 (or primary key of user created when using a db); 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: Logout()
  • Arguments: none
  • Usage: kills a user's session
  • Returns: true on success;

    ***NOT YET IMPLEMENTED***

  • Method: getLostPass($email)
  • Arguments: $email; string; email address
  • Usage: sends an email to $email with the a hash for resetting the users password.
  • 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

Authentication | Administration | Methods

Today's media is different than yesterday's, and will change tomorrow.

Following a template is not enough. Contact EJW Associates in the Atlanta, GA area for an Internet presence developed around a solid strategy… and designed to click with business-to-business markets. Current, knowledgeable Internet programs that are an integral part of a marketing plan are essential if you are to win market share today. Your brand and your profitability are on the line. Trust a trade marketing professional to develop your company’s direct marketing, web site, search marketing (SEM, SEO), email promotions, interactive banner ads, Pay per click (keyword) advertising campaigns, sales support brochure programs.