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

Class: LiveUser_Admin_Perm_Container_MDB2_Medium

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

Class Overview

LiveUser_Admin_Perm_Common
   |
   --LiveUser_Admin_Perm_Container_MDB2_Simple
      |
      --LiveUser_Admin_Perm_Container_MDB2_Medium

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


Author(s):

Version:

  • $Id: MDB2_Medium.php,v 1.29 2004/07/31 10:10:55 lsmith Exp $

Methods


Child classes:

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

Inherited Variables

Inherited Methods

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 57]
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_Medium.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_Medium (Constructor)   [line 66]

void LiveUser_Admin_Perm_Container_MDB2_Medium( array &$connectOptions)

Constructor
  • Access: protected

Parameters:

array   &$connectOptions   —  full liveuser conf array

[ Top ]

activateGroup   [line 297]

mixed activateGroup( integer $groupId)

Activate group
  • Return: boolean or MDB2 Error object or false
  • Access: public

Parameters:

integer   $groupId   —  id of group

[ Top ]

addGroup   [line 83]

mixed addGroup( string $group_name, [string $group_description = null], [string $define_name = null], [string $optionalFields = array()], [array $customFields = array()], array 5)

Add a group to the database
  • Return: integer (group_id) or MDB2 Error object
  • Access: public

Parameters:

array   5   —  custom fields (array('name'=>'value'))
string   $group_name   —  name of group constant
string   $group_description   —  name of group
string   $define_name   —  description of group
string   $optionalFields   —  define name for the group
array   $customFields   —  optional fields (array('name'=>'value'))

[ Top ]

addUserToGroup   [line 478]

mixed addUserToGroup( string $permId, integer $groupId)

Add User to Group
  • Return: boolean or MDB2 Error object or false if user already belongs to the group
  • Access: public

Parameters:

string   $permId   —  id of user
integer   $groupId   —  id of group

[ Top ]

deactivateGroup   [line 327]

mixed deactivateGroup( integer $groupId)

Deactivate group
  • Return: boolean or MDB2 Error object
  • Access: public

Parameters:

integer   $groupId   —  id of group

[ Top ]

getGroups   [line 575]

mixed getGroups( [array $options = null])

Get list of all groups

This method accepts the following options... 'where_user_id' = [PERM_USER_ID], 'where_group_id' = [GROUP_ID], 'where_is_active' = [BOOLEAN], 'with_rights' = [BOOLEAN]

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

Overridden in child classes as:

LiveUser_Admin_Perm_Container_MDB2_Complex::getGroups()
Get list of all groups

Parameters:

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

[ Top ]

getUsersFromGroup   [line 549]

mixed getUsersFromGroup( integer $groupId)

get all perm_user_id from Group
  • Return: boolean or MDB2 Error object
  • Access: public

Parameters:

integer   $groupId   —  id of group

[ Top ]

grantGroupRight   [line 354]

mixed grantGroupRight( integer $groupId, integer $rightId)

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

Overridden in child classes as:

LiveUser_Admin_Perm_Container_MDB2_Complex::grantGroupRight()
Grand right to group

Parameters:

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

[ Top ]

removeGroup   [line 166]

mixed removeGroup( integer $groupId)

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

Overridden in child classes as:

LiveUser_Admin_Perm_Container_MDB2_Complex::removeGroup()
Deletes a group from the database

Parameters:

integer   $groupId   —  id of deleted group

[ Top ]

removeRight   [line 398]

mixed removeRight( integer $rightId)

Delete a right
  • Return: boolean or DB Error object
  • Access: public

Overridden in child classes as:

LiveUser_Admin_Perm_Container_MDB2_Complex::removeRight()
Overriden method to delete implied rights mapping as well as the right.

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

Parameters:

integer   $rightId   —  id of right

[ Top ]

removeUserFromGroup   [line 521]

mixed removeUserFromGroup( string $permId, [integer $groupId = null])

Remove User from Group
  • Return: boolean or MDB2 Error object
  • Access: public

Parameters:

string   $permId   —  id of user
integer   $groupId   —  id of group

[ Top ]

revokeGroupRight   [line 417]

boolean revokeGroupRight( integer $groupId, [integer $rightId = null])

Revoke right from group
  • Return: true on success or false on failure
  • Access: public

Parameters:

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

[ Top ]

updateGroup   [line 229]

mixed updateGroup( string $groupId, string $group_name, [string $group_description = null], [string $define_name = null], [array $optionalFields = array()], [array $customFields = array()])

Update group
  • Return: boolean or MDB2 Error object
  • Access: public

Parameters:

string   $groupId   —  id of group
string   $group_name   —  name of group
string   $group_description   —  description of group
string   $define_name   —  define name for the group
array   $optionalFields   —  optional fields (array('name'=>'value'))
array   $customFields   —  custom fields (array('name'=>'value'))

[ Top ]

updateGroupRight   [line 448]

mixed updateGroupRight( integer $groupId, integer $rightId, integer $right_level)

Update right level of groupRight
  • Return: boolean or MDB2 Error object
  • Access: public

Parameters:

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

[ Top ]


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