Changeset 468 for trunk/lib/ACL.inc.php


Ignore:
Timestamp:
Feb 20, 2014 3:03:59 AM (10 years ago)
Author:
anonymous
Message:

Completed integrating /branches/eli_branch into /trunk. Changes include:

  • Removed closing ?> from end of files
  • Upgrade old-style contructor methods to use construct() instead.
  • Class properties and methods defined as public, private, static or protected
  • Ensure code runs under E_ALL with only mysql_* deprecated warnings
  • Search for the '@' symbol anywhere it might be used to supress runtime errors, then replace with proper error recovery.
  • Run the php cli -l option to check files for syntax errors.
  • Bring tests up-to-date with latest version and methods of PHPUnit
Location:
trunk
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk

  • trunk/lib/ACL.inc.php

    r457 r468  
    3939class ACL {
    4040
     41    // A place to keep an object instance for the singleton pattern.
     42    private static $instance = null;
     43
    4144    // Configuration parameters for this object.
    42     var $_params = array(
    43 
     45    private $_params = array(
    4446        // If false nothing will be cached or retrieved. Useful for testing realtime data requests.
    4547        'enable_cache' => true,
     
    5254     * Constructor.
    5355     */
    54     function ACL()
     56    public function __construct()
    5557    {
    5658        $app =& App::getInstance();
     
    7375     * @static
    7476     */
    75     static function &getInstance()
    76     {
    77         static $instance = null;
    78 
    79         if ($instance === null) {
    80             $instance = new ACL();
    81         }
    82 
    83         return $instance;
     77    public static function &getInstance()
     78    {
     79        if (self::$instance === null) {
     80            self::$instance = new self();
     81        }
     82
     83        return self::$instance;
    8484    }
    8585
     
    9191     * @param  array    $params     Array of parameters (key => val pairs).
    9292     */
    93     function setParam($params)
     93    public function setParam($params)
    9494    {
    9595        $app =& App::getInstance();
     
    110110     * @return mixed               Configured parameter value.
    111111     */
    112     function getParam($param)
     112    public function getParam($param)
    113113    {
    114114        $app =& App::getInstance();
     
    129129     * @since   04 Jun 2006 16:41:42
    130130     */
    131     function initDB($recreate_db=false)
     131    public function initDB($recreate_db=false)
    132132    {
    133133        $app =& App::getInstance();
     
    224224    * @since    14 Jun 2006 22:39:29
    225225    */
    226     function add($name, $parent=null, $type)
     226    public function add($name, $parent=null, $type)
    227227    {
    228228        $app =& App::getInstance();
     
    287287
    288288    // Alias functions for the different object types.
    289     function addRequestObject($name, $parent=null)
     289    public function addRequestObject($name, $parent=null)
    290290    {
    291291        return $this->add($name, $parent, 'aro');
    292292    }
    293     function addControlObject($name, $parent=null)
     293    public function addControlObject($name, $parent=null)
    294294    {
    295295        return $this->add($name, $parent, 'aco');
    296296    }
    297     function addXtraObject($name, $parent=null)
     297    public function addXtraObject($name, $parent=null)
    298298    {
    299299        return $this->add($name, $parent, 'axo');
     
    311311    * @since    14 Jun 2006 22:39:29
    312312    */
    313     function remove($name, $type)
     313    public function remove($name, $type)
    314314    {
    315315        $app =& App::getInstance();
     
    368368
    369369    // Alias functions for the different object types.
    370     function removeRequestObject($name)
     370    public function removeRequestObject($name)
    371371    {
    372372        return $this->remove($name, 'aro');
    373373    }
    374     function removeControlObject($name)
     374    public function removeControlObject($name)
    375375    {
    376376        return $this->remove($name, 'aco');
    377377    }
    378     function removeXtraObject($name)
     378    public function removeXtraObject($name)
    379379    {
    380380        return $this->remove($name, 'axo');
     
    393393    * @since    14 Jun 2006 22:39:29
    394394    */
    395     function move($name, $new_parent, $type)
     395    public function move($name, $new_parent, $type)
    396396    {
    397397        $app =& App::getInstance();
     
    490490
    491491    // Alias functions for the different object types.
    492     function moveRequestObject($name, $new_parent=null)
     492    public function moveRequestObject($name, $new_parent=null)
    493493    {
    494494        return $this->move($name, $new_parent, 'aro');
    495495    }
    496     function moveControlObject($name, $new_parent=null)
     496    public function moveControlObject($name, $new_parent=null)
    497497    {
    498498        return $this->move($name, $new_parent, 'aco');
    499499    }
    500     function moveXtraObject($name, $new_parent=null)
     500    public function moveXtraObject($name, $new_parent=null)
    501501    {
    502502        return $this->move($name, $new_parent, 'axo');
     
    516516    * @since    15 Jun 2006 01:58:48
    517517    */
    518     function grant($aro=null, $aco=null, $axo=null, $access='allow')
     518    public function grant($aro=null, $aco=null, $axo=null, $access='allow')
    519519    {
    520520        $app =& App::getInstance();
     
    573573    * @since    15 Jun 2006 04:35:54
    574574    */
    575     function revoke($aro=null, $aco=null, $axo=null)
     575    public function revoke($aro=null, $aco=null, $axo=null)
    576576    {
    577577        return $this->grant($aro, $aco, $axo, 'deny');
     
    591591    * @since    20 Jun 2006 20:16:12
    592592    */
    593     function delete($aro=null, $aco=null, $axo=null)
     593    public function delete($aro=null, $aco=null, $axo=null)
    594594    {
    595595        $app =& App::getInstance();
     
    650650    * @since    15 Jun 2006 03:58:23
    651651    */
    652     function check($aro, $aco=null, $axo=null)
     652    public function check($aro, $aco=null, $axo=null)
    653653    {
    654654        $app =& App::getInstance();
     
    713713    * @since    20 Jan 2014 12:09:03
    714714    */
    715     function requireAllow($aro, $aco=null, $axo=null, $message='', $type=MSG_NOTICE, $file=null, $line=null)
     715    public function requireAllow($aro, $aco=null, $axo=null, $message='', $type=MSG_NOTICE, $file=null, $line=null)
    716716    {
    717717        $app =& App::getInstance();
     
    725725
    726726} // End class.
    727 
    728 
    729 ?>
Note: See TracChangeset for help on using the changeset viewer.