Class: LiveUser_Admin_Auth_Container_DB
Source Location: /LiveUser-0.11.1/Admin/Auth/Container/DB.php
LiveUser_Admin_Auth_Common
|
--LiveUser_Admin_Auth_Container_DB
Class LiveUser_Admin_Auth_DB
Author(s):
Version:
- $Id: DB.php,v 1.46 2004/04/27 00:06:23 dufuz Exp $
|
|
|
Inherited Variables
|
Inherited Methods
|
Class Details
Class Variables
Method Detail
LiveUser_Admin_Auth_Container_DB (Constructor) [line 166]
void LiveUser_Admin_Auth_Container_DB(
array
&$connectOptions, [
$name = null])
|
|
Constructor The second parameters expects an array containing the parameters for the given container. Say you have a conf array like that 'authContainers' => array(
array(
'type' => 'DB',
'loginTimeout' => 0,
'expireTime' => 3600,
'idleTime' => 1800,
'allowDuplicateHandles' => 0,
'authTable' => 'users',
'authTableCols' => array(
'user_id' => 'auth_user_id',
'handle' => 'handle',
'passwd' => 'passwd',
'lastlogin' => 'lastlogin',
'is_active' => 'is_active',
'owner_user_id' => 'owner_user_id',
'owner_group_id' => 'owner_group_id'
)
)
),
This class expects only the array containing configuration options of the auth container you wish to administrate. This is done in case you have several DB based auth containers. See PEAR::DB documentation for DSN specifications. $conf =
array(
'type' => 'DB',
'loginTimeout' => 0,
'expireTime' => 3600,
'idleTime' => 1800,
'passwordEncryptionMode' => 'MD5',
'allowDuplicateHandles' => 0,
'authTable' => 'users',
'dsn' => 'type://user:pass@host/database',
'authTableCols' => array(
'user_id' => 'auth_user_id',
'handle' => 'handle',
'passwd' => 'passwd',
'lastlogin' => 'lastlogin',
'is_active' => 'is_active',
'owner_user_id' => 'owner_user_id',
'owner_group_id' => 'owner_group_id'
)
);
Parameters:
addUser [line 203]
mixed addUser(
string
$handle, [string
$password = ''], [boolean
$active = true], [integer
$owner_user_id = null], [integer
$owner_group_id = null], [mixed
$authId = null], [array
$customFields = array()])
|
|
Adds a new user to Auth/DB.
Overrides LiveUser_Admin_Auth_Common::addUser() (Adds a new user to Auth.)
Parameters:
getUsers [line 438]
mixed getUsers(
[array
$filters = array()], [array
$addCustomFields = array()], [string
$order = null], [boolean
$rekey = false])
|
|
Gets all users with handle, passwd, auth_user_id lastlogin, is_active and individual rights. The array will look like this: $userData[0]['auth_user_id'] = 'wujha433gawefawfwfiuj2ou9823r98h';
['handle'] = 'myLogin';
['passwd'] = 'd346gs2gwaeiuhaeiuuweijfjuwaefhj';
['lastlogin'] = 1254801292; (Unix timestamp)
['is_active'] = 1; (1 = yes, 0 = no)
['owner_user_id'] = 1;
['owner_group_id'] = 1;
Filters can be either complex or simple. In their simple form you just need to pass an associative array with key/value, the key will be the table field name and value the value you are searching. It will consider that you want an do to do a field=value comparison, every additional filter will be appended with AND The complicated form of filters is to pass an array such as array( 'fieldname' => array('op' => '>', 'value' => 'dummy', 'cond' => ''), 'fieldname' => array('op' => '<', 'value' => 'dummy2', 'cond' => 'OR'), ); It can then build relatively complex queries. If you need joins or more complicated queries than that please consider using an alternative solution such as PEAR::DB_DataObject Any aditional field will be returned. The array key will be of the same case it is given. $cols = array('myField'); e.g.: getUsers(null, $cols) will return $userData[0]['auth_user_id'] = 'wujha433gawefawfwfiuj2ou9823r98h';
['handle'] = 'myLogin';
['passwd'] = 'd346gs2gwaeiuhaeiuuweijfjuwaefhj';
['myField'] = 'value';
Overrides LiveUser_Admin_Auth_Common::getUsers() (Gets all users with handle, passwd, authId, lastlogin, is_active and individual rights.)
Parameters:
removeUser [line 280]
updateUser [line 315]
mixed updateUser(
string
$authId, [string
$handle = ''], [string
$password = ''], [boolean
$active = null], [integer
$owner_user_id = null], [integer
$owner_group_id = null], [array
$customFields = array()])
|
|
Changes user data in auth table.
Overrides LiveUser_Admin_Auth_Common::updateUser() (Changes user data in auth table.)
Parameters:
Documentation generated on Mon, 11 Mar 2019 10:16:11 -0400 by phpDocumentor 1.4.4. PEAR Logo Copyright © PHP Group 2004.
|
|