Class: LiveUser
Source Location: /LiveUser-0.13.0/LiveUser.php
This is a manager class for a user login system using the LiveUser class. It creates a LiveUser object, takes care of the whole login process and stores the LiveUser object in a session.
Author(s):
Version:
- $Id: LiveUser.php,v 1.119 2004/09/14 19:37:53 arnaud Exp $
|
|
Inherited Variables
|
Inherited Methods
|
Class Details
Method Detail
LiveUser (Constructor) [line 290]
addErrorLog [line 665]
boolean addErrorLog(
Log
&$log)
|
|
Add error logger for use by Errorstack. Be aware that if you need add a log at the beginning of your code if you want it to be effective. A log will only be taken into account after it's added. Sample usage:
$logger = &Log::factory('mail', 'bug@example.com',
'myapp_debug_mail_log', array('from' => 'application_bug@example.com'));
Parameters:
arrayMergeClobber [line 557]
array|false arrayMergeClobber(
array
$a1, array
$a2)
|
|
Clobbers two arrays together taken from the user notes of array_merge_recursive used in LiveUser::_readConfig() may be called statically
Parameters:
authFactory [line 517]
object|false &authFactory(
array|file
$conf)
|
|
Creates an instance of an auth object
Parameters:
checkRight [line 1434]
int|false checkRight(
array|int
$rights)
|
|
Wrapper method for the permission object's own checkRight method.
Parameters:
checkRightLevel [line 1476]
boolean checkRightLevel(
array|int
$rights, array|int
$owner_user_id, array|int
$owner_group_id)
|
|
Wrapper method for the permission object's own checkRightLevel method.
Parameters:
CryptRC4Factory [line 677]
object Returns &CryptRC4Factory(
string
$secret)
|
|
Creates an instance of the PEAR::Crypt_Rc4 class
Parameters:
disconnect [line 1123]
Properly disconnect resources in the active container
factory [line 410]
LiveUser|false &factory(
mixed
$conf, [string
$handle = ''], [string
$passwd = ''], [boolean
$logout = false], [boolean
$remember = false], [mixed
$confName = 'liveuserConfig'])
|
|
Returns an instance of the login manager class. This array contains private options defined by the following associative keys: array(
'autoInit' => false/true,
'session' => array(
'name' => 'liveuser session name',
'varname' => 'liveuser session var name'
),
'login' => array(
'method' => 'request, get or post',
'username' => 'Form input containing user handle',
'password' => 'Form input containing password',
'remember' => '(optional) Form checkbox containing <Remember Me> info',
'function' => '(optional) Function to be called when accessing a page without logging in first',
'force' => 'Should the user be forced to login'
'regenid' => 'Should the session be regenerated on login'
),
'logout' => array(
'method' => 'request, get or post',
'trigger' => 'REQUEST, GET or POST var that triggers the logout process',
'redirect' => 'Page path to be redirected to after logout',
'function' => '(optional) Function to be called when accessing a page without logging in first',
'destroy' => 'Whether to destroy the session on logout' false or true
),
// The cookie options are optional. If they are specified, the Remember Me
// feature is activated.
'cookie' => array(
'name' => 'Name of Remember Me cookie',
'lifetime' => 'Cookie lifetime in days',
'path' => 'Cookie path',
'domain' => 'Cookie domain',
'secret' => 'Secret key used for cookie value encryption',
'savedir' => '/absolute/path/to/writeable/directory' // No / at the end !
),
'authContainers' => array(
'name' => array(
'type' => 'DB',
'connection' => 'db connection object, use this or dsn',
'dsn' => 'database dsn, use this or connection',
'loginTimeout' => 0,
'expireTime' => 3600,
'idleTime' => 1800,
'allowDuplicateHandles' => 0,
'authTable' => 'liveuser_users',
'authTableCols' => array(
'required' => array(
'auth_user_id' => array('type' => 'text', 'name' => 'user_id'),
'handle' => array('type' => 'text', 'name' => 'handle'),
'passwd' => array('type' => 'text', 'name' => 'passwd')
),
'optional' => array(
'owner_user_id' => array('type' => 'integer', 'name' => 'owner_user_id'),
'owner_group_id' => array('type' => 'integer', 'name' => 'owner_group_id')
'lastlogin' => array('type' => 'timestamp', 'name' => 'lastlogin'),
'is_active' => array('type' => 'boolean', 'name' => 'is_active')
),
'custom' => array(
'myaliasforfield1' => array('type' => 'text', 'name' => 'myfield1')
)
)
)
),
'permContainer' => array(
'type' => 'DB_Complex',
'connection' => 'db connection object, use this or dsn',
'dsn' => 'database dsn, use this or connection',
'prefix' => 'liveuser_',
'groupTableCols' => array(
'required' => array(
'group_id' => array('type' => 'integer', 'name' => 'group_id')
'group_define_name' => array('type' => 'text', 'name' => 'group_define_name')
),
'optional' => array(
'group_type' => array('type' => 'integer', 'name' => 'group_type')
'is_active' => array('type' => 'boolean', 'name' => 'is_active')
'owner_user_id' => array('type' => 'integer', 'name' => 'owner_user_id'),
'owner_group_id' => array('type' => 'integer', 'name' => 'owner_group_id')
),
'custom' => array(
'myaliasforfield1' => array('type' => 'text', 'name' => 'myfield1')
)
)
Other options in the configuration file relative to the Auth and Perm containers depend on what the containers expect. Refer to the Containers documentation. The examples for containers provided are just general do not reflect all the options for all containers.
Parameters:
fileExists [line 582]
boolean fileExists(
string
$file)
|
|
checks if a file exists in the include path
Parameters:
freeze [line 1097]
Store all properties in an array
getAuthContainer [line 764]
mixed &getAuthContainer(
)
|
|
Get the Auth Container class instance of it exists
getOption [line 749]
mixed getOption(
string
$option)
|
|
Returns the value of an option
Parameters:
getPermContainer [line 778]
mixed &getPermContainer(
)
|
|
Get the Perm Container class instance if it exists
getProperty [line 1583]
mixed getProperty(
string
$what, [string
$container = 'auth'])
|
|
Wrapper method to access properties from the auth and permission containers.
Parameters:
getStatus [line 1600]
init [line 802]
boolean init(
[string
$handle = ''], [string
$passwd = ''], [boolean
$logout = false], [boolean
$remember = false])
|
|
Tries to retrieve auth object from session. If this fails, the class attempts a login based on cookie or form information (depends on class settings). Returns true if a auth object was successfully retrieved or created. Otherwise, false is returned.
Parameters:
isError [line 1612]
bool isError(
mixed
$value)
|
|
Tell whether a result from a LiveUser method is an error.
Parameters:
isInactive [line 1519]
Function that determines if the user exists but hasn't yet been declared "active" by an administrator. Use this to check if this was the reason why a user was not able to login. true == user account is NOT active false == user account is active
isLoggedIn [line 1497]
Checks if a user is logged in.
loadClass [line 492]
boolean loadClass(
string
$classname)
|
|
Loads a PEAR class
Parameters:
logout [line 1362]
void logout(
[boolean
$direct = true])
|
|
This destroys the session object.
Parameters:
permFactory [line 535]
object|false &permFactory(
mixed
$conf)
|
|
Creates an instance of an perm object
Parameters:
setLoginFunction [line 1537]
boolean setLoginFunction(
string
$functionName)
|
|
Sets a callback login function. The user can set a function that will be called if the user tries to access a page wihout logging in first. It will receive the liveuser object. If an empty string or a non-existent function is passed it deactivates the call.
Parameters:
setLogoutFunction [line 1563]
boolean setLogoutFunction(
string
$functionName)
|
|
Sets a callback logout function. The user can set a function that will be called if the user wants to logout (by providing the appropriate GET-parameter). If an empty string or a non-existent function is passed it deactivates the call. Attention: Don't use a die() or exit() statement in your logout function.
Otherwise the user can't be logged out properly.
Parameters:
setOption [line 732]
boolean setOption(
string
$option, mixed
$value)
|
|
Sets an option.
Parameters:
singleton [line 470]
LiveUser|false &singleton(
array|file
$conf, [string
$handle = ''], [string
$passwd = ''], [boolean
$logout = false], [boolean
$remember = false], [string
$confName = 'liveuserConfig'])
|
|
Makes your instance global. In PHP4 you MUST call this method with the
$var = &LiveUser::singleton() syntax.
Without the ampersand (&) in front of the method name, you will not get
a reference, you will get a copy.
Parameters:
statusMessage [line 1636]
string statusMessage(
int
$value)
|
|
Return a textual status message for a LiveUser status code.
Parameters:
__toString [line 1624]
make a string representation of the object
Documentation generated on Mon, 11 Mar 2019 13:56:17 -0400 by phpDocumentor 1.4.4. PEAR Logo Copyright © PHP Group 2004.
|
|