Class: LiveUser
Source Location: /LiveUser-0.11.1/LiveUser.php
PEAR
|
--LiveUser
Class LiveUser - Login handling class
Author(s):
Version:
- $Id: LiveUser.php,v 1.91 2004/04/24 17:23:12 lsmith Exp $
|
|
Inherited Variables
|
Inherited Methods
|
Class Details
Method Detail
LiveUser (Constructor) [line 212]
arrayMergeClobber [line 452]
mixed 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 402]
object Returns &authFactory(
mixed
$conf)
|
|
creates an instance of an auth object
Parameters:
checkRight [line 1189]
mixed checkRight(
mixed
$rights)
|
|
Wrapper method for the permission object's own checkRight method.
Parameters:
checkRightLevel [line 1228]
boolean checkRightLevel(
mixed
$rights, mixed
$owner_user_id, mixed
$owner_group_id)
|
|
Wrapper method for the permission object's own checkRightLevel method.
Parameters:
disconnect [line 963]
properly disconnect resources in the active container
errorMessage [line 1519]
string errorMessage(
int
$value)
|
|
Return a textual error message for a LiveUser error code.
Parameters:
factory [line 341]
object Returns &factory(
mixed
$conf, [string
$handle = ''], [string
$passwd = ''], [boolean
$logout = false], [boolean
$remember = false], [mixed
$confName = 'liveuserConfig'])
|
|
Checks the given file and returns an object of the LoginManager. 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'
),
'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, true or regenid
),
// 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'
),
'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('user_id' => 'auth_user_id',
'handle' => 'handle',
'passwd' => 'passwd',
'lastlogin' => 'lastlogin'
'owner_user_id' => 'owner_user_id'
'owner_group_id' => 'owner_group_id'
)
)
),
'permContainer' => array(
'type' => 'DB_Complex',
'connection' => 'db connection object, use this or dsn',
'dsn' => 'database dsn, use this or connection',
'prefix' => 'liveuser_'
)
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:
freeze [line 940]
store all properties in an array
getAuthContainer [line 634]
mixed &getAuthContainer(
)
|
|
Get the Auth Container class instance of it exists
getOption [line 619]
mixed getOption(
string
$option)
|
|
Returns the value of an option
Parameters:
getPermContainer [line 650]
mixed &getPermContainer(
)
|
|
Get the Perm Container class instance if it exists
getProperty [line 1362]
mixed getProperty(
string
$what, [string
$container = 'auth'])
|
|
Wrapper method to access properties from the auth and permission containers.
Parameters:
getRights [line 1388]
mixed getRights(
[boolean
$withLevels = false])
|
|
Returns a one-dimensional array with all rights assigned to this user. Array format depends on the optional parameter: true: array(intRight_ID => intRightLevel, ...)
false array(intRight_ID, ...) [Default]
If no rights are available, false is returned.
Parameters:
getStatus [line 1402]
init [line 675]
mixed 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 1506]
bool isError(
mixed
$value)
|
|
Tell whether a result from a LiveUser method is an error.
Parameters:
isInactive [line 1287]
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 == Not active false == active
isLoggedIn [line 1263]
Checks if a user is logged in.
logout [line 1112]
This destroys the session object.
permFactory [line 424]
object Returns &permFactory(
mixed
$conf)
|
|
Creates an instance of an perm object
Parameters:
raiseError [line 245]
object a &raiseError(
[mixed
$code = null], [int
$mode = null], [mixed
$options = null], [string
$userinfo = null])
|
|
This method is used to communicate an error and invoke error callbacks etc. Basically a wrapper for PEAR::raiseError without the message string.
Parameters:
setLoginFunction [line 1308]
mixed 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 1338]
mixed 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 602]
mixed setOption(
string
$option, mixed
$value)
|
|
Sets an option.
Parameters:
singleton [line 382]
object Returns &singleton(
mixed
$conf, [string
$handle = ''], [string
$passwd = ''], [boolean
$logout = false], [boolean
$remember = false], [mixed
$confName = 'liveuserConfig'])
|
|
Makes your instance global. 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:
Documentation generated on Mon, 11 Mar 2019 10:16:12 -0400 by phpDocumentor 1.4.4. PEAR Logo Copyright © PHP Group 2004.
|
|