Class: LiveUser_Admin
Source Location: /LiveUser-0.11.1/Admin/Admin.php
Attempt at a unified admin class
Author(s):
- Lukas Smith
- Arnaud Limbourg
Version:
- $Id: Admin.php,v 1.23 2004/04/25 17:12:08 dufuz Exp $
|
|
|
Inherited Variables
|
Inherited Methods
|
Class Details
[line 92]
Attempt at a unified admin class Simple usage: $conf = array(
'autoInit' => false/true,
'session' => array(
'name' => 'liveuser session name',
'varname' => 'liveuser session var name'
),
'login' => array(
'method' => '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(
'trigger' => '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'
),
// 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'
)
)
),
'permContainer' => array(
'type' => 'DB_Complex',
'connection' => 'db connection object, use this or dsn',
'dsn' => 'database dsn, use this or connection',
'prefix' => 'liveuser_'
)
if ($found) {
}
Class Variables
Method Detail
LiveUser_Admin (Constructor) [line 151]
void LiveUser_Admin(
array
$conf, string
$lang)
|
|
Constructor
Parameters:
addUser [line 372]
mixed addUser(
string
$handle, string
$password, [boolean
$active = true], [int
$id = null], [integer
$owner_user_id = null], [integer
$owner_group_id = null], [array
$customFields = array()])
|
|
Tries to add a user to both containers. If the optional $id parameter is passed it will be used for both containers. In any case the auth and perm id will be equal when using this method. If this behaviour doesn't suit your needs please consider using directly the concerned method. This method is just implement to simplify things a bit and should satisfy most user needs. Note type is optional for DB, thus it's needed for MDB and MDB2, we recommend that you use type even though you use DB, so if you change to MDB[2], it will be no problem for you. usage example for addUser: $custom = array(
array('name' => 'name', 'value' => 'asdf', 'type' => 'text'),
array('name' => 'email', 'value' => 'fleh@example.com', 'type' => 'text')
);
$user_id = $admin->addUser('johndoe', 'dummypass', true , null , null , null , $custom);
Untested: it most likely doesn't work.
Parameters:
getUser [line 523]
mixed getUser(
mixed
$userId, [array
$customFields = array()])
|
|
Finds and gets userinfo by his userID, customFields can also be gotten Untested: it most likely doesn't work.
Parameters:
removeUser [line 455]
mixed removeUser(
mixed
$authId)
|
|
Removes user from both containers Untested: it most likely doesn't work.
Parameters:
searchUsers [line 494]
mixed searchUsers(
[array
$filters = array()], [array
$customFields = array()], [string
$order = null], [boolean
$rekey = false])
|
|
Searches users with given filters and returns all users found with their handle, passwd, auth_user_id lastlogin, is_active and the customFields if they are specified Untested: it most likely doesn't work.
Parameters:
setAdminAuthContainer [line 244]
boolean setAdminAuthContainer(
string
$authName)
|
|
Sets the current auth container to the one with the given auth container name Upon success it will return true. You can then access the auth backend container by using the auth property of this class. e.g.: $admin->auth->addUser();
Parameters:
setAdminContainers [line 297]
boolean setAdminContainers(
[mixed
$authId = null])
|
|
Tries to find a user in any of the auth container. Upon success it will return true. You can then access the backend container by using the auth and perm properties of this class. e.g.: $admin->perm->updateAuthUserId();
Parameters:
setAdminPermContainer [line 272]
boolean setAdminPermContainer(
)
|
|
Sets the perm container Upon success it will return true. You can then access the perm backend container by using the perm properties of this class. e.g.: $admin->perm->addUser();
setConfArray [line 170]
boolean setConfArray(
array
$conf)
|
|
Merges the current configuration array with configuration array pases along with the method call.
Parameters:
updateUser [line 422]
mixed updateUser(
string
$authId, string
$handle, boolean
$password, [int
$active = true], [integer
$owner_user_id = null], [integer
$owner_group_id = null], [array
$customFields = array()])
|
|
Tried to changes user data for both containers. Note type is optional for DB, thus it's needed for MDB and MDB2, we recommend that you use type even though you use DB, so if you change to MDB[2], it will be no problem for you. usage example for updateUser: $custom = array(
array('name' => 'name', 'value' => 'asdfUpdated', 'type' => 'text'),
array('name' => 'email', 'value' => 'fleh@example.comUpdated', 'type' => 'text')
);
$admin->updateUser($user_id, 'johndoe', 'dummypass', true , null , null , $custom);
Untested: it most likely doesn't work.
Parameters:
Documentation generated on Mon, 11 Mar 2019 10:16:10 -0400 by phpDocumentor 1.4.4. PEAR Logo Copyright © PHP Group 2004.
|
|