LiveUser
[ class tree: LiveUser ] [ index: LiveUser ] [ all elements ]

Class: LiveUser_Admin

Source Location: /LiveUser-0.13.0/Admin/Admin.php

Class Overview


Attempt at a unified admin class


Author(s):

  • Lukas Smith
  • Arnaud Limbourg

Version:

  • $Id: Admin.php,v 1.45 2004/08/30 08:45:27 lsmith Exp $

Variables

Methods


Inherited Variables

Inherited Methods


Class Details

[line 42]
Attempt at a unified admin class

Simple usage:

  1.  $admin = new LiveUser_Admin($conf'FR');
  2.  $found $admin->getUser(3);
  3.  
  4.  if ($found{
  5.   var_dump($admin->perm->getRights());
  6.  }

  • Author: Lukas Smith
  • Author: Arnaud Limbourg
  • Author:
  • Version: $Id: Admin.php,v 1.45 2004/08/30 08:45:27 lsmith Exp $
  • See: LiveUser::factory()


[ Top ]


Class Variables

$auth =  null

[line 75]

Auth admin object
  • Access: public

Type:   object


[ Top ]

$authContainerName =

[line 51]

Name of the current selected auth container
  • Access: public

Type:   string


[ Top ]

$lang =  ''

[line 91]

Language to be used
  • Access: public

Type:   string


[ Top ]

$perm =  null

[line 67]

Admin perm object
  • Access: public

Type:   object


[ Top ]



Method Detail

LiveUser_Admin (Constructor)   [line 101]

void LiveUser_Admin( array $conf, string $lang)

Constructor
  • Access: protected

Parameters:

array   $conf   —  liveuser conf array
string   $lang   —  two letters language code

[ Top ]

addUser   [line 363]

mixed addUser( string $handle, string $password, [integer $type = null], [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:

  1.        $user_id $admin->addUser('johndoe''dummypass'truenullnullnull);

Untested: it most likely doesn't work.

  • Return: userid or false
  • Access: public

Parameters:

string   $handle   —  user handle (username)
string   $password   —  user password
integer   $type   —  permission user type
boolean   $active   —  is account active ?
int   $id   —  ID
integer   $owner_user_id   —  ID of the owning user.
integer   $owner_group_id   —  ID of the owning group.
array   $customFields   —  values for the custom fields

[ Top ]

getUser   [line 492]

mixed getUser( mixed $permId, [ $permFilter = array()], [ $authFilter = array()], [ $permOptions = array()])

Finds and gets userinfo by his userID, customFields can also be gotten

Untested: it most likely doesn't work.

  • Return: Array with userinfo if found else error object
  • Access: public

Parameters:

mixed   $permId   —  Perm User ID
   $permFilter   — 
   $authFilter   — 
   $permOptions   — 

[ Top ]

removeUser   [line 432]

mixed removeUser( mixed $permId)

Removes user from both containers

Untested: it most likely doesn't work.

  • Return: error object or true
  • Access: public

Parameters:

mixed   $permId   —  Auth ID

[ Top ]

searchUsers   [line 467]

mixed searchUsers( [array $filters = 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.

  • Return: error object or array
  • Access: public

Parameters:

array   $filters   —  filters to apply to fetched data
string   $order   —  if not null 'ORDER BY $order' will be appended to the query
boolean   $rekey   —  will return an associative array with the auth_user_id as the key by using DB::getAssoc() instead of DB::getAll()

[ Top ]

setAdminAuthContainer   [line 236]

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();

  • Return: true upon success, false otherwise
  • Access: public

Parameters:

string   $authName   —  auth container name

[ Top ]

setAdminContainers   [line 289]

boolean setAdminContainers( [mixed $authId = null], [string $authName = 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();

  • Return: true upon success, false otherwise
  • Access: public

Parameters:

mixed   $authId   —  user auth id
string   $authName   —  auth container name

[ Top ]

setAdminPermContainer   [line 264]

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();

  • Return: true upon success, false otherwise
  • Access: public

[ Top ]

setConfArray   [line 120]

boolean setConfArray( array $conf)

Merges the current configuration array with configuration array pases along with the method call.
  • Return: true upon success, false otherwise

Parameters:

array   $conf   —  configuration array

[ Top ]

singleton   [line 143]

object Returns &singleton( array $conf, string $lang)

Makes your instance global.

You MUST call this method with the $var = &LiveUser_Admin::singleton() syntax. Without the ampersand (&) in front of the method name, you will not get a reference, you will get a copy.

  • Return: an object of either LiveUser or PEAR_Error type
  • See: LiveUser_Admin::LiveUser_Admin
  • Access: public

Parameters:

array   $conf   —  liveuser conf array
string   $lang   —  two letters language code

[ Top ]

updateUser   [line 404]

mixed updateUser( string $permId, string $handle, integer $password, [boolean $type = null], [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:

  1.        $admin->updateUser($user_id'johndoe''dummypass'truenullnull);

Untested: it most likely doesn't work.

  • Return: error object or true
  • Access: public

Parameters:

string   $permId   —  user handle (username)
string   $handle   —  user password
integer   $password   —  permission user type
boolean   $type   —  is account active ?
int   $active   —  ID
integer   $owner_user_id   —  ID of the owning user.
integer   $owner_group_id   —  ID of the owning group.
array   $customFields   —  values for the custom fields

[ Top ]


Documentation generated on Mon, 11 Mar 2019 13:56:14 -0400 by phpDocumentor 1.4.4. PEAR Logo Copyright © PHP Group 2004.