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

Class: LiveUser_Admin

Source Location: /LiveUser_Admin-0.3.3/Admin.php

Class Overview


Attempt at a unified admin class


Author(s):

Version:

  • Release: @package_version@

Copyright:

  • 2002-2005 Markus Wolff

Variables

Methods


Inherited Variables

Inherited Methods


Class Details

[line 108]
Attempt at a unified admin class

Simple usage:

  1.  $admin LiveUser_Admin::factory($conf);
  2.  $filters = array(
  3.      'perm_user_id' => '3'
  4.  );
  5.  $found $admin->getUsers($filters);
  6.  
  7.  if ($found{
  8.   var_dump($admin->perm->getRights());
  9.  }



[ Top ]


Class Variables

$auth =  null

[line 141]

Auth admin object
  • Access: public

Type:   object


[ Top ]

$authContainerName =

[line 117]

Name of the current selected auth container
  • Access: public

Type:   string


[ Top ]

$perm =  null

[line 133]

Admin perm object
  • Access: public

Type:   object


[ Top ]



Method Detail

LiveUser_Admin (Constructor)   [line 176]

LiveUser_Admin LiveUser_Admin( )


[ Top ]

addErrorLog   [line 226]

boolean addErrorLog( Log &$log)

Add error logger for use by Errorstack.

Be aware that if you need add a log at the beginning of your code if you want it to be effective. A log will only be taken into account after it's added.

Sample usage:

  1.  $lu_object &LiveUser_Admin::singleton($conf);
  2.  $logger &Log::factory('mail''bug@example.com',
  3.       'myapp_debug_mail_log'array('from' => 'application_bug@example.com'));
  4.  $lu_object->addErrorLog($logger);

  • Return: true on success or false on failure
  • Access: public

Parameters:

Log   &$log   —  logger instance

[ Top ]

addUser   [line 453]

mixed addUser( string $data, [integer $type = LIVEUSER_USER_TYPE_ID])

Tries to add a user to both containers.
  • Return: perm user id or false
  • Access: public

Parameters:

string   $data   —  authentication user data
integer   $type   —  permission user type

[ Top ]

factory   [line 242]

object &factory( array $conf)


Parameters:

array   $conf   —  configuration array

[ Top ]

getErrors   [line 696]

array getErrors( )

Wrapper method to get the Error Stack
  • Return: an array of the errors
  • Access: public

[ Top ]

getUsers   [line 575]

mixed getUsers( [mixed $container = 'perm'], [boolean $filter = array()], [ $first = false])

Finds and gets full userinfo by filtering inside the given container
  • Return: Array with userinfo if found else error object
  • Access: public

Parameters:

mixed   $container   —  perm filters (as for getUsers() from the perm container
boolean   $filter   —  if only one row should be returned
   $first   — 

[ Top ]

loadPEARLog   [line 198]

void loadPEARLog( )

This method lazy loads PEAR::Log
  • Access: protected

[ Top ]

removeUser   [line 533]

mixed removeUser( mixed $permUserId)

Removes user from both Perm and Auth containers
  • Return: error object or true
  • Access: public

Parameters:

mixed   $permUserId   —  Perm ID

[ Top ]

setAdminAuthContainer   [line 314]

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 388]

boolean setAdminContainers( [mixed $authUserId = 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   $authUserId   —  user auth id
string   $authName   —  auth container name

[ Top ]

setAdminPermContainer   [line 356]

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 288]

boolean setConfArray( array $conf)

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

Parameters:

array   $conf   —  configuration array

[ Top ]

singleton   [line 264]

object &singleton( [array $conf = null])


Parameters:

array   $conf   —  configuration array

[ Top ]

updateUser   [line 484]

mixed updateUser( integer $permUserId, string $data, [integer $type = null])

Tried to changes user data for both containers.
  • Return: error object or true
  • Access: public

Parameters:

integer   $permUserId   —  permission user id
string   $data   —  authentication user data
integer   $type   —  permission user type

[ Top ]

_getUsersByAuth   [line 646]

mixed _getUsersByAuth( [mixed $authFilter = array()], [boolean $first = false])

Finds and gets full userinfo by filtering inside the auth container
  • Return: Array with userinfo if found else error object
  • Access: public

Parameters:

mixed   $authFilter   —  auth filters (as for getUsers() from the auth container
boolean   $first   —  if only one row should be returned

[ Top ]

_getUsersByPerm   [line 592]

mixed _getUsersByPerm( [mixed $permFilter = array()], [boolean $first = false])

Finds and gets full userinfo by filtering inside the perm container
  • Return: Array with userinfo if found else error object
  • Access: public

Parameters:

mixed   $permFilter   —  perm filters (as for getUsers() from the perm container
boolean   $first   —  if only one row should be returned

[ Top ]

__call   [line 713]

mixed __call( string $method, array $params)

Calls a method using the __call() magic method on perm or auth
  • Return: returned value
  • Access: public

Parameters:

string   $method   —  method name
array   $params   —  arguments

[ Top ]


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