Class: LiveUser
Source Location: /LiveUser-0.16.14/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 669]
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 572]
object|false &authFactory(
array
&$conf, string
$containerName, [string
$classprefix = 'LiveUser_'])
|
|
Creates an instance of an auth container class.
Parameters:
checkGroup [line 1611]
bool checkGroup(
array|int
$groups)
|
|
Wrapper method for the permission object's own checkGroup method.
Parameters:
checkRight [line 1553]
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 1593]
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:
classExists [line 720]
bool classExists(
string
$classname)
|
|
Checks if a class exists without triggering __autoload
Parameters:
cryptRC4 [line 934]
string cryptRC4(
string
$data, string
$secret, [bool
$crypt = true])
|
|
Crypts data using mcrypt or userland if not available.
Parameters:
cryptRC4Factory [line 914]
Crypt_RC4 &cryptRC4Factory(
string
$secret)
|
|
Creates an instance of the PEAR::Crypt_Rc4 class.
Parameters:
decryptPW [line 843]
string decryptPW(
string
$encryptedPW, string
$passwordEncryptionMode,
$secret)
|
|
Decrypts a password so that it can be compared with the user input. Uses the algorithm defined in the passwordEncryptionMode parameter.
Parameters:
deleteRememberCookie [line 1472]
bool deleteRememberCookie(
)
|
|
Deletes the rememberMe cookie.
disconnect [line 1296]
Properly disconnect resources in the active container.
encryptPW [line 873]
string encryptPW(
string
$plainPW, string
$passwordEncryptionMode, string
$secret)
|
|
Encrypts a password for storage in a backend container. Uses the algorithm defined in the passwordEncryptionMode parameter.
Parameters:
factory [line 463]
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',
'httponly' => 'HHTP only cookie, PHP 5.2.0+ only',
),
'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',
'httponly' => 'HHTP only cookie, PHP 5.2.0+ only',
),
'authContainers' => array(
'name' => array(
'type' => 'auth container name',
'expireTime' => 'maximum lifetime of a session in seconds',
'idleTime' => 'maximum amount of time between two request',
'passwordEncryptionMode'=> 'what encryption method to use',
'secret' => 'secret to use in password encryption',
'storage' => array(
'dbc' => 'db connection object, use this or dsn',
'dsn' => 'database dsn, use this or connection',
'handles' => 'array of handle fields to find a user on login, a user
can login with his username, email or any field you set here;
works with DB, MDB, MDB2 and PDO containers',
),
'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(
'dbc' => '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 692]
bool fileExists(
string
$file)
|
|
Checks if a file exists in the include path.
Parameters:
getErrors [line 525]
Wrapper method to get errors from the Error Stack.
getOption [line 997]
mixed getOption(
string
$option)
|
|
Returns the value of an option from the configuration array.
Parameters:
getProperty [line 1678]
mixed getProperty(
string
$what, [string
$container = 'auth'])
|
|
Wrapper method to access properties from the auth and permission containers.
Parameters:
getStatus [line 1737]
init [line 1058]
Tries to retrieve the auth object from session and checks possible timeouts.
isInactive [line 1663]
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 1640]
Checks if a user is logged in.
loadClass [line 542]
bool loadClass(
string
$classname, [bool
$supress_error = false])
|
|
Loads a PEAR class.
Parameters:
login [line 1115]
bool login(
[string
$handle = ''], [string
$passwd = ''], [bool
$remember = false], [bool|int
$auth_user_id = 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 1511]
bool logout(
[bool
$direct = true])
|
|
This logs the user out and destroys the session object if the configuration option is set.
Parameters:
PEARLogFactory [line 793]
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 595]
object|false &permFactory(
array
&$conf, [string
$classprefix = 'LiveUser_'])
|
|
Creates an instance of an perm container class.
Parameters:
readConfig [line 738]
bool readConfig(
array|file
$conf, string
1)
|
|
Reads the configuration array.
Parameters:
readRememberCookie [line 1404]
bool readRememberCookie(
)
|
|
Handles the retrieval of the login data from the rememberMe cookie.
setOption [line 978]
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 1326]
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 496]
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 1764]
string statusMessage(
[int|array
$value = null])
|
|
Return a textual status message for a LiveUser status code.
Parameters:
storageFactory [line 619]
object|false &storageFactory(
array
&$confArray, [string
$classprefix = 'LiveUser_Perm_'])
|
|
Returns an instance of a storage Container class.
Parameters:
updateProperty [line 1702]
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 15:40:13 -0400 by phpDocumentor 1.4.4. PEAR Logo Copyright © PHP Group 2004.
|
|