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

Class: LiveUser_Admin_Perm_Simple

Source Location: /LiveUser_Admin-0.3.4/Perm/Simple.php

Class Overview


Simple permission administration class


Author(s):

Version:

  • Release: @package_version@

Copyright:

  • 2002-2005 Markus Wolff

Variables

Methods


Child classes:

LiveUser_Admin_Perm_Medium
Medium container for permission handling

Inherited Variables

Inherited Methods


Class Details

[line 83]
Simple permission administration class

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.



[ Top ]


Class Variables

$selectable_tables = array(
        'getUsers' => array('perm_users', 'userrights', 'rights'),'getRights'=>array('rights','userrights','translations','areas','applications'),'getAreas'=>array('areas','applications','translations'),'getApplications'=>array('applications','translations'),'getTranslations'=>array('translations'),)

[line 101]


Type:   mixed


[ Top ]

$withFieldMethodMap = array(
        'perm_user_id' => 'getUsers',
        'right_id' => 'getRights',
        'area_id' => 'getAreas',
        'application_id' => 'getApplications',
    )

[line 109]


Type:   mixed


[ Top ]



Method Detail

LiveUser_Admin_Perm_Simple (Constructor)   [line 119]

LiveUser_Admin_Perm_Simple LiveUser_Admin_Perm_Simple( )

Class constructor. Feel free to override in backend subclasses.

[ Top ]

addApplication   [line 408]

void addApplication( array $data)

Add application
  • Access: public

Parameters:

array   $data   — 

[ Top ]

addArea   [line 299]

void addArea( array $data)

Add area
  • Access: public

Parameters:

array   $data   — 

[ Top ]

addRight   [line 235]

void addRight( array $data)

Add right
  • Access: public

Parameters:

array   $data   — 

[ Top ]

addTranslation   [line 542]

void addTranslation( array $data)

Add translation
  • Access: public

Parameters:

array   $data   — 

[ Top ]

addUser   [line 167]

void addUser( array $data)

Add user
  • Access: public

Parameters:

array   $data   — 

[ Top ]

disconnect   [line 935]

void disconnect( )

properly disconnect from resources
  • Access: public

[ Top ]

getApplications   [line 733]

void getApplications( [array $params = array()])

Fetches applications
  • Access: public

Parameters:

array   $params   — 

[ Top ]

getAreas   [line 718]

void getAreas( [array $params = array()])

Fetches areas
  • Access: public

Parameters:

array   $params   — 

[ Top ]

getCurrentApplication   [line 394]

string getCurrentApplication( )

Get current application
  • Return: name of the current application
  • Access: public

[ Top ]

getRights   [line 701]

void getRights( [array $params = array()])

Fetches rights
  • Access: public

Overridden in child classes as:

LiveUser_Admin_Perm_Complex::getRights()
Fetches rights

Parameters:

array   $params   — 

[ Top ]

getTranslations   [line 750]

void getTranslations( [array $params = array()])

Fetches translations
  • Access: public

Parameters:

array   $params   — 

[ Top ]

getUsers   [line 684]

void getUsers( [array $params = array()])

Fetches users
  • Access: public

Parameters:

array   $params   — 

[ Top ]

grantUserRight   [line 472]

void grantUserRight( array $data)

Grant user a right
  • Access: public

Parameters:

array   $data   — 

[ Top ]

init   [line 131]

boolean init( mixed &$conf)

Load the storage container
  • Return: true on success or false on failure
  • Access: public

Parameters:

mixed   &$conf   —  Name of array containing the configuration.

[ Top ]

outputRightsConstants   [line 784]

mixed outputRightsConstants( string $type, [array $options = array()], [string $mode = null])

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' => LIVEUSER_SECTION_RIGHT for PREFIX_RIGHTNAME <- DEFAULT LIVEUSER_SECTION_AREA for PREFIX_AREANAME_RIGHTNAME LIVEUSER_SECTION_APPLICATION 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:

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

[ Top ]

removeApplication   [line 446]

void removeApplication( array $filters)

Remove application(s)
  • Access: public
  • Uses: LiveUser_Admin_Perm_Simple::removeArea

Parameters:

array   $filters   —  Array containing the filters on what application(s) should be removed

[ Top ]

removeArea   [line 353]

void removeArea( array $filters)

Removes all areas define in the filter as well as any rights assigned to that area.

  1.   $filters = array(
  2.       'area_id' => '34'
  3.   );
  4.   $foo $admin->perm->removeArea($filters);

