Changeset 2518 for sandbox/workflow/branches/993
- Timestamp:
- 04/14/10 10:59:04 (14 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
sandbox/workflow/branches/993/lib/settings/Settings.php
r2492 r2518 18 18 * @author Pedro Eugênio Rocha - pedro.eugenio.rocha@gmail.com 19 19 */ 20 class Settings {20 final class Settings { 21 21 22 22 /** … … 110 110 111 111 /** 112 * Implements security policy. Throw an exception if not allowed; 113 * do nothing otherwise. Advanced security policies for this class 114 * could be implemeted here. 115 * 116 * @access private 117 * @return void 118 * @static 119 */ 120 private static function _isAllowed() { 121 122 /* if we are an process mode */ 123 if (Security::isEnabled()) { 124 125 /** 126 * even in process mode, if we are dealing with a module class, not process code, 127 * we should grant access. 128 */ 129 if (!Security::isSafeDir(2)) 130 throw new Exception("You are not allowed to access settings."); 131 132 } 133 134 } 135 136 137 /** 112 138 * Returns settings. If the hole path has not be setted, return the hole 113 139 * hierarchy under it. … … 121 147 public static function get() { 122 148 149 /* checking permission to access */ 150 self::_isAllowed(); 151 123 152 /* getting the variable number of parameters */ 124 153 $args = func_get_args(); … … 139 168 140 169 public static function set() { 170 171 /* checking permission to access */ 172 self::_isAllowed(); 141 173 142 174 /* getting the variable number of parameters */
Note: See TracChangeset
for help on using the changeset viewer.