Changeset 468 for trunk/lib/ACL.inc.php
- Timestamp:
- Feb 20, 2014 3:03:59 AM (10 years ago)
- Location:
- trunk
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk
-
Property
svn:mergeinfo
set to
/branches/eli_branch merged eligible
-
Property
svn:mergeinfo
set to
-
trunk/lib/ACL.inc.php
r457 r468 39 39 class ACL { 40 40 41 // A place to keep an object instance for the singleton pattern. 42 private static $instance = null; 43 41 44 // Configuration parameters for this object. 42 var $_params = array( 43 45 private $_params = array( 44 46 // If false nothing will be cached or retrieved. Useful for testing realtime data requests. 45 47 'enable_cache' => true, … … 52 54 * Constructor. 53 55 */ 54 function ACL()56 public function __construct() 55 57 { 56 58 $app =& App::getInstance(); … … 73 75 * @static 74 76 */ 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; 84 84 } 85 85 … … 91 91 * @param array $params Array of parameters (key => val pairs). 92 92 */ 93 function setParam($params)93 public function setParam($params) 94 94 { 95 95 $app =& App::getInstance(); … … 110 110 * @return mixed Configured parameter value. 111 111 */ 112 function getParam($param)112 public function getParam($param) 113 113 { 114 114 $app =& App::getInstance(); … … 129 129 * @since 04 Jun 2006 16:41:42 130 130 */ 131 function initDB($recreate_db=false)131 public function initDB($recreate_db=false) 132 132 { 133 133 $app =& App::getInstance(); … … 224 224 * @since 14 Jun 2006 22:39:29 225 225 */ 226 function add($name, $parent=null, $type)226 public function add($name, $parent=null, $type) 227 227 { 228 228 $app =& App::getInstance(); … … 287 287 288 288 // Alias functions for the different object types. 289 function addRequestObject($name, $parent=null)289 public function addRequestObject($name, $parent=null) 290 290 { 291 291 return $this->add($name, $parent, 'aro'); 292 292 } 293 function addControlObject($name, $parent=null)293 public function addControlObject($name, $parent=null) 294 294 { 295 295 return $this->add($name, $parent, 'aco'); 296 296 } 297 function addXtraObject($name, $parent=null)297 public function addXtraObject($name, $parent=null) 298 298 { 299 299 return $this->add($name, $parent, 'axo'); … … 311 311 * @since 14 Jun 2006 22:39:29 312 312 */ 313 function remove($name, $type)313 public function remove($name, $type) 314 314 { 315 315 $app =& App::getInstance(); … … 368 368 369 369 // Alias functions for the different object types. 370 function removeRequestObject($name)370 public function removeRequestObject($name) 371 371 { 372 372 return $this->remove($name, 'aro'); 373 373 } 374 function removeControlObject($name)374 public function removeControlObject($name) 375 375 { 376 376 return $this->remove($name, 'aco'); 377 377 } 378 function removeXtraObject($name)378 public function removeXtraObject($name) 379 379 { 380 380 return $this->remove($name, 'axo'); … … 393 393 * @since 14 Jun 2006 22:39:29 394 394 */ 395 function move($name, $new_parent, $type)395 public function move($name, $new_parent, $type) 396 396 { 397 397 $app =& App::getInstance(); … … 490 490 491 491 // Alias functions for the different object types. 492 function moveRequestObject($name, $new_parent=null)492 public function moveRequestObject($name, $new_parent=null) 493 493 { 494 494 return $this->move($name, $new_parent, 'aro'); 495 495 } 496 function moveControlObject($name, $new_parent=null)496 public function moveControlObject($name, $new_parent=null) 497 497 { 498 498 return $this->move($name, $new_parent, 'aco'); 499 499 } 500 function moveXtraObject($name, $new_parent=null)500 public function moveXtraObject($name, $new_parent=null) 501 501 { 502 502 return $this->move($name, $new_parent, 'axo'); … … 516 516 * @since 15 Jun 2006 01:58:48 517 517 */ 518 function grant($aro=null, $aco=null, $axo=null, $access='allow')518 public function grant($aro=null, $aco=null, $axo=null, $access='allow') 519 519 { 520 520 $app =& App::getInstance(); … … 573 573 * @since 15 Jun 2006 04:35:54 574 574 */ 575 function revoke($aro=null, $aco=null, $axo=null)575 public function revoke($aro=null, $aco=null, $axo=null) 576 576 { 577 577 return $this->grant($aro, $aco, $axo, 'deny'); … … 591 591 * @since 20 Jun 2006 20:16:12 592 592 */ 593 function delete($aro=null, $aco=null, $axo=null)593 public function delete($aro=null, $aco=null, $axo=null) 594 594 { 595 595 $app =& App::getInstance(); … … 650 650 * @since 15 Jun 2006 03:58:23 651 651 */ 652 function check($aro, $aco=null, $axo=null)652 public function check($aro, $aco=null, $axo=null) 653 653 { 654 654 $app =& App::getInstance(); … … 713 713 * @since 20 Jan 2014 12:09:03 714 714 */ 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) 716 716 { 717 717 $app =& App::getInstance(); … … 725 725 726 726 } // End class. 727 728 729 ?>
Note: See TracChangeset
for help on using the changeset viewer.