Or you can also remove by any other field like so

  1.   $filters = array(
  2.       'area_define_name' => 'area232'
  3.   );
  4.   $foo $admin->perm->removeArea($filters);

  • Access: public
  • Uses: LiveUser_Admin_Perm_Simple::removeRight

Overridden in child classes as:

LiveUser_Admin_Perm_Complex::removeArea()
Remove Area

Parameters:

array   $filters   —  Array containing the filters on what area(s) should be removed

[ Top ]

removeRight   [line 273]

void removeRight( array $filters)

Remove right
  • Access: public
  • Uses: LiveUser_Admin_Perm_Simple::revokeUserRight

Overridden in child classes as:

LiveUser_Admin_Perm_Medium::removeRight()
Removes right(s)
LiveUser_Admin_Perm_Complex::removeRight()
Remove Right

Parameters:

array   $filters   —  Array containing the filters on what right(s) should be removed

[ Top ]

removeTranslation   [line 578]

void removeTranslation( array $filters)

Remove translation(s)
  • Access: public

Parameters:

array   $filters   —  Array containing the filters on what tranlation(s) should be removed

[ Top ]

removeUser   [line 209]

void removeUser( array $filters)

Remove user
  • Access: public
  • Uses: LiveUser_Admin_Perm_Simple::revokeUserRight

Overridden in child classes as:

LiveUser_Admin_Perm_Medium::removeUser()
Removes user(s)
LiveUser_Admin_Perm_Complex::removeUser()
Remove User

Parameters:

array   $filters   —  Array containing the filters on what user(s) should be removed

[ Top ]

revokeUserRight   [line 526]

void revokeUserRight( array $filters)

Revoke (remove) right(s) from the user(s)
  • Access: public

Parameters:

array   $filters   —  Array containing the filters on what right(s) should be removed from what user(s)

[ Top ]

setCurrentApplication   [line 379]

boolean setCurrentApplication( integer $applicationId)

Set current application
  • Return: always true
  • Access: public

Parameters:

integer   $applicationId   —  id of application

[ Top ]

updateApplication   [line 428]

mixed updateApplication( array $data, array $filters)

Update application - This will update the liveuser_perm_users table
  • Return: false on error, the affected rows on success
  • Access: public

Parameters:

array   $data   —  associative array in the form of $fieldname => $data
array   $filters   —  associative array in the form of $fieldname => $data This will construct the WHERE clause of your update Be careful, if you leave this blank no WHERE clause will be used and all applications will be affected by the update

[ Top ]

updateArea   [line 319]

mixed updateArea( array $data, array $filters)

Update area - This will update the liveuser_perm_users table
  • Return: false on error, the affected rows on success
  • Access: public

Parameters:

array   $data   —  associative array in the form of $fieldname => $data
array   $filters   —  associative array in the form of $fieldname => $data This will construct the WHERE clause of your update Be careful, if you leave this blank no WHERE clause will be used and all areas will be affected by the update

[ Top ]

updateRight   [line 255]

mixed updateRight( array $data, array $filters)

Update right - This will update the liveuser_perm_users table
  • Return: false on error, the affected rows on success
  • Access: public

Parameters:

array   $data   —  associative array in the form of $fieldname => $data
array   $filters   —  associative array in the form of $fieldname => $data This will construct the WHERE clause of your update Be careful, if you leave this blank no WHERE clause will be used and all rights will be affected by the update

[ Top ]

updateTranslation   [line 562]

mixed updateTranslation( array $data, array $filters)

Update translation - This will update the liveuser_perm_users table
  • Return: false on error, the affected rows on success
  • Access: public

Parameters:

array   $data   —  associative array in the form of $fieldname => $data
array   $filters   —  associative array in the form of $fieldname => $data This will construct the WHERE clause of your update Be careful, if you leave this blank no WHERE clause will be used and all translations will be affected by the update

[ Top ]

updateUser   [line 191]

mixed updateUser( array $data, array $filters)

Update user - This will update the liveuser_perm_users table
  • Return: false on error, the affected rows on success
  • Access: public

Parameters:

array   $data   —  associative array in the form of $fieldname => $data
array   $filters   —  associative array in the form of $fieldname => $data This will construct the WHERE clause of your update Be careful, if you leave this blank no WHERE clause will be used and all users will be affected by the update

[ Top ]

updateUserRight   [line 509]

void updateUserRight( array $data, array $filters)

Update right(s) for the given user(s)
  • Access: public

Parameters:

array   $data   — 
array   $filters   — 

[ Top ]


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