phpDocumentor epesi-base
acl
[ class tree: epesi-base ] [ index: epesi-base ] [ all elements ]

Class: Base_AclCommon

Source Location: /modules/Base/Acl/AclCommon_0.php

Class Base_AclCommon

Class Overview

AclInit class.

This class provides initialization data for Acl module.

Located in /modules/Base/Acl/AclCommon_0.php [line 16]

ModuleAcl
   |
   --ModulePrimitive
      |
      --ModuleCommon
         |
         --Base_AclCommon
Author(s): Information Tags:
Version:  1.0
Copyright:  Copyright © 2008, Telaxus LLC
License:  MIT

Methods

[ Top ]
Inherited Properties, Constants, and Methods
Inherited Properties Inherited Methods Inherited Constants

Inherited From ModuleCommon

ModuleCommon::Instance()
Singleton.

Inherited From ModulePrimitive

ModulePrimitive::__construct()
ModulePrimitive::check_access()
Checks access to function which name is passed as first parameter.
ModulePrimitive::create_data_dir()
Creates default data directory for module. Typical usage: in module installation
ModulePrimitive::get_data_dir()
Returns path to the default data directory for module calling this method.
ModulePrimitive::get_module_dir()
Returns path to the module directory.
ModulePrimitive::get_type()
Returns name(type) of module that called this function.
ModulePrimitive::get_type_with_bt()
ModulePrimitive::remove_data_dir()
Removes default data directory of a module. Typical usage: in module uninstallation

Inherited From ModuleAcl

ModuleAcl::acl_check()
ModuleAcl::add_aco()
ModuleAcl::del_aco()
ModuleAcl::get_type()

[ Top ]
Method Summary
static mixed   add_user()   Creates new User that is automatically assigned to 'User' group.
static void   change_privileges()   Subscribe user to groups and unsubscribe from old groups.
static integer   get_acl_user_id()   Get user id assigned by phpgacl. This value doesn't equal user id from User module.
static array   get_groups()   Gets array of acl groups. Don't use any parameters, it is recursive function.
static integer   get_group_id()   Return id of group.
static array   get_user_groups()   Get groups assigned to user.
static mixed   get_user_groups_names()   Get names of groups to which user is assigned.
static mixed   is_user_in_group()   Checks whether user is in certain group.
static bool   i_am_admin()   Returns whether currently logged in user is an administrator.
static bool   i_am_moderator()   Returns whether currently logged in user is a moderator.
static bool   i_am_sa()   Return if user calling this function is Super Administrator.
static bool   i_am_user()   Returns whether currently logged in user is a user.
static integer   sa_group_id()   Return id of Super administrator group.

[ Top ]
Methods
static method add_user  [line 230]

  static mixed add_user( string $username  )

Creates new User that is automatically assigned to 'User' group.

Parameters:
string   $username:  username

API Tags:
Return:  id of the user on success, false otherwise
Access:  public


[ Top ]
static method change_privileges  [line 50]

  static void change_privileges( string $user, array $groups_new  )

Subscribe user to groups and unsubscribe from old groups.

Parameters:
string   $user:  user login
array   $groups_new:  array with id's of new groups

API Tags:
Access:  public


[ Top ]
static method get_acl_user_id  [line 173]

  static integer get_acl_user_id( string $user  )

Get user id assigned by phpgacl. This value doesn't equal user id from User module.

Parameters:
string   $user: 

API Tags:
Access:  public


[ Top ]
static method get_groups  [line 26]

  static array get_groups( [bool $id = false], [string $separator = '']  )

Gets array of acl groups. Don't use any parameters, it is recursive function.

Array keys are groups ids, values are names with separators as hierarchy.

Parameters:
bool   $id: 
string   $separator: 

API Tags:
Access:  public


[ Top ]
static method get_group_id  [line 158]

  static integer get_group_id( string $g  )

Return id of group.

Parameters:
string   $g:  group name

API Tags:
Access:  public


[ Top ]
static method get_user_groups  [line 219]

  static array get_user_groups( integer $uid  )

Get groups assigned to user.

Parameters:
integer   $uid: 

API Tags:
Access:  public


[ Top ]
static method get_user_groups_names  [line 184]

  static mixed get_user_groups_names( integer $uid  )

Get names of groups to which user is assigned.

Parameters:
integer   $uid:  user acl id (use get_acl_user_id)

API Tags:
Return:  false if you are not super administrator and pointed user is super administrator, string with comma separated group names otherwise.
Access:  public


[ Top ]
static method is_user_in_group  [line 203]

  static mixed is_user_in_group( integer $uid, string $group  )

Checks whether user is in certain group.

Parameters:
integer   $uid:  user acl id (use get_acl_user_id)
string   $group:  group name

API Tags:
Return:  true if user is assigned to given group, false otherwise
Access:  public


[ Top ]
static method i_am_admin  [line 103]

  static bool i_am_admin( )

Returns whether currently logged in user is an administrator.


API Tags:
Return:  true if currently logged in user is an administrator
Access:  public


[ Top ]
static method i_am_moderator  [line 118]

  static bool i_am_moderator( )

Returns whether currently logged in user is a moderator.


API Tags:
Return:  true if currently logged in user is a moderator
Access:  public


[ Top ]
static method i_am_sa  [line 88]

  static bool i_am_sa( )

Return if user calling this function is Super Administrator.


API Tags:
Access:  public


[ Top ]
static method i_am_user  [line 133]

  static bool i_am_user( )

Returns whether currently logged in user is a user.


API Tags:
Return:  true if currently logged in user is a user
Access:  public


[ Top ]
static method sa_group_id  [line 148]

  static integer sa_group_id( )

Return id of Super administrator group.


API Tags:
Access:  public


[ Top ]

Documentation generated on Fri, 26 Dec 2008 21:37:23 -0500 by phpDocumentor 1.4.2