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

Class: LiveUser_Admin_Perm_Common

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

Class Overview


This class provides a set of functions for implementing a user permission management system on live websites. All authorisation backends/containers must be extensions of this base class.


Author(s):

Version:

  • $Id: Common.php,v 1.25 2004/06/15 13:28:09 lsmith Exp $

Variables

Methods


Child classes:

LiveUser_Admin_Perm_Container_MDB2_Simple
Container for simple rights managements.
LiveUser_Admin_Perm_Container_DB_Simple
Container for simple rights managements.
LiveUser_Admin_Perm_Container_MDB_Simple
Container for simple rights managements.

Inherited Variables

Inherited Methods


Class Details

[line 55]
This class provides a set of functions for implementing a user permission management system on live websites. All authorisation backends/containers must be extensions of this base class.
  • Author: Bjoern Kraus <krausbn@php.net>
  • Author: Markus Wolff <wolff@21st.de>
  • Version: $Id: Common.php,v 1.25 2004/06/15 13:28:09 lsmith Exp $


[ Top ]


Class Variables

$groupTableCols = array()

[line 100]

Columns definitions
  • Access: protected

Type:   array


[ Top ]

$prefix =  'liveuser_'

[line 75]

Table prefix
  • Access: public

Type:   string


[ Top ]



Method Detail

LiveUser_Admin_Perm_Common (Constructor)   [line 107]

LiveUser_Admin_Perm_Common LiveUser_Admin_Perm_Common( $connectOptions)

Class constructor. Feel free to override in backend subclasses.
  • Access: protected

Parameters:

   $connectOptions   — 

[ Top ]

addRights   [line 169]

mixed addRights( string $authId, array $rights)

Adds rights for a single user.
  • Return: True on success, error object if not.
  • Access: public

Parameters:

string   $authId   —  Auth user ID.
array   $rights   —  Array of right IDs to add.

[ Top ]

addUser   [line 142]

mixed addUser( string $authId, [int $type = LIVEUSER_USER_TYPE_ID], [mixed $permId = null])

Adds a new user to Perm.
  • Return: string (perm_user_id) or PEAR Error object
  • Access: public

Overridden in child classes as:

LiveUser_Admin_Perm_Container_MDB2_Simple::addUser()
Add a user
LiveUser_Admin_Perm_Container_DB_Simple::addUser()
Add a user
LiveUser_Admin_Perm_Container_MDB_Simple::addUser()
Add a user

Parameters:

string   $authId   —  Auth user ID of the user that should be added.
int   $type   —  User type (constants defined in Perm/Common.php) (optional).
mixed   $permId   —  If specificed no new ID will be automatically generated instead

[ Top ]

getAuthUserId   [line 263]

mixed getAuthUserId( string $permId)

Gets the auth ID of a user.
  • Return: Permission ID or MDB2 error.
  • Access: public

Overridden in child classes as:

LiveUser_Admin_Perm_Container_MDB2_Simple::getAuthUserId()
Gets the auth ID of a user.
LiveUser_Admin_Perm_Container_DB_Simple::getAuthUserId()
Gets the auth ID of a user.
LiveUser_Admin_Perm_Container_MDB_Simple::getAuthUserId()

Parameters:

string   $permId   —  Perm user ID.

[ Top ]

getPermUserId   [line 250]

mixed getPermUserId( string $authId, string $authName)

Gets the perm ID of a user.
  • Return: Permission ID or MDB2 error.
  • Access: public

Overridden in child classes as:

LiveUser_Admin_Perm_Container_MDB2_Simple::getPermUserId()
Gets the perm ID of a user.
LiveUser_Admin_Perm_Container_DB_Simple::getPermUserId()
Gets the perm ID of a user.
LiveUser_Admin_Perm_Container_MDB_Simple::getPermUserId()
Gets the perm ID of a user.

Parameters:

string   $authId   —  Auth user ID.
string   $authName   —  Auth container name.

[ Top ]

getProperty   [line 124]

mixed getProperty( string $what)

Function returns the inquired value if it exists in the class.
  • Return: null, a value or an array.

Parameters:

string   $what   —  Name of the property to be returned.

[ Top ]

getUsers   [line 222]

mixed getUsers( [boolean $withRights = false])

Gets all perm_user_id, type, container and rights

The array will look like this:

  1.  $userData[0]['perm_user_id'= 1;
  2.              ['type']         = 1;
  3.              ['container']    '';
  4.              ['rights'][0]    = 1;
  5.              ['rights'][1]    = 4;
  6.              ['rights'][2]    = 5;

  • Return: Array with user data or error object.
  • Access: public

Overridden in child classes as:

LiveUser_Admin_Perm_Container_MDB2_Simple::getUsers()
Fetch users from the database.
LiveUser_Admin_Perm_Container_DB_Simple::getUsers()
Fetch users from the database.
LiveUser_Admin_Perm_Container_MDB_Simple::getUsers()
Fetch users from the database.

Parameters:

boolean   $withRights   —  If true the rights for each user will be retrieved.

[ Top ]

outputRightsConstants   [line 294]

mixed outputRightsConstants( [array $options = array()], [string $mode = 'file'], [string $type = 'constant'])

Generate the constants to a file or define them directly.

$mode can be either 'file' or 'php'. File will write the constant in the given file, replacing/adding constants as needed. Php will call define() function to actually define the constants.

$options can contain 'prefix' => 'prefix_goes_here', 'area' => 'specific area id to grab rights from', 'application' => 'specific application id to grab rights from' 'naming' => 1 for PREFIX_RIGHTNAME <- DEFAULT 2 for PREFIX_AREANAME_RIGHTNAME 3 for PREFIX_APPLICATIONNAME_AREANAME_RIGHTNAME 'filename' => if $mode is file you must give the full path for the output file

If not prefix is given it will not be used to generate the constants

  • Return: boolean, array or DB Error object
  • Access: public

Parameters:

array   $options   —  options for constants generation
string   $mode   —  output mode desired (file or direct)
string   $type   —  type of output (constant or array)

[ Top ]

removeRights   [line 184]

mixed removeRights( string $authId, [array $rights = null])

Removes rights for a single user.
  • Return: True on success, error object if not.
  • Access: public

Parameters:

string   $authId   —  Auth user ID.
array   $rights   —  Array of right IDs to remove or empty to remove all.

[ Top ]

removeUser   [line 155]

mixed removeUser( string $authId)

Removes an existing user from Perm.
  • Return: True on success, error object if not.
  • Access: public

Overridden in child classes as:

LiveUser_Admin_Perm_Container_MDB2_Simple::removeUser()
Delete user
LiveUser_Admin_Perm_Container_MDB2_Complex::removeUser()
LiveUser_Admin_Perm_Container_DB_Simple::removeUser()
Delete user
LiveUser_Admin_Perm_Container_DB_Complex::removeUser()
LiveUser_Admin_Perm_Container_MDB_Simple::removeUser()
Delete user
LiveUser_Admin_Perm_Container_MDB_Complex::removeUser()

Parameters:

string   $authId   —  Auth user ID of the user that should be removed.

[ Top ]

setUserType   [line 236]

mixed setUserType( string $authId, int $type)

Updates user type.
  • Return: True on success, error object if not.
  • Access: public

Parameters:

string   $authId   —  Auth user ID.
int   $type   —  User type (constants defined in Perm/Common.php).

[ Top ]

updateRights   [line 198]

mixed updateRights( string $authId, array $rights)

Shortcut to delete all existing rights of a user and add the given.
  • Return: True or error object if not.
  • Access: public

Parameters:

string   $authId   —  Auth user ID.
array   $rights   —  Array of right IDs to add.

[ Top ]


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