Class: LiveUser
Source Location: /LiveUser-0.16.8/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:
- Release: @package_version@
Copyright:
|
|
|
Inherited Variables
|
Inherited Methods
|
Class Details
Class Variables
Method Detail
LiveUser (Constructor) [line 343]
void LiveUser(
&$debug, bool|object
$debug)
|
|
Constructor. Use the factory or singleton methods.
Parameters:
arrayMergeClobber [line 661]
array|false arrayMergeClobber(
array
$a1, array
$a2)
|
|
Clobbers two arrays together. Function taken from the user notes of array_merge_recursive function used in LiveUser::readConfig() and may be called statically
Parameters:
authFactory [line 564]
object|false &authFactory(
array
&$conf, string
$containerName, [string
$classprefix = 'LiveUser_'])
|
|
Creates an instance of an auth container class.
Parameters:
checkGroup [line 1474]
bool checkGroup(
array|int
$groups)
|
|
Wrapper method for the permission object's own checkGroup method.
Parameters:
checkRight [line 1416]
int|false checkRight(
array|int
$rights)
|
|
Wrapper method for the permission object's own checkRight method. Use this method to determine if a user has a given right or set of rights.
Parameters:
checkRightLevel [line 1456]
bool checkRightLevel(
array|int
$rights, array|int
$owner_user_id, array|int
$owner_group_id)
|
|
Wrapper method for the permission object's own checkRight and checkLevel methods
Parameters:
cryptRC4Factory [line 787]
Crypt_RC4 &cryptRC4Factory(
string
$secret)
|
|
Creates an instance of the PEAR::Crypt_Rc4 class.
Parameters:
deleteRememberCookie [line 1335]
bool deleteRememberCookie(
)
|
|
Deletes the rememberMe cookie.
disconnect [line 1166]
Properly disconnect resources in the active container.
factory [line 455]
Returns an instance of the LiveUser class. This array contains private options defined by the following associative keys: array(
'debug' => false/true or an instance of a class that implements the PEAR::Log interface
'session' => array(
'name' => 'liveuser session name',
'varname' => 'liveuser session var name'
),
// The session_save_handler options are optional. If they are specified,
// session_set_save_handler() will be called with the parameters
'session_save_handler' => array(
'open' => 'name of the open function/method',
'close' => 'name of the close function/method',
'read' => 'name of the read function/method',
'write' => 'name of the write function/method',
'destroy' => 'name of the destroy function/method',
'gc' => 'name of the gc function/method',
),
// The session_cookie_params options are optional. If they are specified,
// session_set_cookie_params() will be called with the parameters
'session_cookie_params' => array(
'lifetime' => 'Cookie lifetime in days',
'path' => 'Cookie path',
'domain' => 'Cookie domain',
'secure' => 'Cookie send only over secure connections',
),
'cache_perm' => if the permission data should be cached inside the session
'login' => array(
'force' => 'Should the user be forced to login'
'regenid' => 'Should the session be regenerated on login'
),
'logout' => array(
'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 trailing slash (/) !
'secure' => 'Cookie send only over secure connections',
),
'authContainers' => array(
'name' => array(
'type' => 'auth container name',
'expireTime' => 'maximum lifetime of a session in seconds',
'idleTime' => 'maximum amount of time between two request',
'allowDuplicateHandles' => 'if to allow duplicate handles',
'allowEmptyPasswords' => 'if empty passwords are allowed',
'storage' => array(
'connection' => 'db connection object, use this or dsn',
'dsn' => 'database dsn, use this or connection',
),
'externalValues' => array(
'values' => 'reference to an array',
'keysToCheck' => 'array of keys to check in the array passed'
),
),
),
'permContainer' => array(
'type' => 'perm container name',
'storage' => array(
'storage container name' => array(
'connection' => 'db connection object, use this or dsn',
'dsn' => 'database dsn, use this or connection',
'prefix' => 'table prefix'
'tables' => 'array containing additional tables or fields in existing tables',
'fields' => 'array containing any additional or non-default field types',
'alias' => 'array containing any additional or non-default field alias',
'force_seq' => 'if the use of (emulated) sequences should forced instead of using autoincrement where applicable',
),
),
),
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 684]
bool fileExists(
string
$file)
|
|
Checks if a file exists in the include path.
Parameters:
getErrors [line 517]
Wrapper method to get errors from the Error Stack.
getOption [line 870]
mixed getOption(
string
$option)
|
|
Returns the value of an option from the configuration array.
Parameters:
getProperty [line 1541]
mixed getProperty(
string
$what, [string
$container = 'auth'])
|
|
Wrapper method to access properties from the auth and permission containers.
Parameters:
getStatus [line 1599]
init [line 930]
Tries to retrieve the auth object from session and checks possible timeouts.
isInactive [line 1526]
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 1503]
Checks if a user is logged in.
loadClass [line 534]
bool loadClass(
string
$classname, [bool
$supress_error = false])
|
|
Loads a PEAR class.
Parameters:
login [line 986]
bool login(
[string
$handle = ''], [string
$passwd = ''], [bool
$remember = false])
|
|
Tries to log the user in by trying all the Auth containers defined in the configuration file until there is a success or a failure.
Parameters:
logout [line 1374]
bool logout(
[bool
$direct = true])
|
|
This logs the user out and destroys the session object if the configuration option is set.
Parameters:
PEARLogFactory [line 755]
log &PEARLogFactory(
bool|Log
&$log)
|
|
Determines if loading of PEAR::Log is necessary. If an object is passed it is returned, otherwise Log is loaded and instantiated.
Parameters:
permFactory [line 587]
object|false &permFactory(
array
&$conf, [string
$classprefix = 'LiveUser_'])
|
|
Creates an instance of an perm container class.
Parameters:
readConfig [line 705]
bool readConfig(
array|file
&$conf, string
1)
|
|
Reads the configuration array.
Parameters:
readRememberCookie [line 1261]
bool readRememberCookie(
)
|
|
Handles the retrieval of the login data from the rememberMe cookie.
setOption [line 851]
bool setOption(
string
$option, mixed
$value)
|
|
Sets an option after the configuration array has been loaded. You can override a specific option calling this method.
Parameters:
setRememberCookie [line 1196]
bool setRememberCookie(
string
$handle, string
$passwd)
|
|
If cookies are allowed, this method checks if the user wanted a cookie to be set so he doesn't have to enter handle and password for his next login. If true, it will set the cookie.
Parameters:
singleton [line 488]
LiveUser &singleton(
array
&$conf, [string
$signature = null])
|
|
This uses the singleton pattern, making sure you have one and only instance of the class. 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 1624]
string statusMessage(
int
$value)
|
|
Return a textual status message for a LiveUser status code.
Parameters:
storageFactory [line 611]
object|false &storageFactory(
array
&$confArray, [string
$classprefix = 'LiveUser_Perm_'])
|
|
Returns an instance of a storage Container class.
Parameters:
updateProperty [line 1565]
bool updateProperty(
bool
$auth, [bool
$perm = null])
|
|
Updates the properties of the containers from the original source.
Parameters:
Documentation generated on Mon, 11 Mar 2019 14:31:52 -0400 by phpDocumentor 1.4.4. PEAR Logo Copyright © PHP Group 2004.
|
|