TITAN Library for PHP5  5.1.0
Web Software Development Kit for PHP5
auth Class Reference

Titan Authentication Class. More...

Public Member Functions

 __construct ($auth_type=NULL)
 check ($level_needed=2, $key_needed= '', $desc= '')
 login ($type= 'session', $user= '', $pass= '')
 lookup ($user, $with_pass=false)
 key ($key)
 unlock ($lock, $any_one_key=true)
 higher (&$user)
 root ()
 infolder ($folder)
 ingroup ($group)
 memberof ($group, $username= '')
 get_acct_info ($var)
 show_logout ($buffer=true)
 logout ($full=false)
 goback ($howmany= '')
 reshow ($full=true, $location= '')

Data Fields

 $level = 0
 Login level.
 $error = ''
 Error message, if any.

Protected Attributes

 $ttl_lvl1 = '+1 hour'
 TTL for username only.
 $ttl_lvl2 = '+1 hour'
 TTL for full login.

Detailed Description

Titan Authentication Class.

Class: \tl\core\auth

James E. Bush work@.nosp@m.bush.nosp@m..cc

Login levels:

0 = The user is NOT logged in.
1 = We have the user's name from a cookie, but the user is NOT logged in.
2 = The user is logged in.

Methods of determining login level:

Type          Username            Password                Result

'password'    string username     string password         level 2
'session'     session username    session password        level 2
'session'     session username    (no password)           level 1
(failed login of any type)                                level 0

Constructor & Destructor Documentation

__construct (   $auth_type = NULL)


string$auth_typeMust be one of the following:
'public'              TITAN_PLATFORM customer authentication
'admin'               TITAN_PLATFORM staff authentication
\tl\core\auth_type    Custom authentication

Member Function Documentation

check (   $level_needed = 2,
  $key_needed = '',
  $desc = '' 

Check if the user is logged in, display login form and exit if not.

string$level_needed(optional) The login level needed to continue (default) 2 = The user must be fully logged in.
string$key_needed(optional) The name of a key needed to access the application (default) '' = No key is required.
string$desc(optional) Description of the application to use if the user does not have a required key (default) ''
login (   $type = 'session',
  $user = '',
  $pass = '' 

Perform login

Use ONLY if you want to handle failed login manually.

string$passThe plain text password to encrypt
string$type(optional) Either 'session' or 'password' (default) 'session'
string$user(optional) The username to attempt login (default) ''
string$pass(optional) The password to attempt login (default) ''
integer The login level

It is up to the calling program to handle the login level appropriately.

lookup (   $user,
  $with_pass = false 

Lookup and return a user account

string$userThe username of the account to lookup
boolean$with_pass(optional) Should the returned account retain the password? (default) false = remove the password from the returned account
object A stdClass object representing the requested account.
key (   $key)

Does the user have a specific key?

string$keyThe name of the key
bolean Does the user have the key? (If the user is has "root", they have ALL keys.)
unlock (   $lock,
  $any_one_key = true 

Can the user unlock the lock(s)

string$lockThe name of the lock, or a colon-delimited string of lock names
boolean$any_one_key(optional) Does any one key unlock multople locks? If false, ALL keys are required. (default) true
bolean Can the user unlock the lock?
higher ( $user)

Does the current user have access to manage a named user?

object$userThe named user to compare to the current user
boolean Does the current user have access to manage the named user?
root ( )

Does the current user have root access?

boolean Does the current user have root access?
infolder (   $folder)

Determine if the user is in a particular AD folder (OU)

string$folderThe name of the folder to check
ingroup (   $group)

Determine if the user is a member of a particular AD group

Alias of auth->memberof()

string$groupThe name of the group to check
memberof (   $group,
  $username = '' 

Determine if the user is a member of a particular AD group

string$groupThe name of the group to check
string$username(optional) The name of the user to check (default) $this->acct->username
get_acct_info (   $var)

Get display information about the current user account.

string$varThe variable to lookup
Variable       Description                     Example

'name'         first name, space, last name    'John Doe'
'initials'     first and last name initials    'JD'
show_logout (   $buffer = true)

Return a logout link

boolean$bufferShould the link be sent to $html?
string The text of the logout link
logout (   $full = false)

Log the currnt user out

boolean$full(optional) Completely log the user out? true = level 0, false = level 1 (default) false
goback (   $howmany = '')

Dump an empty HTML page to the browser that uses JavaScript to navigate backwards through the browser's history, then exit.

integer$howmanyHow many browser history entries to navigate
reshow (   $full = true,
  $location = '' 

Dump an HTTP header to either reload the current location or redirect to a new location, then exit.

boolean$full(optional) Generate a complete URL? If false, the URL will begin with the current script. (default) true
string$location(optional) The location to load (default) '' = reload current location

The documentation for this class was generated from the following file: