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

Class: LiveUser_Admin_Perm_Container_MDB2_Complex

Source Location: /LiveUser-0.13.0/Admin/Perm/Container/MDB2_Complex.php

Class Overview

LiveUser_Admin_Perm_Common
   |
   --LiveUser_Admin_Perm_Container_MDB2_Simple
      |
      --LiveUser_Admin_Perm_Container_MDB2_Medium
         |
         --LiveUser_Admin_Perm_Container_MDB2_Complex

This is a PEAR::MDB2 admin class for the LiveUser package.


Author(s):

Version:

  • $Id: MDB2_Complex.php,v 1.23 2004/09/16 14:53:30 lsmith Exp $

Methods


Inherited Variables

Inherited Methods

Class: LiveUser_Admin_Perm_Container_MDB2_Medium

LiveUser_Admin_Perm_Container_MDB2_Medium::LiveUser_Admin_Perm_Container_MDB2_Medium()
Constructor
LiveUser_Admin_Perm_Container_MDB2_Medium::activateGroup()
Activate group
LiveUser_Admin_Perm_Container_MDB2_Medium::addGroup()
Add a group to the database
LiveUser_Admin_Perm_Container_MDB2_Medium::addUserToGroup()
Add User to Group
LiveUser_Admin_Perm_Container_MDB2_Medium::deactivateGroup()
Deactivate group
LiveUser_Admin_Perm_Container_MDB2_Medium::getGroups()
Get list of all groups
LiveUser_Admin_Perm_Container_MDB2_Medium::getUsersFromGroup()
get all perm_user_id from Group
LiveUser_Admin_Perm_Container_MDB2_Medium::grantGroupRight()
Grant right to group
LiveUser_Admin_Perm_Container_MDB2_Medium::removeGroup()
Deletes a group from the database
LiveUser_Admin_Perm_Container_MDB2_Medium::removeRight()
Delete a right
LiveUser_Admin_Perm_Container_MDB2_Medium::removeUserFromGroup()
Remove User from Group
LiveUser_Admin_Perm_Container_MDB2_Medium::revokeGroupRight()
Revoke right from group
LiveUser_Admin_Perm_Container_MDB2_Medium::updateGroup()
Update group
LiveUser_Admin_Perm_Container_MDB2_Medium::updateGroupRight()
Update right level of groupRight

Class: LiveUser_Admin_Perm_Container_MDB2_Simple

LiveUser_Admin_Perm_Container_MDB2_Simple::LiveUser_Admin_Perm_Container_MDB2_Simple()
Constructor
LiveUser_Admin_Perm_Container_MDB2_Simple::addApplication()
Add an application
LiveUser_Admin_Perm_Container_MDB2_Simple::addArea()
Add an area
LiveUser_Admin_Perm_Container_MDB2_Simple::addLanguage()
Add a new language
LiveUser_Admin_Perm_Container_MDB2_Simple::addRight()
Add a right in special area
LiveUser_Admin_Perm_Container_MDB2_Simple::addTranslation()
Assigns name (and description) in specified language to a section
LiveUser_Admin_Perm_Container_MDB2_Simple::addUser()
Add a user
LiveUser_Admin_Perm_Container_MDB2_Simple::addUserAreaAdmin()
Make a user an admin of a given area.
LiveUser_Admin_Perm_Container_MDB2_Simple::getApplications()
Get list of all applications
LiveUser_Admin_Perm_Container_MDB2_Simple::getAreas()
Get list of all areas within a given application
LiveUser_Admin_Perm_Container_MDB2_Simple::getAuthUserId()
Gets the auth ID of a user.
LiveUser_Admin_Perm_Container_MDB2_Simple::getCurrentApplication()
Get current application
LiveUser_Admin_Perm_Container_MDB2_Simple::getCurrentLanguage()
Get current language
LiveUser_Admin_Perm_Container_MDB2_Simple::getLanguages()
Get list of all languages
LiveUser_Admin_Perm_Container_MDB2_Simple::getPermUserId()
Gets the perm ID of a user.
LiveUser_Admin_Perm_Container_MDB2_Simple::getRights()
Get list of all rights
LiveUser_Admin_Perm_Container_MDB2_Simple::getTranslation()
Get name (and description) of the [section] in specified language
LiveUser_Admin_Perm_Container_MDB2_Simple::getUsers()
Fetch users from the database.
LiveUser_Admin_Perm_Container_MDB2_Simple::grantUserRight()
Grant right to user
LiveUser_Admin_Perm_Container_MDB2_Simple::removeApplication()
Delete an application
LiveUser_Admin_Perm_Container_MDB2_Simple::removeArea()
Delete an area
LiveUser_Admin_Perm_Container_MDB2_Simple::removeLanguage()
Remove a language
LiveUser_Admin_Perm_Container_MDB2_Simple::removeRight()
Delete a right
LiveUser_Admin_Perm_Container_MDB2_Simple::removeTranslation()
Remove name (and description) of the [section] in specified language
LiveUser_Admin_Perm_Container_MDB2_Simple::removeUser()
Delete user
LiveUser_Admin_Perm_Container_MDB2_Simple::removeUserAreaAdmin()
Remove the privilege of being an admin.
LiveUser_Admin_Perm_Container_MDB2_Simple::revokeUserRight()
Revoke right from user
LiveUser_Admin_Perm_Container_MDB2_Simple::setCurrentApplication()
Set current application
LiveUser_Admin_Perm_Container_MDB2_Simple::setCurrentLanguage()
Set current language
LiveUser_Admin_Perm_Container_MDB2_Simple::updateApplication()
Update an application
LiveUser_Admin_Perm_Container_MDB2_Simple::updateArea()
Update an area
LiveUser_Admin_Perm_Container_MDB2_Simple::updateLanguage()
Update language
LiveUser_Admin_Perm_Container_MDB2_Simple::updateRight()
Update a right
LiveUser_Admin_Perm_Container_MDB2_Simple::updateTranslation()
Updates name (and description) of [section] in specified language
LiveUser_Admin_Perm_Container_MDB2_Simple::updateUser()
Updates auth_user_id in the mapping table.
LiveUser_Admin_Perm_Container_MDB2_Simple::updateUserRight()
Update right level of userRight

Class: LiveUser_Admin_Perm_Common

LiveUser_Admin_Perm_Common::LiveUser_Admin_Perm_Common()
Class constructor. Feel free to override in backend subclasses.
LiveUser_Admin_Perm_Common::addRights()
Adds rights for a single user.
LiveUser_Admin_Perm_Common::addUser()
Adds a new user to Perm.
LiveUser_Admin_Perm_Common::getAuthUserId()
Gets the auth ID of a user.
LiveUser_Admin_Perm_Common::getPermUserId()
Gets the perm ID of a user.
LiveUser_Admin_Perm_Common::getProperty()
Function returns the inquired value if it exists in the class.
LiveUser_Admin_Perm_Common::getUsers()
Gets all perm_user_id, type, container and rights
LiveUser_Admin_Perm_Common::outputRightsConstants()
Generate the constants to a file or define them directly.
LiveUser_Admin_Perm_Common::removeRights()
Removes rights for a single user.
LiveUser_Admin_Perm_Common::removeUser()
Removes an existing user from Perm.
LiveUser_Admin_Perm_Common::setUserType()
Updates user type.
LiveUser_Admin_Perm_Common::updateRights()
Shortcut to delete all existing rights of a user and add the given.

Class Details

[line 51]
This is a PEAR::MDB2 admin class for the LiveUser package.

It takes care of managing the permission part of the package.

A PEAR::MDB2 connection object can be passed to the constructor to reuse an existing connection. Alternatively, a DSN can be passed to open a new one.

Requirements:

  • Files "common.php", "Container/MDB2_Complex.php" in directory "Perm"
  • Array of connection options must be passed to the constructor. Example: array("server" => "localhost", "user" => "root", "password" => "pwd", "database" => "AllMyPreciousData")



[ Top ]


Method Detail

LiveUser_Admin_Perm_Container_MDB2_Complex (Constructor)   [line 61]

void LiveUser_Admin_Perm_Container_MDB2_Complex( mixed &$connectOptions, array 1)

Constructor
  • Access: protected

Parameters:

array   1   —  configuration array not used atm
mixed   &$connectOptions   —  Array or PEAR::MDB2 object.

[ Top ]

assignSubgroup   [line 77]

mixed assignSubgroup( integer $groupId, integer $subgroupId)

Assign subgroup to parent group.

First checks that the child group does not have a parent group already assigned to it. If so it returns an error object

  • Return: boolean, MDB2 Error object or LiveUser Error Object
  • Access: public

Parameters:

integer   $groupId   —  id of parent group
integer   $subgroupId   —  id of child group

[ Top ]

getGroups   [line 348]

mixed getGroups( [array $options = null], [boolean $hierarchy = false])

Get list of all groups

This method accepts the following options...

  1.   'where_user_id' [PERM_USER_ID],
  2.   'where_group_id' [GROUP_ID],
  3.   'where_owner_user_id' [OWNER_USER_ID],
  4.   'where_owner_group_id' [OWNER_GROUP_ID],
  5.   'where_is_active' [BOOLEAN],
  6.   'with_rights' [BOOLEAN]

  • Return: array or MDB2 Error object
  • Access: public

Overrides LiveUser_Admin_Perm_Container_MDB2_Medium::getGroups() (Get list of all groups)

Parameters:

array   $options   —  an array determining which fields and conditions to use
boolean   $hierarchy   —  determine whether or not to build a hierarchal result set

[ Top ]

getImpliedRights   [line 603]

mixed getImpliedRights( [array $options = array()])

Get implied rights
  • Return: array or MDB2 Error object
  • Access: public

Parameters:

array   $options   —  an array determining which fields and conditions to use

[ Top ]

getInheritedRights   [line 643]

mixed getInheritedRights( [array $options = array()])

Get inherited rights
  • Return: array or MDB2 Error object
  • Access: public

Parameters:

array   $options   —  an array determining which fields and conditions to use

[ Top ]

getParentGroup   [line 191]

mixed getParentGroup( integer $subgroupId)

get parent group of group
  • Return: integer or MDB2 Error object
  • Access: public

Parameters:

integer   $subgroupId   —  id of subgroup

[ Top ]

getRights   [line 407]

mixed getRights( [array $options = null], [boolean $hierarchy = false])

Get list of all rights

This method accepts the following options... 'where_user_id' = [PERM_USER_ID], 'where_group_id' = [GROUP_ID], 'where_right_id' = [RIGHT_ID], 'where_area_id' = [AREA_ID], 'where_application_id' = [APPLICATION_ID], 'with_areas' = [BOOLEAN], 'with_applications' = [BOOLEAN] 'with_inherited_rights' = [BOOLEAN] 'with_implied_rights' = [BOOLEAN]

  • Return: array or MDB2 Error object
  • Access: public

Overrides LiveUser_Admin_Perm_Container_MDB2_Simple::getRights() (Get list of all rights)

Parameters:

array   $options   —  an array determining which fields and conditions to use
boolean   $hierarchy   —  whether or not to build a hierarchal result set

[ Top ]

grantGroupRight   [line 826]

mixed grantGroupRight( integer $groupId, integer $rightId, [integer $right_level = LIVEUSER_MAX_LEVEL])

Grand right to group
  • Return: boolean or MDB2 Error object
  • Access: public

Overrides LiveUser_Admin_Perm_Container_MDB2_Medium::grantGroupRight() (Grant right to group)

Parameters:

integer   $groupId   —  id of group
integer   $rightId   —  id of right
integer   $right_level   —  right level

[ Top ]

grantUserRight   [line 778]

mixed grantUserRight( string $permId, integer $rightId, [integer $right_level = LIVEUSER_MAX_LEVEL])

Grant right to user
  • Return: boolean or MDB2 Error object
  • Access: public

Overrides LiveUser_Admin_Perm_Container_MDB2_Simple::grantUserRight() (Grant right to user)

Parameters:

string   $permId   —  id of user
integer   $rightId   —  id of right
integer   $right_level   —  level of right (can be negative to revoke/lower a right level)

[ Top ]

implyRight   [line 254]

mixed implyRight( integer $rightId, string $impliedRightId)

Imply right
  • Return: boolean or MDB2 Error object
  • Access: public

Parameters:

integer   $rightId   —  id of right
string   $impliedRightId   —  id of implied right

[ Top ]

removeGroup   [line 139]

mixed removeGroup( integer $groupId, [boolean $recursive = false])

Deletes a group from the database
  • Return: boolean or MDB2 Error object
  • Access: public

Overrides LiveUser_Admin_Perm_Container_MDB2_Medium::removeGroup() (Deletes a group from the database)

Parameters:

integer   $groupId   —  id of deleted group
boolean   $recursive   —  recursive delete of all subgroups

[ Top ]

removeRight   [line 310]

mixed removeRight( int $rightId)

Overriden method to delete implied rights mapping as well as the right.
  • Return: true on success or MDB2 error
  • Access: public

Overrides LiveUser_Admin_Perm_Container_MDB2_Medium::removeRight() (Delete a right)

Parameters:

int   $rightId   —  right identifier

[ Top ]

removeUser   [line 690]

void removeUser( $permId)


Overrides LiveUser_Admin_Perm_Container_MDB2_Simple::removeUser() (Delete user)

Parameters:

   $permId   — 

[ Top ]

unassignSubgroup   [line 113]

mixed unassignSubgroup( integer $subgroupId)

Unassign subgroup from parent group.

Remove parent group from child group.

  • Return: boolean, MDB2 Error object or LiveUser Error Object
  • Access: public

Parameters:

integer   $subgroupId   —  id of child group

[ Top ]

unimplyRight   [line 284]

mixed unimplyRight( integer $rightId, string $impliedRightId)

Unimply right
  • Return: boolean or MDB2 Error object
  • Access: public

Parameters:

integer   $rightId   —  id of right
string   $impliedRightId   —  id of implied right

[ Top ]


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