Class: LiveUser_Admin_Auth_Container_MDB2
Source Location: /LiveUser-0.11.0/Admin/Auth/Container/MDB2.php
LiveUser_Admin_Auth_Common
|
--LiveUser_Admin_Auth_Container_MDB2
Class LiveUser_Admin_Auth_MDB2
Author(s):
Version:
- $Id: MDB2.php,v 1.15 2004/04/25 15:55:09 lsmith Exp $
|
|
|
Inherited Variables
|
Inherited Methods
|
Class Details
Class Variables
Method Detail
LiveUser_Admin_Auth_Container_MDB2 (Constructor) [line 166]
void LiveUser_Admin_Auth_Container_MDB2(
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' => 'MDB2',
'loginTimeout' => 0,
'expireTime' => 3600,
'idleTime' => 1800,
'passwordEncryptionMode' => 'MD5',
'allowDuplicateHandles' => 0,
'authTable' => 'users',
'dsn' => 'type://user:pass@host/database',
'authTableCols' => array(
'user_id' => array('name' => 'auth_user_id', 'type' => 'text'),
'handle' => array('name' => 'handle', 'type' => 'text'),
'passwd' => array('name' => 'passwd', 'type' => 'text'),
'lastlogin' => array('name' => 'lastlogin', 'type' => 'timestamp'),
'is_active' => array('name' => 'is_active', 'type' => 'boolean'),
'owner_user_id' => array('name' => 'owner_user_id', 'type' => 'integer'),
'owner_group_id' => array('name' => 'owner_group_id', 'type' => 'integer')
)
)
),
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 MDB2 based auth containers. See PEAR::MDB2 documentation for DSN specifications. $conf =
array(
'type' => 'MDB2',
'loginTimeout' => 0,
'expireTime' => 3600,
'idleTime' => 1800,
'allowDuplicateHandles' => 0,
'authTable' => 'users',
'authTableCols' => array(
'user_id' => array('name' => 'auth_user_id', 'type' => 'text'),
'handle' => array('name' => 'handle', 'type' => 'text'),
'passwd' => array('name' => 'passwd', 'type' => 'text'),
'lastlogin' => array('name' => 'lastlogin', 'type' => 'timestamp'),
'is_active' => array('name' => 'is_active', 'type' => 'boolean'),
'owner_user_id' => array('name' => 'owner_user_id', 'type' => 'integer'),
'owner_group_id' => array('name' => 'owner_group_id', 'type' => 'integer')
)
);
Parameters:
addUser [line 217]
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/MDB2.
Overrides LiveUser_Admin_Auth_Common::addUser() (Adds a new user to Auth.)
Parameters:
getUsers [line 452]
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 additinnal 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' => '', type = 'text'), 'fieldname' => array('op' => '<', 'value' => 'dummy2', 'cond' => 'OR', 'type' = 'text'), ); 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( array('name' => 'myField', 'type' => 'text'), ); 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 295]
updateUser [line 330]
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:04 -0400 by phpDocumentor 1.4.4. PEAR Logo Copyright © PHP Group 2004.
|
|