- Timestamp:
- Nov 30, 2013 7:30:44 PM (10 years ago)
- Location:
- branches/eli_branch
- Files:
-
- 37 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/eli_branch/bin/acl.cli.php
r415 r439 375 375 376 376 377 ?> -
branches/eli_branch/bin/module_maker/_config.inc.php
r432 r439 73 73 74 74 75 ?> -
branches/eli_branch/docs/examples/contact_form/contact.php
r413 r439 119 119 } 120 120 121 ?> -
branches/eli_branch/docs/examples/example.cli.php
r396 r439 146 146 147 147 148 ?> -
branches/eli_branch/lib/ACL.inc.php
r438 r439 40 40 41 41 // Configuration parameters for this object. 42 var$_params = array(42 private $_params = array( 43 43 44 44 // If false nothing will be cached or retrieved. Useful for testing realtime data requests. … … 52 52 * Constructor. 53 53 */ 54 function ACL()54 public function __construct() 55 55 { 56 56 $app =& App::getInstance(); … … 73 73 * @static 74 74 */ 75 static function &getInstance()75 public static function &getInstance() 76 76 { 77 77 static $instance = null; … … 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(); -
branches/eli_branch/lib/App.inc.php
r433 r439 43 43 44 44 // Namespace of this application instance. 45 var$_ns;45 private $_ns; 46 46 47 47 // If $app->start has run successfully. 48 var$running = false;48 public $running = false; 49 49 50 50 // Instance of database object. 51 var$db;51 public $db; 52 52 53 53 // Array of query arguments will be carried persistently between requests. 54 var$_carry_queries = array();54 private $_carry_queries = array(); 55 55 56 56 // Dictionary of global application parameters. 57 var$_params = array();57 private $_params = array(); 58 58 59 59 // Default parameters. 60 var$_param_defaults = array(60 private $_param_defaults = array( 61 61 62 62 // Public name and email address for this application. … … 169 169 * @static 170 170 */ 171 static function &getInstance($namespace='')171 public static function &getInstance($namespace='') 172 172 { 173 173 static $instance = null; … … 183 183 * Constructor. 184 184 */ 185 function App($namespace='')185 public function __construct($namespace='') 186 186 { 187 187 // Set namespace of application instance. … … 203 203 * @param array $param Array of parameters (key => val pairs). 204 204 */ 205 function setParam($param=null)205 public function setParam($param=null) 206 206 { 207 207 if (isset($param) && is_array($param)) { … … 218 218 * @return mixed Parameter value, or null if not existing. 219 219 */ 220 function getParam($param=null)220 public function getParam($param=null) 221 221 { 222 222 if ($param === null) { … … 237 237 * @since 15 Jul 2005 00:32:21 238 238 */ 239 function start()239 public function start() 240 240 { 241 241 if ($this->running) { … … 394 394 * @since 17 Jul 2005 17:20:18 395 395 */ 396 function stop()396 public function stop() 397 397 { 398 398 session_write_close(); … … 421 421 * @param string $line __LINE__. 422 422 */ 423 function raiseMsg($message, $type=MSG_NOTICE, $file=null, $line=null)423 public function raiseMsg($message, $type=MSG_NOTICE, $file=null, $line=null) 424 424 { 425 425 $message = trim($message); … … 463 463 * @since 21 Dec 2005 13:09:20 464 464 */ 465 function getRaisedMessages()465 public function getRaisedMessages() 466 466 { 467 467 if (!$this->running) { … … 480 480 * @since 21 Dec 2005 13:21:54 481 481 */ 482 function clearRaisedMessages()482 public function clearRaisedMessages() 483 483 { 484 484 if (!$this->running) { … … 501 501 * @since 15 Jul 2005 01:39:14 502 502 */ 503 function printRaisedMessages($above='', $below='', $print_gotohash_js=false, $hash='sc-msg')503 public function printRaisedMessages($above='', $below='', $print_gotohash_js=false, $hash='sc-msg') 504 504 { 505 505 if (!$this->running) { … … 574 574 * @param string $line The line of the file where the log event occurs. 575 575 */ 576 function logMsg($message, $priority=LOG_INFO, $file=null, $line=null)576 public function logMsg($message, $priority=LOG_INFO, $file=null, $line=null) 577 577 { 578 578 static $previous_events = array(); … … 704 704 * @return The string representation of $priority. 705 705 */ 706 function logPriorityToString($priority) {706 public function logPriorityToString($priority) { 707 707 $priorities = array( 708 708 LOG_EMERG => 'emergency', … … 733 733 * @since 13 Oct 2007 11:34:51 734 734 */ 735 function setQuery($query_key, $val)735 public function setQuery($query_key, $val) 736 736 { 737 737 if (!is_array($query_key)) { … … 755 755 * @since 14 Nov 2005 19:24:52 756 756 */ 757 function carryQuery($query_key, $default=false)757 public function carryQuery($query_key, $default=false) 758 758 { 759 759 if (!is_array($query_key)) { … … 780 780 * @since 18 Jun 2007 20:57:29 781 781 */ 782 function dropQuery($query_key, $unset=false)782 public function dropQuery($query_key, $unset=false) 783 783 { 784 784 if (!is_array($query_key)) { … … 816 816 * @return string url with attached queries and, if not using cookies, the session id 817 817 */ 818 function url($url, $carry_args=null, $always_include_sid=false)818 public function url($url, $carry_args=null, $always_include_sid=false) 819 819 { 820 820 if (!$this->running) { … … 907 907 * @since 09 Dec 2005 17:58:45 908 908 */ 909 function oHREF($url, $carry_args=null, $always_include_sid=false)909 public function oHREF($url, $carry_args=null, $always_include_sid=false) 910 910 { 911 911 $url = $this->url($url, $carry_args, $always_include_sid); … … 927 927 * false <-- To not carry any queries. If URL already has queries those will be retained. 928 928 */ 929 function printHiddenSession($carry_args=null)929 public function printHiddenSession($carry_args=null) 930 930 { 931 931 if (!$this->running) { … … 986 986 * @param bool $always_include_sid Force session id to be added to Location header. 987 987 */ 988 function dieURL($url, $carry_args=null, $always_include_sid=false)988 public function dieURL($url, $carry_args=null, $always_include_sid=false) 989 989 { 990 990 if (!$this->running) { … … 1033 1033 * @since 31 Mar 2006 19:17:00 1034 1034 */ 1035 function dieBoomerangURL($id=null, $carry_args=null, $default_url=null, $queryless_referrer_comparison=false)1035 public function dieBoomerangURL($id=null, $carry_args=null, $default_url=null, $queryless_referrer_comparison=false) 1036 1036 { 1037 1037 if (!$this->running) { … … 1076 1076 * FIXME: url garbage collection? 1077 1077 */ 1078 function setBoomerangURL($url=null, $id=null)1078 public function setBoomerangURL($url=null, $id=null) 1079 1079 { 1080 1080 if (!$this->running) { … … 1115 1115 * @param string $id An identification tag for this url. 1116 1116 */ 1117 function getBoomerangURL($id=null)1117 public function getBoomerangURL($id=null) 1118 1118 { 1119 1119 if (!$this->running) { … … 1140 1140 * @param string $id An identification tag for this url. 1141 1141 */ 1142 function deleteBoomerangURL($id=null)1142 public function deleteBoomerangURL($id=null) 1143 1143 { 1144 1144 if (!$this->running) { … … 1162 1162 * @return bool True if it is set and valid, false otherwise. 1163 1163 */ 1164 function validBoomerangURL($id=null, $use_nonspecificboomerang=false)1164 public function validBoomerangURL($id=null, $use_nonspecificboomerang=false) 1165 1165 { 1166 1166 if (!$this->running) { … … 1212 1212 * the same page but with https. 1213 1213 */ 1214 function sslOn()1214 public function sslOn() 1215 1215 { 1216 1216 if (function_exists('apache_get_modules')) { … … 1233 1233 * a http version of the current url. 1234 1234 */ 1235 function sslOff()1235 public function sslOff() 1236 1236 { 1237 1237 if ('' != getenv('HTTPS')) { … … 1242 1242 1243 1243 } // End. 1244 1245 ?> -
branches/eli_branch/lib/Auth_File.inc.php
r396 r439 4 4 * For details visit the project site: <http://trac.strangecode.com/codebase/> 5 5 * Copyright 2001-2012 Strangecode, LLC 6 * 6 * 7 7 * This file is part of The Strangecode Codebase. 8 8 * … … 11 11 * Free Software Foundation, either version 3 of the License, or (at your option) 12 12 * any later version. 13 * 13 * 14 14 * The Strangecode Codebase is distributed in the hope that it will be useful, but 15 15 * WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or 16 16 * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more 17 17 * details. 18 * 18 * 19 19 * You should have received a copy of the GNU General Public License along with 20 20 * The Strangecode Codebase. If not, see <http://www.gnu.org/licenses/>. … … 30 30 * @version 1.2 31 31 */ 32 32 33 33 // Usage example: 34 34 // $auth = new Auth_File(); … … 47 47 48 48 class Auth_File { 49 49 50 50 // Namespace of this auth object. 51 var$_ns;52 51 private $_ns; 52 53 53 // Parameters to be specified by setParam(). 54 var $_params = array(); 55 var $_default_params = array( 56 57 // Full path to htpasswd file. 58 'htpasswd_file' => null, 59 60 // The type of encryption to use for passwords stored in the db_table. Use one of the AUTH_ENCRYPT_* types specified above. 61 'encryption_type' => AUTH_ENCRYPT_CRYPT, 62 63 // The URL to the login script. 64 'login_url' => '/', 65 66 // The maximum amount of time a user is allowed to be logged in. They will be forced to login again if they expire. 67 // This applies to admins and users. In seconds. 21600 seconds = 6 hours. 68 'login_timeout' => 21600, 69 70 // The maximum amount of time a user is allowed to be idle before their session expires. They will be forced to login again if they expire. 71 // This applies to admins and users. In seconds. 3600 seconds = 1 hour. 72 'idle_timeout' => 3600, 73 74 // An array of IP blocks that are bypass the remote_ip comparison check. Useful for dynamic IPs or those behind proxy servers. 75 'trusted_networks' => array(), 76 ); 54 private $_params = array(); 55 private $_default_params = array( 56 57 // Full path to htpasswd file. 58 'htpasswd_file' => null, 59 60 // The type of encryption to use for passwords stored in the db_table. Use one of the AUTH_ENCRYPT_* types specified above. 61 'encryption_type' => AUTH_ENCRYPT_CRYPT, 62 63 // The URL to the login script. 64 'login_url' => '/', 65 66 // The maximum amount of time a user is allowed to be logged in. They will be forced to login again if they expire. 67 // This applies to admins and users. In seconds. 21600 seconds = 6 hours. 68 'login_timeout' => 21600, 69 70 // The maximum amount of time a user is allowed to be idle before their session expires. They will be forced to login again if they expire. 71 // This applies to admins and users. In seconds. 3600 seconds = 1 hour. 72 'idle_timeout' => 3600, 73 74 // An array of IP blocks that are bypass the remote_ip comparison check. Useful for dynamic IPs or those behind proxy servers. 75 'trusted_networks' => array(), ); 77 76 78 77 // Associative array of usernames to hashed passwords. 79 var$_users = array();78 private $_users = array(); 80 79 81 80 /** … … 86 85 * @param optional array $params A hash containing parameters. 87 86 */ 88 function Auth_File($namespace='') 89 { 90 $this->_ns = $namespace; 87 public function __construct($namespace = '') { 88 $this -> _ns = $namespace; 91 89 92 90 // Initialize default parameters. 93 $this ->setParam($this->_default_params);91 $this -> setParam($this -> _default_params); 94 92 } 95 93 … … 100 98 * @return bool true on success, false on failure 101 99 */ 102 function setParam($params) 103 { 100 public function setParam($params) { 104 101 if (isset($params) && is_array($params)) { 105 102 // Merge new parameters with old overriding only those passed. 106 $this ->_params = array_merge($this->_params, $params);103 $this -> _params = array_merge($this -> _params, $params); 107 104 } 108 105 } … … 115 112 * @return mixed Configured parameter value. 116 113 */ 117 function getParam($param) 118 { 119 $app =& App::getInstance(); 120 121 if (isset($this->_params[$param])) { 122 return $this->_params[$param]; 114 public function getParam($param) { 115 $app = &App::getInstance(); 116 117 if (isset($this -> _params[$param])) { 118 return $this -> _params[$param]; 123 119 } else { 124 $app ->logMsg(sprintf('Parameter is not set: %s', $param), LOG_DEBUG, __FILE__, __LINE__);120 $app -> logMsg(sprintf('Parameter is not set: %s', $param), LOG_DEBUG, __FILE__, __LINE__); 125 121 return null; 126 122 } … … 132 128 * @access public 133 129 */ 134 function clear() 135 { 136 $_SESSION['_auth_file'][$this->_ns] = array('authenticated' => false); 137 } 138 130 public function clear() { 131 $_SESSION['_auth_file'][$this -> _ns] = array('authenticated' => false); 132 } 139 133 140 134 /** … … 145 139 * @param mixed $val Value to set variable to. 146 140 */ 147 function set($key, $val) 148 { 149 if (!isset($_SESSION['_auth_file'][$this->_ns]['user_data'])) { 150 $_SESSION['_auth_file'][$this->_ns]['user_data'] = array(); 151 } 152 $_SESSION['_auth_file'][$this->_ns]['user_data'][$key] = $val; 141 public function set($key, $val) { 142 if (!isset($_SESSION['_auth_file'][$this -> _ns]['user_data'])) { 143 $_SESSION['_auth_file'][$this -> _ns]['user_data'] = array(); 144 } 145 $_SESSION['_auth_file'][$this -> _ns]['user_data'][$key] = $val; 153 146 } 154 147 … … 161 154 * @return mixed Value stored in session. 162 155 */ 163 function get($key, $default='') 164 { 165 if (isset($_SESSION['_auth_file'][$this->_ns][$key])) { 166 return $_SESSION['_auth_file'][$this->_ns][$key]; 167 } else if (isset($_SESSION['_auth_file'][$this->_ns]['user_data'][$key])) { 168 return $_SESSION['_auth_file'][$this->_ns]['user_data'][$key]; 156 public function get($key, $default = '') { 157 if (isset($_SESSION['_auth_file'][$this -> _ns][$key])) { 158 return $_SESSION['_auth_file'][$this -> _ns][$key]; 159 } else if (isset($_SESSION['_auth_file'][$this -> _ns]['user_data'][$key])) { 160 return $_SESSION['_auth_file'][$this -> _ns]['user_data'][$key]; 169 161 } else { 170 162 return $default; 171 163 } 172 164 } 165 173 166 /** 174 167 * Find out if a set of login credentials are valid. Only supports … … 182 175 * @return boolean Whether or not the credentials are valid. 183 176 */ 184 function authenticate($username, $password) 185 { 186 $app =& App::getInstance(); 187 177 public function authenticate($username, $password) { 178 $app = &App::getInstance(); 179 188 180 if ('' == trim($password)) { 189 $app ->logMsg(_("No password provided for authentication."), LOG_INFO, __FILE__, __LINE__);190 return false; 191 } 192 181 $app -> logMsg(_("No password provided for authentication."), LOG_INFO, __FILE__, __LINE__); 182 return false; 183 } 184 193 185 // Load users file. 194 $this ->_loadHTPasswdFile();195 196 if (!isset($this ->_users[$username])) {197 $app ->logMsg(_("User ID provided does not exist."), LOG_INFO, __FILE__, __LINE__);198 return false; 199 } 200 201 if ($this ->_encrypt($password, $this->_users[$username]) != $this->_users[$username]) {202 $app ->logMsg(sprintf('Authentication failed for user %s', $username), LOG_INFO, __FILE__, __LINE__);203 return false; 204 } 205 186 $this -> _loadHTPasswdFile(); 187 188 if (!isset($this -> _users[$username])) { 189 $app -> logMsg(_("User ID provided does not exist."), LOG_INFO, __FILE__, __LINE__); 190 return false; 191 } 192 193 if ($this -> _encrypt($password, $this -> _users[$username]) != $this -> _users[$username]) { 194 $app -> logMsg(sprintf('Authentication failed for user %s', $username), LOG_INFO, __FILE__, __LINE__); 195 return false; 196 } 197 206 198 // Authentication successful! 207 199 return true; … … 218 210 * @return boolean Whether or not the credentials are valid. 219 211 */ 220 function login($username, $password) 221 { 212 public function login($username, $password) { 222 213 $username = mb_strtolower(trim($username)); 223 214 224 $this ->clear();225 226 if (!$this ->authenticate($username, $password)) {215 $this -> clear(); 216 217 if (!$this -> authenticate($username, $password)) { 227 218 // No login: failed authentication! 228 219 return false; 229 220 } 230 231 $_SESSION['_auth_file'][$this->_ns] = array( 232 'authenticated' => true, 233 'username' => $username, 234 'login_datetime' => date('Y-m-d H:i:s'), 235 'last_access_datetime' => date('Y-m-d H:i:s'), 236 'remote_ip' => getRemoteAddr() 237 ); 221 222 $_SESSION['_auth_file'][$this -> _ns] = array('authenticated' => true, 'username' => $username, 'login_datetime' => date('Y-m-d H:i:s'), 'last_access_datetime' => date('Y-m-d H:i:s'), 'remote_ip' => getRemoteAddr()); 238 223 239 224 // We're logged-in! … … 251 236 * @access public 252 237 */ 253 function isLoggedIn() 254 { 255 $app =& App::getInstance(); 256 238 public function isLoggedIn() { 239 $app = &App::getInstance(); 240 257 241 // Some users will access from networks with a changing IP number (i.e. behind a proxy server). These users must be allowed entry by adding their IP to the list of trusted_networks. 258 if ($trusted_net = ipInRange(getRemoteAddr(), $this ->_params['trusted_networks'])) {242 if ($trusted_net = ipInRange(getRemoteAddr(), $this -> _params['trusted_networks'])) { 259 243 $user_in_trusted_network = true; 260 $app ->logMsg(sprintf('User %s accessing from trusted network %s', $_SESSION['_auth_file'][$this->_ns]['username'], $trusted_net), LOG_DEBUG, __FILE__, __LINE__);244 $app -> logMsg(sprintf('User %s accessing from trusted network %s', $_SESSION['_auth_file'][$this -> _ns]['username'], $trusted_net), LOG_DEBUG, __FILE__, __LINE__); 261 245 } else if (preg_match('/proxy.aol.com$/i', getRemoteAddr(true))) { 262 246 $user_in_trusted_network = true; 263 $app ->logMsg(sprintf('User %s accessing from trusted network proxy.aol.com', $_SESSION['_auth_file'][$this->_ns]['username']), LOG_DEBUG, __FILE__, __LINE__);247 $app -> logMsg(sprintf('User %s accessing from trusted network proxy.aol.com', $_SESSION['_auth_file'][$this -> _ns]['username']), LOG_DEBUG, __FILE__, __LINE__); 264 248 } else { 265 249 $user_in_trusted_network = false; … … 267 251 268 252 // Test login with information stored in session. Skip IP matching for users from trusted networks. 269 if (isset($_SESSION['_auth_file'][$this->_ns]) 270 && true === $_SESSION['_auth_file'][$this->_ns]['authenticated'] 271 && !empty($_SESSION['_auth_file'][$this->_ns]['username']) 272 && strtotime($_SESSION['_auth_file'][$this->_ns]['login_datetime']) > time() - $this->_params['login_timeout'] 273 && strtotime($_SESSION['_auth_file'][$this->_ns]['last_access_datetime']) > time() - $this->_params['idle_timeout'] 274 && ($_SESSION['_auth_file'][$this->_ns]['remote_ip'] == getRemoteAddr() || $user_in_trusted_network) 275 ) { 253 if (isset($_SESSION['_auth_file'][$this -> _ns]) && true === $_SESSION['_auth_file'][$this -> _ns]['authenticated'] && !empty($_SESSION['_auth_file'][$this -> _ns]['username']) && strtotime($_SESSION['_auth_file'][$this -> _ns]['login_datetime']) > time() - $this -> _params['login_timeout'] && strtotime($_SESSION['_auth_file'][$this -> _ns]['last_access_datetime']) > time() - $this -> _params['idle_timeout'] && ($_SESSION['_auth_file'][$this -> _ns]['remote_ip'] == getRemoteAddr() || $user_in_trusted_network)) { 276 254 // User is authenticated! 277 $_SESSION['_auth_file'][$this ->_ns]['last_access_datetime'] = date('Y-m-d H:i:s');255 $_SESSION['_auth_file'][$this -> _ns]['last_access_datetime'] = date('Y-m-d H:i:s'); 278 256 return true; 279 } else if (isset($_SESSION['_auth_file'][$this ->_ns]) && true === $_SESSION['_auth_file'][$this->_ns]['authenticated']) {280 if (strtotime($_SESSION['_auth_file'][$this ->_ns]['last_access_datetime']) > time() - 43200) {257 } else if (isset($_SESSION['_auth_file'][$this -> _ns]) && true === $_SESSION['_auth_file'][$this -> _ns]['authenticated']) { 258 if (strtotime($_SESSION['_auth_file'][$this -> _ns]['last_access_datetime']) > time() - 43200) { 281 259 // Only raise message if last session is less than 12 hours old. 282 $app ->raiseMsg(_("Your session has closed. You need to log-in again."), MSG_NOTICE, __FILE__, __LINE__);260 $app -> raiseMsg(_("Your session has closed. You need to log-in again."), MSG_NOTICE, __FILE__, __LINE__); 283 261 } 284 262 285 263 // Log the reason for login expiration. 286 264 $expire_reasons = array(); 287 if (empty($_SESSION['_auth_file'][$this ->_ns]['username'])) {265 if (empty($_SESSION['_auth_file'][$this -> _ns]['username'])) { 288 266 $expire_reasons[] = 'username not found'; 289 267 } 290 if (strtotime($_SESSION['_auth_file'][$this ->_ns]['login_datetime']) <= time() - $this->_params['login_timeout']) {268 if (strtotime($_SESSION['_auth_file'][$this -> _ns]['login_datetime']) <= time() - $this -> _params['login_timeout']) { 291 269 $expire_reasons[] = 'login_timeout expired'; 292 270 } 293 if (strtotime($_SESSION['_auth_file'][$this ->_ns]['last_access_datetime']) <= time() - $this->_params['idle_timeout']) {271 if (strtotime($_SESSION['_auth_file'][$this -> _ns]['last_access_datetime']) <= time() - $this -> _params['idle_timeout']) { 294 272 $expire_reasons[] = 'idle_timeout expired'; 295 273 } 296 if ($_SESSION['_auth_file'][$this ->_ns]['remote_ip'] != getRemoteAddr() && !$user_in_trusted_network) {297 $expire_reasons[] = sprintf('remote_ip not matched (%s != %s)', $_SESSION['_auth_file'][$this ->_ns]['remote_ip'], getRemoteAddr());298 } 299 $app ->logMsg(sprintf('User %s session expired: %s', $_SESSION['_auth_file'][$this->_ns]['username'], join(', ', $expire_reasons)), LOG_INFO, __FILE__, __LINE__);274 if ($_SESSION['_auth_file'][$this -> _ns]['remote_ip'] != getRemoteAddr() && !$user_in_trusted_network) { 275 $expire_reasons[] = sprintf('remote_ip not matched (%s != %s)', $_SESSION['_auth_file'][$this -> _ns]['remote_ip'], getRemoteAddr()); 276 } 277 $app -> logMsg(sprintf('User %s session expired: %s', $_SESSION['_auth_file'][$this -> _ns]['username'], join(', ', $expire_reasons)), LOG_INFO, __FILE__, __LINE__); 300 278 } 301 279 … … 313 291 * @access public 314 292 */ 315 function requireLogin($message='', $type=MSG_NOTICE, $file=null, $line=null) 316 { 317 $app =& App::getInstance(); 318 319 if (!$this->isLoggedIn()) { 293 public function requireLogin($message = '', $type = MSG_NOTICE, $file = null, $line = null) { 294 $app = &App::getInstance(); 295 296 if (!$this -> isLoggedIn()) { 320 297 // Display message for requiring login. (RaiseMsg will ignore empty strings.) 321 $app ->raiseMsg($message, $type, $file, $line);298 $app -> raiseMsg($message, $type, $file, $line); 322 299 323 300 // Login scripts must have the same 'login' tag for boomerangURL verification/manipulation. 324 $app ->setBoomerangURL(absoluteMe(), 'login');325 $app ->dieURL($this->_params['login_url']);326 } 327 } 328 301 $app -> setBoomerangURL(absoluteMe(), 'login'); 302 $app -> dieURL($this -> _params['login_url']); 303 } 304 } 305 329 306 /** 330 307 * Wrapper function for compatibility with lib/Lock.inc.php. … … 333 310 * @return string Username, or false if none found. 334 311 */ 335 function getUsername($username) 336 { 312 public function getUsername($username) { 337 313 if ('' != $username) { 338 314 return $username; … … 343 319 344 320 /* 345 * Reads the configured htpasswd file into the _users array. 346 * 347 * @access public 348 * @return false on error, true on success. 349 * @author Quinn Comendant <quinn@strangecode.com> 350 * @version 1.0 351 * @since 18 Apr 2006 18:17:48 352 */ 353 function _loadHTPasswdFile() 354 { 355 $app =& App::getInstance(); 356 321 * Reads the configured htpasswd file into the _users array. 322 * 323 * @access public 324 * @return false on error, true on success. 325 * @author Quinn Comendant <quinn@strangecode.com> 326 * @version 1.0 327 * @since 18 Apr 2006 18:17:48 328 */ 329 private function _loadHTPasswdFile() { 330 $app = &App::getInstance(); 331 357 332 static $users = null; 358 359 if (!file_exists($this ->_params['htpasswd_file'])) {360 $app ->logMsg(sprintf('htpasswd file missing or not specified: %s', $this->_params['htpasswd_file']), LOG_ERR, __FILE__, __LINE__);361 return false; 362 } 363 333 334 if (!file_exists($this -> _params['htpasswd_file'])) { 335 $app -> logMsg(sprintf('htpasswd file missing or not specified: %s', $this -> _params['htpasswd_file']), LOG_ERR, __FILE__, __LINE__); 336 return false; 337 } 338 364 339 if (!isset($users)) { 365 if (false === ($users = file($this ->_params['htpasswd_file']))) {366 $app ->logMsg(sprintf('Could not read htpasswd file: %s', $this->_params['htpasswd_file']), LOG_ERR, __FILE__, __LINE__);340 if (false === ($users = file($this -> _params['htpasswd_file']))) { 341 $app -> logMsg(sprintf('Could not read htpasswd file: %s', $this -> _params['htpasswd_file']), LOG_ERR, __FILE__, __LINE__); 367 342 return false; 368 343 } … … 372 347 foreach ($users as $u) { 373 348 list($user, $pass) = explode(':', $u, 2); 374 $this ->_users[trim($user)] = trim($pass);349 $this -> _users[trim($user)] = trim($pass); 375 350 } 376 351 return true; … … 388 363 * @return string The hashed password. 389 364 */ 390 function _encrypt($password, $encrypted_password=null) 391 { 365 private function _encrypt($password, $encrypted_password = null) { 392 366 switch ($this->_params['encryption_type']) { 393 case AUTH_ENCRYPT_PLAINTEXT :394 return $password;395 break;396 397 case AUTH_ENCRYPT_SHA1 :398 return sha1($password);399 break;400 401 case AUTH_ENCRYPT_MD5 :402 return md5($password);403 break;404 405 case AUTH_ENCRYPT_CRYPT :406 default :407 return crypt($password, $encrypted_password);408 break;367 case AUTH_ENCRYPT_PLAINTEXT : 368 return $password; 369 break; 370 371 case AUTH_ENCRYPT_SHA1 : 372 return sha1($password); 373 break; 374 375 case AUTH_ENCRYPT_MD5 : 376 return md5($password); 377 break; 378 379 case AUTH_ENCRYPT_CRYPT : 380 default : 381 return crypt($password, $encrypted_password); 382 break; 409 383 } 410 384 } 411 385 412 386 } // end class 413 ?> -
branches/eli_branch/lib/Auth_SQL.inc.php
r432 r439 41 41 42 42 // Namespace of this auth object. 43 var$_ns;43 private $_ns; 44 44 45 45 // Static var for test. 46 var$_authentication_tested;46 private $_authentication_tested; 47 47 48 48 // Parameters to be configured by setParam. 49 var$_params = array();50 var$_default_params = array(49 private $_params = array(); 50 private $_default_params = array( 51 51 52 52 // Automatically create table and verify columns. Better set to false after site launch. … … 127 127 * @param optional array $params A hash containing parameters. 128 128 */ 129 function Auth_SQL($namespace='')129 public function __construct($namespace='') 130 130 { 131 131 $app =& App::getInstance(); … … 153 153 * @since 26 Aug 2005 17:09:36 154 154 */ 155 function initDB($recreate_db=false)155 public function initDB($recreate_db=false) 156 156 { 157 157 $app =& App::getInstance(); … … 253 253 * @return bool true on success, false on failure 254 254 */ 255 function setParam($params)255 public function setParam($params) 256 256 { 257 257 if (isset($params['match_remote_ip_exempt_usernames'])) { … … 274 274 * @return mixed Configured parameter value. 275 275 */ 276 function getParam($param)276 public function getParam($param) 277 277 { 278 278 $app =& App::getInstance(); … … 291 291 * @access public 292 292 */ 293 function clear()293 public function clear() 294 294 { 295 295 $db =& DB::getInstance(); … … 326 326 * @param mixed $val Value to set variable to. 327 327 */ 328 function set($key, $val)328 public function set($key, $val) 329 329 { 330 330 if (!isset($_SESSION['_auth_sql'][$this->_ns]['user_data'])) { … … 342 342 * @return mixed Value stored in session. 343 343 */ 344 function get($key, $default='')344 public function get($key, $default='') 345 345 { 346 346 if (isset($_SESSION['_auth_sql'][$this->_ns][$key])) { … … 361 361 * @return mixed False if credentials not found in DB, or returns DB row matching credentials. 362 362 */ 363 function authenticate($username, $password)363 public function authenticate($username, $password) 364 364 { 365 365 $app =& App::getInstance(); … … 412 412 * @return boolean Whether or not the credentials are valid. 413 413 */ 414 function login($username, $password)414 public function login($username, $password) 415 415 { 416 416 $app =& App::getInstance(); … … 534 534 * @access public 535 535 */ 536 function isLoggedIn($user_id=null)536 public function isLoggedIn($user_id=null) 537 537 { 538 538 $app =& App::getInstance(); … … 668 668 * @access public 669 669 */ 670 function requireLogin($message='', $type=MSG_NOTICE, $file=null, $line=null)670 public function requireLogin($message='', $type=MSG_NOTICE, $file=null, $line=null) 671 671 { 672 672 $app =& App::getInstance(); … … 690 690 * @param string $reason The reason for blocking the account. 691 691 */ 692 function blockAccount($user_id=null, $reason='')692 public function blockAccount($user_id=null, $reason='') 693 693 { 694 694 $app =& App::getInstance(); … … 720 720 * @return boolean True if the user is blocked, false otherwise. 721 721 */ 722 function isBlocked($user_id=null)722 public function isBlocked($user_id=null) 723 723 { 724 724 $db =& DB::getInstance(); … … 742 742 * Unblocks a user in the db_table, and clears any blocked_reason. 743 743 */ 744 function unblockAccount($user_id=null)744 public function unblockAccount($user_id=null) 745 745 { 746 746 $db =& DB::getInstance(); … … 766 766 * @return bool True if username exists. 767 767 */ 768 function usernameExists($username)768 public function usernameExists($username) 769 769 { 770 770 $db =& DB::getInstance(); … … 786 786 * @return string Username, or false if none found. 787 787 */ 788 function getUsername($user_id)788 public function getUsername($user_id) 789 789 { 790 790 $db =& DB::getInstance(); … … 820 820 * @return string a password 821 821 */ 822 function generatePassword($pattern='CvcdCvc')822 public function generatePassword($pattern='CvcdCvc') 823 823 { 824 824 $app =& App::getInstance(); … … 843 843 * 844 844 */ 845 function encryptPassword($password, $salt=null)845 public function encryptPassword($password, $salt=null) 846 846 { 847 847 $app =& App::getInstance(); … … 898 898 * 899 899 */ 900 function setPassword($user_id=null, $password)900 public function setPassword($user_id=null, $password) 901 901 { 902 902 $app =& App::getInstance(); … … 948 948 * @return string The user's new password. 949 949 */ 950 function resetPassword($user_id=null, $reason='')950 public function resetPassword($user_id=null, $reason='') 951 951 { 952 952 $app =& App::getInstance(); … … 1013 1013 * @return bool true if user is a member of security zone, false otherwise 1014 1014 */ 1015 function inClearanceZone($security_zone, $user_type='')1015 public function inClearanceZone($security_zone, $user_type='') 1016 1016 { 1017 1017 // return true; /// WTF? … … 1036 1036 * @param constant $security_zone string of comma delimited privileges for the zone 1037 1037 */ 1038 function requireAccessClearance($security_zone, $message='')1038 public function requireAccessClearance($security_zone, $message='') 1039 1039 { 1040 1040 $app =& App::getInstance(); … … 1094 1094 // 128.0.0.0 10000000.00000000.00000000.00000000 /1 1095 1095 // 0.0.0.0 00000000.00000000.00000000.00000000 /0 IP space 1096 ?> -
branches/eli_branch/lib/AuthorizeNet.inc.php
r438 r439 61 61 class AuthorizeNet { 62 62 63 var$post_url = ''; // The URL to post data to.64 var$_results = array();65 var$_params = array();66 var$_default_params = array(63 public $post_url = ''; // The URL to post data to. 64 private $_results = array(); 65 private $_params = array(); 66 private $_default_params = array( 67 67 'x_version' => '3.1', 68 68 'x_relay_response' => 'FALSE', … … 80 80 81 81 // Array of response names. Used in the results array. 82 var$_result_fields = Array(82 private $_result_fields = Array( 83 83 'x_response_code', 84 84 'x_response_subcode', … … 129 129 * @param optional array $_params A hash containing parameters. 130 130 */ 131 function AuthorizeNet($params = array())131 public function __construct($params = array()) 132 132 { 133 133 $app =& App::getInstance(); … … 153 153 * @param array $params Array of parameters (key => val pairs). 154 154 */ 155 function setParam($params)155 public function setParam($params) 156 156 { 157 157 $app =& App::getInstance(); … … 172 172 * @return mixed Configured parameter value. 173 173 */ 174 function getParam($param)174 public function getParam($param) 175 175 { 176 176 $app =& App::getInstance(); … … 192 192 * @return mixed False or x_response_code: false = error, 1 = accepted, 2 = declined, 3 = error 193 193 */ 194 function process()194 public function process() 195 195 { 196 196 $app =& App::getInstance(); … … 245 245 * @return array Returns the results array. 246 246 */ 247 function getResult($key=null)247 public function getResult($key=null) 248 248 { 249 249 if (isset($key)) { … … 265 265 * @return bool True if the hash is valid, false otherwise. 266 266 */ 267 function validMD5Hash()267 public function validMD5Hash() 268 268 { 269 269 return ( … … 282 282 * @access public 283 283 */ 284 function reset()284 public function reset() 285 285 { 286 286 $this->_results = Array(); … … 297 297 * @return integer Transaction result code. 298 298 */ 299 function _processResult($result)299 private function _processResult($result) 300 300 { 301 301 $this->_results = Array(); -
branches/eli_branch/lib/CSS.inc.php
r396 r439 32 32 33 33 // Include these style sheets. 34 var$_css_files = array('default' => array());34 private $_css_files = array('default' => array()); 35 35 36 36 // CSS object parameters. 37 var$_params = array(37 private $_params = array( 38 38 'character_set' => 'utf-8', 39 39 'cache_css' => false, … … 48 48 * @param array $params Array of parameters (key => val pairs). 49 49 */ 50 function setParam($params)50 public function setParam($params) 51 51 { 52 52 $app =& App::getInstance(); … … 67 67 * @return mixed Configured parameter value. 68 68 */ 69 function getParam($param)69 public function getParam($param) 70 70 { 71 71 $app =& App::getInstance(); … … 87 87 * @return bool True on success, false on failure. 88 88 */ 89 function setFile($file, $realms='')89 public function setFile($file, $realms='') 90 90 { 91 91 $app =& App::getInstance(); … … 115 115 * @return bool False if no files have been set. 116 116 */ 117 function headers($realm='')117 public function headers($realm='') 118 118 { 119 119 $app =& App::getInstance(); … … 157 157 * @return bool False if no files have been set. 158 158 */ 159 function output($realm='')159 public function output($realm='') 160 160 { 161 161 $realm = '' == $realm ? 'default' : $realm; … … 181 181 } 182 182 } 183 ?> -
branches/eli_branch/lib/Cache.inc.php
r438 r439 38 38 39 39 // Namespace of this instance of Prefs. 40 var$_ns;40 private $_ns; 41 41 42 42 // Configuration parameters for this object. 43 var$_params = array(43 private $_params = array( 44 44 45 45 // If false nothing will be cached or retrieved. Useful for testing realtime data requests. … … 65 65 * @since 05 Jun 2006 23:14:21 66 66 */ 67 function Cache($namespace='')67 function __construct($namespace='') 68 68 { 69 69 $app =& App::getInstance(); … … 88 88 * @static 89 89 */ 90 static function &getInstance($namespace='')90 public static function &getInstance($namespace='') 91 91 { 92 92 static $instances = array(); … … 105 105 * @param array $params Array of parameters (key => val pairs). 106 106 */ 107 function setParam($params)107 public function setParam($params) 108 108 { 109 109 $app =& App::getInstance(); … … 124 124 * @return mixed Configured parameter value. 125 125 */ 126 function getParam($param)126 public function getParam($param) 127 127 { 128 128 $app =& App::getInstance(); … … 148 148 * @return bool True on success, false otherwise. 149 149 */ 150 function set($key, $var, $flags=0)150 public function set($key, $var, $flags=0) 151 151 { 152 152 $app =& App::getInstance(); … … 197 197 * @return mixed The requested datum, or false on failure. 198 198 */ 199 function get($key)199 public function get($key) 200 200 { 201 201 $app =& App::getInstance(); … … 226 226 * @return bool True if a value exists for the given key. 227 227 */ 228 function exists($key)228 public function exists($key) 229 229 { 230 230 $app =& App::getInstance(); … … 244 244 * @return bool True if the value existed before being unset. 245 245 */ 246 function delete($key)246 public function delete($key) 247 247 { 248 248 if (array_key_exists($key, $_SESSION['_cache'][$this->_ns])) { … … 262 262 * @since 05 Jun 2006 23:51:34 263 263 */ 264 function clear()264 public function clear() 265 265 { 266 266 $_SESSION['_cache'][$this->_ns] = array(); -
branches/eli_branch/lib/Captcha.inc.php
r396 r439 54 54 class Captcha { 55 55 56 var$secret_key = 'some random seed text for the md5';57 var$random_number;58 var$ascii_numbers = array(56 public $secret_key = 'some random seed text for the md5'; 57 public $random_number; 58 public $ascii_numbers = array( 59 59 array( 60 60 ' ##### ', … … 147 147 * @since 20 Jan 2006 13:08:22 148 148 */ 149 function Captcha()149 public function __construct() 150 150 { 151 151 $app =& App::getInstance(); … … 164 164 * @since 07 Dec 2005 21:59:25 165 165 */ 166 function getAsciiNumber($num=null)166 public function getAsciiNumber($num=null) 167 167 { 168 168 $app =& App::getInstance(); … … 200 200 * @since 07 Dec 2005 22:09:04 201 201 */ 202 function printAsciiNumber()202 public function printAsciiNumber() 203 203 { 204 204 $ascii = $this->getAsciiNumber($this->random_number); … … 213 213 * @since 07 Dec 2005 22:09:04 214 214 */ 215 function printForm()215 public function printForm() 216 216 { 217 217 $hash = $this->_getMD5key($this->random_number); … … 231 231 * @since 07 Dec 2005 22:19:33 232 232 */ 233 function valid()233 public function valid() 234 234 { 235 235 $number = getFormData('sc-captcha-input'); … … 251 251 * @since 07 Dec 2005 21:40:25 252 252 */ 253 function _getRandomNumber()253 public function _getRandomNumber() 254 254 { 255 255 return mb_substr(strval(rand(10000, 99999)), 0, rand(3, 5)); … … 265 265 * @since 07 Dec 2005 21:53:35 266 266 */ 267 function _getMD5key($input)267 public function _getMD5key($input) 268 268 { 269 269 return md5($this->secret_key . $input); … … 272 272 } 273 273 274 ?> -
branches/eli_branch/lib/Cart.inc.php
r396 r439 71 71 72 72 // Namespace of this instance. 73 var$_ns;73 private $_ns; 74 74 75 75 // Configuration parameters for this object. 76 var$_params = array(76 private $_params = array( 77 77 ); 78 78 … … 80 80 * Cart constructor. 81 81 */ 82 function Cart($namespace='')82 public function __construct($namespace='') 83 83 { 84 84 $app =& App::getInstance(); … … 97 97 * @param array $params Array of param keys and values to set. 98 98 */ 99 function setParam($params=null)99 public function setParam($params=null) 100 100 { 101 101 if (isset($params) && is_array($params)) { … … 112 112 * @return mixed Configured parameter value. 113 113 */ 114 function getParam($param)114 public function getParam($param) 115 115 { 116 116 $app =& App::getInstance(); … … 137 137 * @since 11 Mar 2008 18:59:37 138 138 */ 139 function add($item_id, $price, $quantity=1, $specs=array())139 public function add($item_id, $price, $quantity=1, $specs=array()) 140 140 { 141 141 $app =& App::getInstance(); … … 166 166 * @since 10 May 2008 16:42:25 167 167 */ 168 function setQty($item_id, $quantity)168 public function setQty($item_id, $quantity) 169 169 { 170 170 if ($quantity <= 0) { … … 195 195 * @since 10 May 2008 16:42:25 196 196 */ 197 function setPrice($item_id, $price)197 public function setPrice($item_id, $price) 198 198 { 199 199 if (isset($_SESSION['_cart'][$this->_ns]['items'][$item_id])) { … … 218 218 * @since 11 Mar 2008 18:59:48 219 219 */ 220 function remove($item_id)220 public function remove($item_id) 221 221 { 222 222 $app =& App::getInstance(); … … 242 242 * @since 11 Mar 2008 18:59:55 243 243 */ 244 function get($item_id, $spec_key)244 public function get($item_id, $spec_key) 245 245 { 246 246 if (isset($_SESSION['_cart'][$this->_ns]['items'][$item_id][$spec_key])) { … … 259 259 * @since 11 Mar 2008 18:59:55 260 260 */ 261 function getList()261 public function getList() 262 262 { 263 263 return $_SESSION['_cart'][$this->_ns]['items']; … … 277 277 * @since 11 Mar 2008 19:00:12 278 278 */ 279 function sum($key='extended_price')279 public function sum($key='extended_price') 280 280 { 281 281 $sum = 0; … … 306 306 * as $auth->clear(), such as when logging out. 307 307 */ 308 function clear()308 public function clear() 309 309 { 310 310 $_SESSION['_cart'][$this->_ns] = array( … … 313 313 } 314 314 } 315 316 317 ?> -
branches/eli_branch/lib/Currency.inc.php
r438 r439 41 41 42 42 // Configuration parameters for this object. 43 var$_params = array(43 private $_params = array( 44 44 'cache_result' => true, 45 45 'cache_dir' => '', … … 52 52 * Cart constructor. 53 53 */ 54 function Currency($params=array())54 public function __construct($params=array()) 55 55 { 56 56 $app =& App::getInstance(); … … 79 79 * @param array $params Array of param keys and values to set. 80 80 */ 81 function setParam($params=null)81 public function setParam($params=null) 82 82 { 83 83 if (isset($params) && is_array($params)) { … … 94 94 * @return mixed Configured parameter value. 95 95 */ 96 function getParam($param)96 public function getParam($param) 97 97 { 98 98 $app =& App::getInstance(); … … 118 118 * @since 05 May 2008 23:50:59 119 119 */ 120 function getValue($amount, $base, $target)120 public function getValue($amount, $base, $target) 121 121 { 122 122 if (false !== $rate = $this->getRate($base, $target)) { … … 138 138 * @since 25 May 2011 01:26:24 139 139 */ 140 function getRate($base, $target)140 public function getRate($base, $target) 141 141 { 142 142 $app =& App::getInstance(); … … 180 180 * @access private 181 181 */ 182 function _performAPICall($parameters=null)182 private function _performAPICall($parameters=null) 183 183 { 184 184 $app =& App::getInstance(); -
branches/eli_branch/lib/DB.inc.php
r438 r439 33 33 34 34 // If $db->connect has successfully opened a db connection. 35 var$_connected = false;35 private $_connected = false; 36 36 37 37 // Database handle. 38 var$dbh;38 public $dbh; 39 39 40 40 // Count how many queries run during the whole instance. 41 var$_query_count = 0;41 private $_query_count = 0; 42 42 43 43 // Hash of DB parameters. 44 var$_params = array();44 private $_params = array(); 45 45 46 46 // Default parameters. 47 var$_param_defaults = array(47 private $_param_defaults = array( 48 48 49 49 // DB passwords should be set as apache environment variables in httpd.conf, readable only by root. … … 64 64 65 65 // Translate between HTML and MySQL character set names. 66 var$mysql_character_sets = array(66 public $mysql_character_sets = array( 67 67 'utf-8' => 'utf8', 68 68 'iso-8859-1' => 'latin1', … … 70 70 71 71 // Caches. 72 var$existing_tables;73 var$table_columns;72 public $existing_tables; 73 public $table_columns; 74 74 75 75 /** … … 80 80 * @static 81 81 */ 82 static function &getInstance()82 public static function &getInstance() 83 83 { 84 84 static $instance = null; … … 98 98 * @param array $params Array of parameters (key => val pairs). 99 99 */ 100 function setParam($params)100 public function setParam($params) 101 101 { 102 102 $app =& App::getInstance(); … … 117 117 * @return mixed Configured parameter value. 118 118 */ 119 function getParam($param)119 public function getParam($param) 120 120 { 121 121 $app =& App::getInstance(); … … 136 136 * @since 28 Aug 2005 14:02:49 137 137 */ 138 function connect()138 public function connect() 139 139 { 140 140 $app =& App::getInstance(); … … 185 185 * @since 28 Aug 2005 14:32:01 186 186 */ 187 function close()187 public function close() 188 188 { 189 189 if (!$this->_connected) { … … 204 204 * @since 03 Jul 2013 14:50:23 205 205 */ 206 function reconnect()206 public function reconnect() 207 207 { 208 208 $this->close(); … … 221 221 * @since 15 Jan 2007 15:59:00 222 222 */ 223 function _fail()223 private function _fail() 224 224 { 225 225 if ($this->getParam('db_die_on_failure')) { … … 240 240 * @since 20 Aug 2005 13:50:36 241 241 */ 242 function getDBH()242 public function getDBH() 243 243 { 244 244 if (!$this->_connected) { … … 256 256 * @since 28 Aug 2005 14:58:09 257 257 */ 258 function isConnected()258 public function isConnected() 259 259 { 260 260 return (true === $this->_connected); … … 270 270 * @since 06 Mar 2006 16:41:32 271 271 */ 272 function escapeString($string)272 public function escapeString($string) 273 273 { 274 274 if (!$this->_connected) { … … 287 287 * @return resource Query identifier 288 288 */ 289 function query($query, $debug=false)289 public function query($query, $debug=false) 290 290 { 291 291 $app =& App::getInstance(); … … 336 336 * @return bool true if given $table exists. 337 337 */ 338 function tableExists($table, $use_cached_results=true)338 public function tableExists($table, $use_cached_results=true) 339 339 { 340 340 $app =& App::getInstance(); … … 368 368 * @return bool true if column(s) exist. 369 369 */ 370 function columnExists($table, $columns, $strict=true, $use_cached_results=true)370 public function columnExists($table, $columns, $strict=true, $use_cached_results=true) 371 371 { 372 372 if (!$this->_connected) { … … 416 416 * @since 15 Jun 2006 11:46:05 417 417 */ 418 function numQueries()418 public function numQueries() 419 419 { 420 420 return $this->_query_count; … … 428 428 * @since 28 Aug 2005 22:10:50 429 429 */ 430 function resetCache()430 public function resetCache() 431 431 { 432 432 $this->existing_tables = null; -
branches/eli_branch/lib/DBSessionHandler.inc.php
r438 r439 32 32 class DBSessionHandler { 33 33 34 var$db; // DB object.34 public $db; // DB object. 35 35 36 var$_params = array(36 private $_params = array( 37 37 'db_table' => 'session_tbl', 38 38 … … 51 51 * @since 18 Jul 2005 11:02:50 52 52 */ 53 function DBSessionHandler($db, $params=array())53 public function __construct($db, $params=array()) 54 54 { 55 55 $app =& App::getInstance(); … … 94 94 * @since 26 Aug 2005 17:09:36 95 95 */ 96 function initDB($recreate_db=false)96 public function initDB($recreate_db=false) 97 97 { 98 98 $app =& App::getInstance(); … … 121 121 } 122 122 123 function dbSessionOpen($save_path, $sess_name)123 public function dbSessionOpen($save_path, $sess_name) 124 124 { 125 125 return true; 126 126 } 127 127 128 function dbSessionClose()128 public function dbSessionClose() 129 129 { 130 130 return true; 131 131 } 132 132 133 function dbSessionRead($session_id)133 public function dbSessionRead($session_id) 134 134 { 135 135 // Select the data belonging to session $session_id from the session table … … 146 146 } 147 147 148 function dbSessionWrite($session_id, $session_data)148 public function dbSessionWrite($session_id, $session_data) 149 149 { 150 150 // Write the serialized session data ($session_data) to the session table … … 154 154 } 155 155 156 function dbSessionDestroy($session_id)156 public function dbSessionDestroy($session_id) 157 157 { 158 158 // Delete from the table all data for the session $session_id … … 162 162 } 163 163 164 function dbSessionGarbage($max_lifetime=72000)164 public function dbSessionGarbage($max_lifetime=72000) 165 165 { 166 166 // Delete old values from the session table. -
branches/eli_branch/lib/Email.inc.php
r438 r439 55 55 56 56 // Default parameters, to be overwritten by setParam() and read with getParam() 57 var$_params = array(57 private $_params = array( 58 58 'to' => null, 59 59 'from' => null, … … 73 73 74 74 // String that contains the email body. 75 var$_template;75 private $_template; 76 76 77 77 // String that contains the email body after replacements. 78 var$_template_replaced;78 private $_template_replaced; 79 79 80 80 /** … … 86 86 * @since 28 Nov 2005 12:59:41 87 87 */ 88 function Email($params=null)88 public function __construct($params=null) 89 89 { 90 90 // The regex used in validEmail(). Set here instead of in the default _params above so we can use the concatenation . dot. … … 117 117 * @param array $params Array of parameters (key => val pairs). 118 118 */ 119 function setParam($params)119 public function setParam($params) 120 120 { 121 121 $app =& App::getInstance(); … … 144 144 * @return mixed Configured parameter value. 145 145 */ 146 function getParam($param)146 public function getParam($param) 147 147 { 148 148 $app =& App::getInstance(); … … 164 164 * @since 28 Nov 2005 12:56:23 165 165 */ 166 function setTemplate($template)166 public function setTemplate($template) 167 167 { 168 168 $app =& App::getInstance(); … … 188 188 * @since 28 Nov 2005 12:56:23 189 189 */ 190 function setString($string)190 public function setString($string) 191 191 { 192 192 $app =& App::getInstance(); … … 212 212 * @since 28 Nov 2005 13:08:51 213 213 */ 214 function replace($replacements)214 public function replace($replacements) 215 215 { 216 216 $app =& App::getInstance(); … … 249 249 * @since 28 Nov 2005 12:56:09 250 250 */ 251 function send($to=null, $from=null, $subject=null, $headers=null)251 public function send($to=null, $from=null, $subject=null, $headers=null) 252 252 { 253 253 $app =& App::getInstance(); … … 363 363 * @since 30 Nov 2005 22:00:50 364 364 */ 365 function validEmail($email)365 public function validEmail($email) 366 366 { 367 367 $app =& App::getInstance(); -
branches/eli_branch/lib/FormValidator.inc.php
r438 r439 61 61 62 62 // Class parameters. 63 var$_params = array(63 private $_params = array( 64 64 'error' => ' sc-msg-error ', 65 65 'warning' => ' sc-msg-warning ', … … 69 69 70 70 // Array filling with error messages. 71 var$errors = array();71 public $errors = array(); 72 72 73 73 /** … … 77 77 * @param array $params Array of parameters (key => val pairs). 78 78 */ 79 function setParam($params)79 public function setParam($params) 80 80 { 81 81 $app =& App::getInstance(); … … 96 96 * @return mixed Configured parameter value. 97 97 */ 98 function getParam($param)98 public function getParam($param) 99 99 { 100 100 $app =& App::getInstance(); … … 115 115 * vals: the message to display for that error 116 116 */ 117 function getErrorList()117 public function getErrorList() 118 118 { 119 119 return $this->errors; … … 130 130 * @param string $line __LINE__. 131 131 */ 132 function addError($form_name, $msg='', $type=MSG_ERR, $file=null, $line=null)132 public function addError($form_name, $msg='', $type=MSG_ERR, $file=null, $line=null) 133 133 { 134 134 $this->errors[] = array( … … 149 149 * a variable of $form_name, false otherwise 150 150 */ 151 function anyErrors($form_name=null)151 public function anyErrors($form_name=null) 152 152 { 153 153 if (isset($form_name)) { … … 166 166 * Reset the error list. 167 167 */ 168 function resetErrorList()168 public function resetErrorList() 169 169 { 170 170 $this->errors = array(); … … 182 182 * @since 15 Jul 2005 01:39:14 183 183 */ 184 function printErrorMessages($above='', $below='', $print_gotohash_js=false, $hash='sc-msg-formvalidator')184 public function printErrorMessages($above='', $below='', $print_gotohash_js=false, $hash='sc-msg-formvalidator') 185 185 { 186 186 $app =& App::getInstance(); … … 238 238 * not provided, use default. 239 239 */ 240 function err($form_name, $marker=null)240 public function err($form_name, $marker=null) 241 241 { 242 242 if (false !== ($type = $this->anyErrors($form_name))) { … … 274 274 * @return bool true if form is not empty, false otherwise. 275 275 */ 276 function notEmpty($form_name, $msg='')276 public function notEmpty($form_name, $msg='') 277 277 { 278 278 if (parent::notEmpty(getFormData($form_name))) { … … 290 290 * @since 03 Jun 2006 22:56:46 291 291 */ 292 function isEmpty($form_name, $msg='')292 public function isEmpty($form_name, $msg='') 293 293 { 294 294 $this->notEmpty($form_name, $msg); … … 303 303 * @return bool true if form is a string, false otherwise. 304 304 */ 305 function isString($form_name, $msg='')305 public function isString($form_name, $msg='') 306 306 { 307 307 if (parent::isString(getFormData($form_name))) { … … 321 321 * @return bool true if no errors found, false otherwise 322 322 */ 323 function isNumber($form_name, $msg='')323 public function isNumber($form_name, $msg='') 324 324 { 325 325 if (parent::isNumber(getFormData($form_name))) { … … 340 340 * @return bool true if value is an integer 341 341 */ 342 function isInteger($form_name, $msg='', $negative_ok=false)342 public function isInteger($form_name, $msg='', $negative_ok=false) 343 343 { 344 344 if (parent::isInteger(getFormData($form_name), $negative_ok)) { … … 360 360 * @return bool true if value is a float 361 361 */ 362 function isFloat($form_name, $msg='', $negative_ok=false)362 public function isFloat($form_name, $msg='', $negative_ok=false) 363 363 { 364 364 if (parent::isFloat(getFormData($form_name), $negative_ok)) { … … 378 378 * @return bool true if value is a float 379 379 */ 380 function isArray($form_name, $msg='')380 public function isArray($form_name, $msg='') 381 381 { 382 382 if (parent::isArray(getFormData($form_name))) { … … 399 399 * @return bool true if value passes regex test 400 400 */ 401 function checkRegex($form_name, $regex, $valid_on_match, $msg='')401 public function checkRegex($form_name, $regex, $valid_on_match, $msg='') 402 402 { 403 403 if (parent::checkRegex(getFormData($form_name), $regex, $valid_on_match)) { … … 419 419 * @return bool true if string length is within given boundaries 420 420 */ 421 function stringLength($form_name, $min, $max, $msg='')421 public function stringLength($form_name, $min, $max, $msg='') 422 422 { 423 423 if (parent::stringLength(getFormData($form_name), $min, $max)) { … … 439 439 * @return bool true if no errors found, false otherwise 440 440 */ 441 function numericRange($form_name, $min, $max, $msg='')441 public function numericRange($form_name, $min, $max, $msg='') 442 442 { 443 443 if (parent::numericRange(getFormData($form_name), $min, $max)) { … … 463 463 * @author Quinn Comendant <quinn@strangecode.com> 464 464 */ 465 function validateEmail($form_name)465 public function validateEmail($form_name) 466 466 { 467 467 $app =& App::getInstance(); … … 513 513 * @return bool true if no errors found, false otherwise 514 514 */ 515 function validatePhone($form_name)515 public function validatePhone($form_name) 516 516 { 517 517 $phone = getFormData($form_name); … … 531 531 * @return bool true if no errors found, false otherwise 532 532 */ 533 function validateStrDate($form_name, $msg='')533 public function validateStrDate($form_name, $msg='') 534 534 { 535 535 $app =& App::getInstance(); … … 554 554 * @return bool true if no errors found, false otherwise 555 555 */ 556 function validateCCNumber($form_name, $cc_type=null)556 public function validateCCNumber($form_name, $cc_type=null) 557 557 { 558 558 $cc_num = getFormData($form_name); … … 574 574 * @return bool true if no errors found, false otherwise 575 575 */ 576 function fileUploaded($form_name, $msg='')576 public function fileUploaded($form_name, $msg='') 577 577 { 578 578 if (parent::fileUploaded($form_name)) { -
branches/eli_branch/lib/Google_API.inc.php
r396 r439 53 53 * @access private 54 54 */ 55 var$_licenseKey = '';55 private $_licenseKey = ''; 56 56 57 57 /** … … 59 59 * @access private 60 60 */ 61 var$_soapClient = NULL;61 private $_soapClient = NULL; 62 62 63 63 /** … … 67 67 * @access public 68 68 */ 69 function Google_API($licenseKey)69 public function __construct($licenseKey) 70 70 { 71 71 $this->_licenseKey = $licenseKey; … … 82 82 * @access public 83 83 */ 84 function getCachedPage($url)84 public function getCachedPage($url) 85 85 { 86 86 $result = $this->_performAPICall( … … 104 104 * @access public 105 105 */ 106 function getSpellingSuggestion($phrase)106 public function getSpellingSuggestion($phrase) 107 107 { 108 108 return $this->_performAPICall( … … 122 122 * @access public 123 123 */ 124 function search($parameters = array())124 public function search($parameters = array()) 125 125 { 126 126 if (!isset($parameters['query'])) { … … 150 150 * @access private 151 151 */ 152 function _performAPICall($apiCall, $parameters)152 private function _performAPICall($apiCall, $parameters) 153 153 { 154 154 $app =& App::getInstance(); … … 167 167 } 168 168 } 169 ?>170 171 -
branches/eli_branch/lib/Hierarchy.inc.php
r438 r439 52 52 * 53 53 */ 54 var$params = array();54 public $params = array(); 55 55 56 56 … … 59 59 * @var string $child_type 60 60 */ 61 var$child_type;61 public $child_type; 62 62 63 63 /** … … 65 65 * @var string $child_id 66 66 */ 67 var$child_id;67 public $child_id; 68 68 69 69 /** … … 72 72 * @var bool $node_init 73 73 */ 74 var$node_init = false;74 public $node_init = false; 75 75 76 76 /** … … 80 80 * configuration or connection parameters. 81 81 */ 82 function Hierarchy($params=array())82 function __construct($params=array()) 83 83 { 84 84 $this->params = $params; … … 92 92 * if no new ones are specified. 93 93 */ 94 function currentNode($child_type=null, $child_id=null)94 public function currentNode($child_type=null, $child_id=null) 95 95 { 96 96 $old_type = isset($this->child_type) ? $this->child_type : $child_type; … … 113 113 * otherwise if an array is provided, an array of identifiers is returned. 114 114 */ 115 function toStringID($child_type=null, $child_id=null)115 public function toStringID($child_type=null, $child_id=null) 116 116 { 117 117 $app =& App::getInstance(); … … 122 122 $child_id =& $this->child_id; 123 123 } else { 124 $app->logMsg('toStringID failed. Arguments not specified properly.' ), LOG_ERR, __FILE__, __LINE__);124 $app->logMsg('toStringID failed. Arguments not specified properly.', LOG_ERR, __FILE__, __LINE__); 125 125 return false; 126 126 } … … 147 147 * @return mixed Array of node type and id on success, false on failure. 148 148 */ 149 function toArrayID(&$node)149 public function toArrayID(&$node) 150 150 { 151 151 $app =& App::getInstance(); … … 154 154 return array('node_type' => $node_parts[1], 'node_id' => $node_parts[2]); 155 155 } else { 156 $app->logMsg('Cannot parse node identifier, not formated correctly.' ), LOG_ERR, __FILE__, __LINE__);156 $app->logMsg('Cannot parse node identifier, not formated correctly.', LOG_ERR, __FILE__, __LINE__); 157 157 return false; 158 158 } … … 167 167 * @return bool true on success, false on error. 168 168 */ 169 function insertNode($parents, $child_type=null, $child_id=null, $relationship_type=null, $title='')169 public function insertNode($parents, $child_type=null, $child_id=null, $relationship_type=null, $title='') 170 170 { 171 171 $app =& App::getInstance(); … … 177 177 $child_id =& $this->child_id; 178 178 } else { 179 $app->logMsg('insertNode failed. Arguments not specified properly.' ), LOG_ERR, __FILE__, __LINE__);179 $app->logMsg('insertNode failed. Arguments not specified properly.', LOG_ERR, __FILE__, __LINE__); 180 180 return false; 181 181 } … … 246 246 * @return bool false on error, true otherwise. 247 247 */ 248 function deleteNode($child_type=null, $child_id=null)248 public function deleteNode($child_type=null, $child_id=null) 249 249 { 250 250 $app =& App::getInstance(); … … 256 256 $child_id =& $this->child_id; 257 257 } else { 258 $app->logMsg('deleteNode failed. Arguments not specified properly.' ), LOG_ERR, __FILE__, __LINE__);258 $app->logMsg('deleteNode failed. Arguments not specified properly.', LOG_ERR, __FILE__, __LINE__); 259 259 return false; 260 260 } … … 296 296 * @return bool false on error, true otherwise. 297 297 */ 298 function moveNode($new_parents=null, $child_type=null, $child_id=null, $relationship_type=null, $title='')298 public function moveNode($new_parents=null, $child_type=null, $child_id=null, $relationship_type=null, $title='') 299 299 { 300 300 $app =& App::getInstance(); … … 306 306 $child_id =& $this->child_id; 307 307 } else { 308 $app->logMsg('moveNode failed. Arguments not specified properly.' ), LOG_ERR, __FILE__, __LINE__);308 $app->logMsg('moveNode failed. Arguments not specified properly.', LOG_ERR, __FILE__, __LINE__); 309 309 return false; 310 310 } … … 373 373 * @return string The parents as an array of serialized node identifiers. 374 374 */ 375 function getParents($child_type=null, $child_id=null, $type_constraint=null, $order='')375 public function getParents($child_type=null, $child_id=null, $type_constraint=null, $order='') 376 376 { 377 377 $app =& App::getInstance(); … … 383 383 $child_id =& $this->child_id; 384 384 } else { 385 $app->logMsg('getParents failed. Arguments not specified properly.' ), LOG_ERR, __FILE__, __LINE__);385 $app->logMsg('getParents failed. Arguments not specified properly.', LOG_ERR, __FILE__, __LINE__); 386 386 return false; 387 387 } … … 424 424 * @return array type, id, title, subnode_quantity. 425 425 */ 426 function getNode($child_type=null, $child_id=null)426 public function getNode($child_type=null, $child_id=null) 427 427 { 428 428 $app =& App::getInstance(); … … 434 434 $child_id =& $this->child_id; 435 435 } else { 436 $app->logMsg('getNode failed. Arguments not specified properly.' ), LOG_ERR, __FILE__, __LINE__);436 $app->logMsg('getNode failed. Arguments not specified properly.', LOG_ERR, __FILE__, __LINE__); 437 437 return false; 438 438 } … … 468 468 * @return string The children as an array of serialized node identifiers. 469 469 */ 470 function getChildren($child_type=null, $child_id=null, $type_constraint=null, $order='')470 public function getChildren($child_type=null, $child_id=null, $type_constraint=null, $order='') 471 471 { 472 472 $app =& App::getInstance(); … … 478 478 $child_id =& $this->child_id; 479 479 } else { 480 $app->logMsg('getChildren failed. Arguments not specified properly.' ), LOG_ERR, __FILE__, __LINE__);480 $app->logMsg('getChildren failed. Arguments not specified properly.', LOG_ERR, __FILE__, __LINE__); 481 481 return false; 482 482 } … … 520 520 * @return integer 521 521 */ 522 function getNumberChildren($child_type=null, $child_id=null, $type_constraint=null)522 public function getNumberChildren($child_type=null, $child_id=null, $type_constraint=null) 523 523 { 524 524 $app =& App::getInstance(); … … 530 530 $child_id =& $this->child_id; 531 531 } else { 532 $app->logMsg('getNumberChildren failed. Arguments not specified properly.' ), LOG_ERR, __FILE__, __LINE__);532 $app->logMsg('getNumberChildren failed. Arguments not specified properly.', LOG_ERR, __FILE__, __LINE__); 533 533 return false; 534 534 } … … 561 561 * @return bool true if a leaf, or false if not or an error 562 562 */ 563 function isLeaf($child_type=null, $child_id=null)563 public function isLeaf($child_type=null, $child_id=null) 564 564 { 565 565 $app =& App::getInstance(); … … 570 570 $child_id =& $this->child_id; 571 571 } else { 572 $app->logMsg('isLeaf failed. Arguments not specified properly.' ), LOG_ERR, __FILE__, __LINE__);572 $app->logMsg('isLeaf failed. Arguments not specified properly.', LOG_ERR, __FILE__, __LINE__); 573 573 return false; 574 574 } … … 595 595 * parent, or false otherwise, or in case of failure. 596 596 */ 597 function isAncestor($child_type, $child_id, $considered_parent_type, $considered_parent_id)597 public function isAncestor($child_type, $child_id, $considered_parent_type, $considered_parent_id) 598 598 { 599 599 $family_tree = $this->getAllAncestors($considered_parent_type, $considered_parent_id); … … 622 622 * @return array Array of serialized node identifiers. 623 623 */ 624 function getAllAncestors($child_type, $child_id, $go_linear=false, $_return_flag=true)624 public function getAllAncestors($child_type, $child_id, $go_linear=false, $_return_flag=true) 625 625 { 626 626 $db =& DB::getInstance(); … … 676 676 * @return bool true if a leaf, or false if not or an error 677 677 */ 678 function nodeExists($child_type=null, $child_id=null, $parent_type=null, $parent_id=null, $relationship_type=null)678 public function nodeExists($child_type=null, $child_id=null, $parent_type=null, $parent_id=null, $relationship_type=null) 679 679 { 680 680 $app =& App::getInstance(); … … 686 686 $child_id =& $this->child_id; 687 687 } else { 688 $app->logMsg('nodeExists failed. Arguments not specified properly.' ), LOG_ERR, __FILE__, __LINE__);688 $app->logMsg('nodeExists failed. Arguments not specified properly.', LOG_ERR, __FILE__, __LINE__); 689 689 return false; 690 690 } … … 728 728 * specified node: (type, id, title, indent level, selected status) 729 729 */ 730 function &getNodeList($preselected=null, $child_type=null, $child_id=null, $type_constraint=null, $include_curr=false, $order='', $_indent=0, $_return_flag=true)730 public function &getNodeList($preselected=null, $child_type=null, $child_id=null, $type_constraint=null, $include_curr=false, $order='', $_indent=0, $_return_flag=true) 731 731 { 732 732 $app =& App::getInstance(); … … 740 740 $child_id =& $this->child_id; 741 741 } else { 742 $app->logMsg('getNodeList failed. Arguments not specified properly.' ), LOG_ERR, __FILE__, __LINE__);742 $app->logMsg('getNodeList failed. Arguments not specified properly.', LOG_ERR, __FILE__, __LINE__); 743 743 return false; 744 744 } … … 801 801 * @param string $type_constraint An array of node types to restrict the search to. 802 802 */ 803 function rebuildSubnodeQty($type_constraint=null)803 public function rebuildSubnodeQty($type_constraint=null) 804 804 { 805 805 $db =& DB::getInstance(); … … 825 825 * all parents recursively. 826 826 */ 827 function setSubnodeQtyToParents($child_type, $child_id, $num_children)827 public function setSubnodeQtyToParents($child_type, $child_id, $num_children) 828 828 { 829 829 $db =& DB::getInstance(); … … 848 848 // THE END 849 849 } 850 851 852 853 -
branches/eli_branch/lib/Image.inc.php
r396 r439 31 31 32 32 // Object parameters. 33 var$_params = array();33 private $_params = array(); 34 34 35 35 /** … … 41 41 * @since 26 Jan 2005 01:54:50 42 42 */ 43 function Image($params=array())43 public function __construct($params=array()) 44 44 { 45 45 if (!is_array($params)) { … … 72 72 * @since 26 Jan 2005 01:54:50 73 73 */ 74 function exists($id)74 public function exists($id) 75 75 { 76 76 $src = $this->oSrc($id); … … 95 95 * @since 26 Jan 2005 01:54:50 96 96 */ 97 function size($id, $key)97 public function size($id, $key) 98 98 { 99 99 $src = $this->oSrc($id); … … 113 113 * @since 26 Jan 2005 01:56:35 114 114 */ 115 function oSrc($id)115 public function oSrc($id) 116 116 { 117 117 $file_name = ''; … … 138 138 * @since 26 Jan 2005 01:57:33 139 139 */ 140 function oImg($id, $alt='', $extra='')140 public function oImg($id, $alt='', $extra='') 141 141 { 142 142 $src = $this->oSrc($id); … … 157 157 } 158 158 } // End class 159 160 ?> -
branches/eli_branch/lib/ImageThumb.inc.php
r438 r439 43 43 44 44 // General object parameters. 45 var$_params = array(45 private $_params = array( 46 46 // The location for images to create thumbnails from. 47 47 'source_dir' => null, … … 72 72 73 73 // Default image size specs. 74 var$_default_image_specs = array(74 private $_default_image_specs = array( 75 75 // The destination for an image thumbnail size. 76 76 // Use initial / to specify absolute paths, leave off to specify a path relative to source_dir (eg: ../thumbs). … … 108 108 109 109 // Final specifications for image sizes, set with setSpec(). 110 var$_image_specs = array();110 private $_image_specs = array(); 111 111 112 112 /** … … 116 116 * @param array $params Array of parameters (key => val pairs). 117 117 */ 118 function setParam($params)118 public function setParam($params) 119 119 { 120 120 $app =& App::getInstance(); … … 160 160 * @return mixed Configured parameter value. 161 161 */ 162 function getParam($param)162 public function getParam($param) 163 163 { 164 164 $app =& App::getInstance(); … … 180 180 * Use to overwrite existing spec array values. 181 181 */ 182 function setSpec($spec, $index=null)182 public function setSpec($spec, $index=null) 183 183 { 184 184 $app =& App::getInstance(); … … 259 259 * @since 08 May 2007 15:26:39 260 260 */ 261 function getSpec($key, $index=null)261 public function getSpec($key, $index=null) 262 262 { 263 263 $index = isset($index) ? $index : 0; … … 271 271 * @return bool true on success, false on failure. 272 272 */ 273 function processAll($runtime_specs=null)273 public function processAll($runtime_specs=null) 274 274 { 275 275 $app =& App::getInstance(); … … 313 313 * @return bool true on success, false on failure. 314 314 */ 315 function processFile($file_name, $runtime_specs=null)315 public function processFile($file_name, $runtime_specs=null) 316 316 { 317 317 $app =& App::getInstance(); … … 452 452 * @since 19 May 2006 13:55:46 453 453 */ 454 function _resizeWithNetpbm($source_file, $dest_file, $spec)454 private function _resizeWithNetpbm($source_file, $dest_file, $spec) 455 455 { 456 456 $app =& App::getInstance(); … … 521 521 * @since 19 May 2006 15:46:02 522 522 */ 523 function _resizeWithGD($source_file, $dest_file, $spec)523 private function _resizeWithGD($source_file, $dest_file, $spec) 524 524 { 525 525 $app =& App::getInstance(); … … 662 662 * @return bool true on success, false on failure. 663 663 */ 664 function deleteThumbs($file_name, $use_glob=false)664 public function deleteThumbs($file_name, $use_glob=false) 665 665 { 666 666 $app =& App::getInstance(); … … 700 700 * @return bool true on success, false on failure. 701 701 */ 702 function deleteOriginal($file_name)702 public function deleteOriginal($file_name) 703 703 { 704 704 $app =& App::getInstance(); … … 733 733 * @return bool true on success, false on failure. 734 734 */ 735 function exists($file_name)735 public function exists($file_name) 736 736 { 737 737 $app =& App::getInstance(); … … 754 754 * @return bool True on success, false on failure. 755 755 */ 756 function _validFileExtension($file_name)756 private function _validFileExtension($file_name) 757 757 { 758 758 preg_match('/.*?\.(\w+)$/i', $file_name, $ext); … … 766 766 * @return bool true on success, false on failure. 767 767 */ 768 function _createDestDirs($filename=null)768 private function _createDestDirs($filename=null) 769 769 { 770 770 $app =& App::getInstance(); … … 844 844 * @param string $line __LINE__. 845 845 */ 846 function _raiseMsg($message, $type, $file, $line)846 private function _raiseMsg($message, $type, $file, $line) 847 847 { 848 848 $app =& App::getInstance(); … … 864 864 * @since 15 Nov 2005 20:55:22 865 865 */ 866 function _glob($pattern, $directory)866 private function _glob($pattern, $directory) 867 867 { 868 868 $file_list = glob(sprintf('%s/%s', $directory, $pattern)); -
branches/eli_branch/lib/Lock.inc.php
r438 r439 32 32 33 33 // Configuration of this object. 34 var$_params = array(34 private $_params = array( 35 35 'timeout' => 600, 36 36 'auto_timeout' => 1800, … … 44 44 45 45 // Store lock data from DB. 46 var$data = array();46 private $data = array(); 47 47 48 48 // Auth_SQL object from which to access a current user_id. 49 var$_auth;49 private $_auth; 50 50 51 51 /** … … 56 56 * @static 57 57 */ 58 static function &getInstance($auth_object)58 public static function &getInstance($auth_object) 59 59 { 60 60 static $instance = null; … … 72 72 * @param mixed $auth_object An Auth_SQL or Auth_FILE object. 73 73 */ 74 function Lock($auth_object)74 public function __construct($auth_object) 75 75 { 76 76 $app =& App::getInstance(); … … 95 95 * @since 26 Aug 2005 17:09:36 96 96 */ 97 function initDB($recreate_db=false)97 public function initDB($recreate_db=false) 98 98 { 99 99 $app =& App::getInstance(); … … 142 142 * @param array $params Array of param keys and values to set. 143 143 */ 144 function setParam($params=null)144 public function setParam($params=null) 145 145 { 146 146 if (isset($params) && is_array($params)) { … … 157 157 * @return mixed Configured parameter value. 158 158 */ 159 function getParam($param)159 public function getParam($param) 160 160 { 161 161 $app =& App::getInstance(); … … 178 178 * @param string $title A title to apply to the lock, for display purposes. 179 179 */ 180 function select($record_table_or_lock_id, $record_key=null, $record_val=null)180 public function select($record_table_or_lock_id, $record_key=null, $record_val=null) 181 181 { 182 182 $app =& App::getInstance(); … … 219 219 * @return bool True if locked. 220 220 */ 221 function isLocked()221 public function isLocked() 222 222 { 223 223 return isset($this->data['lock_id']); … … 230 230 * @return bool True if current user set the lock. 231 231 */ 232 function isMine()232 public function isMine() 233 233 { 234 234 $db =& DB::getInstance(); … … 258 258 * @return int The id for the lock (mysql last insert id). 259 259 */ 260 function set($record_table, $record_key, $record_val, $title='')260 public function set($record_table, $record_key, $record_val, $title='') 261 261 { 262 262 $db =& DB::getInstance(); … … 304 304 * Unlock the currently selected record. 305 305 */ 306 function remove()306 public function remove() 307 307 { 308 308 $app =& App::getInstance(); … … 326 326 * Unlock all records, or all records for a specified user. 327 327 */ 328 function removeAll($user_id=null)328 public function removeAll($user_id=null) 329 329 { 330 330 $app =& App::getInstance(); … … 350 350 * Deletes all locks that are older than auto_timeout. 351 351 */ 352 function _auto_timeout()352 private function _auto_timeout() 353 353 { 354 354 $db =& DB::getInstance(); … … 371 371 * Redirect to record lock error page. 372 372 */ 373 function dieErrorPage()373 public function dieErrorPage() 374 374 { 375 375 $app =& App::getInstance(); … … 381 381 * Print error page. 382 382 */ 383 function printErrorHTML()383 public function printErrorHTML() 384 384 { 385 385 $app =& App::getInstance(); … … 416 416 * Return lock_id of locked record. 417 417 */ 418 function getID()418 public function getID() 419 419 { 420 420 return $this->data['lock_id']; … … 424 424 * Return title of locked record. 425 425 */ 426 function getTitle()426 public function getTitle() 427 427 { 428 428 return $this->data['title']; … … 432 432 * Return administrator username for locked record. 433 433 */ 434 function getEditor()434 public function getEditor() 435 435 { 436 436 return $this->data['editor']; … … 440 440 * Return total seconds since the record was locked. 441 441 */ 442 function getSecondsElapsed()442 public function getSecondsElapsed() 443 443 { 444 444 if (isset($this->data['lock_datetime']) && strtotime($this->data['lock_datetime']) < time()) { -
branches/eli_branch/lib/Navigation.inc.php
r396 r439 37 37 38 38 // Configuration parameters for this object. 39 var$_params = array(39 private $_params = array( 40 40 'head_title' => true, 41 41 'body_title' => true, … … 48 48 'last_crumb_format' => '%s', 49 49 ); 50 var$pages = array();50 public $pages = array(); 51 51 52 52 /** 53 53 * Navigation constructor. 54 54 */ 55 function Navigation($params=null)55 public function __construct($params=null) 56 56 { 57 57 $app =& App::getInstance(); … … 74 74 * @param array $vars Additional page variables. 75 75 */ 76 function add($title, $url=null, $vars=array())76 public function add($title, $url=null, $vars=array()) 77 77 { 78 78 $page = array( … … 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(); … … 127 127 * @access public 128 128 */ 129 function clear()129 public function clear() 130 130 { 131 131 $this->pages = array(); … … 139 139 * @param mixed $val Value to set variable to. 140 140 */ 141 function set($key, $val)141 public function set($key, $val) 142 142 { 143 143 // Set params of current page. … … 154 154 * @return mixed Value stored in session. 155 155 */ 156 function get($key, $default='')156 public function get($key, $default='') 157 157 { 158 158 $curr_page =& $this->pages[sizeof($this->pages) - 1]; … … 205 205 * @return mixed Path (string) or false if path param is not set. 206 206 */ 207 function getPath($key='title')207 public function getPath($key='title') 208 208 { 209 209 if ($this->getParam('path')) { … … 227 227 * @return string Breadcrumbs or empty string if breadcrumbs param not set. 228 228 */ 229 function getBreadcrumbs()229 public function getBreadcrumbs() 230 230 { 231 231 $app =& App::getInstance(); … … 279 279 * @return mixed The value set for $return, TRUE by default. 280 280 */ 281 function currentPage($page_uri, $return=true)281 public function currentPage($page_uri, $return=true) 282 282 { 283 283 if (preg_match('/^' . preg_quote(urldecode($page_uri), '/') . '/i', $_SERVER['PHP_SELF'])) { … … 288 288 } 289 289 // End of class. 290 291 ?> -
branches/eli_branch/lib/PEdit.inc.php
r421 r439 70 70 71 71 // PEdit object parameters. 72 var$_params = array(72 private $_params = array( 73 73 'data_dir' => '', 74 74 'character_set' => 'utf-8', … … 77 77 ); 78 78 79 var$_data = array(); // Array to store loaded data.80 var$_data_file = ''; // Full file path to the pedit data file.81 var$_authorized = false; // User is authenticated to see extended functions.82 var$_data_loaded = false;83 var$op = '';79 private $_data = array(); // Array to store loaded data. 80 private $_data_file = ''; // Full file path to the pedit data file. 81 private $_authorized = false; // User is authenticated to see extended functions. 82 private $_data_loaded = false; 83 public $op = ''; 84 84 85 85 /** … … 93 93 * @param optional array $params A hash containing connection parameters. 94 94 */ 95 function PEdit($params)95 public function __construct($params) 96 96 { 97 97 $this->setParam($params); … … 121 121 * @param array $params Array of parameters (key => val pairs). 122 122 */ 123 function setParam($params)123 public function setParam($params) 124 124 { 125 125 $app =& App::getInstance(); … … 140 140 * @return mixed Configured parameter value. 141 141 */ 142 function getParam($param)142 public function getParam($param) 143 143 { 144 144 $app =& App::getInstance(); … … 159 159 * @since 12 Apr 2006 12:43:47 160 160 */ 161 function start($initialize_data_file=false)161 public function start($initialize_data_file=false) 162 162 { 163 163 $app =& App::getInstance(); … … 217 217 * @param array $options Additional options to store with this data. 218 218 */ 219 function set($name, $options=array())219 public function set($name, $options=array()) 220 220 { 221 221 $app =& App::getInstance(); … … 236 236 * @return string The trimmed content of the named data. 237 237 */ 238 function get($name)238 public function get($name) 239 239 { 240 240 $name = preg_replace('/\s/', '_', $name); … … 251 251 * @return bool False if unauthorized or current page is a version. 252 252 */ 253 function formBegin()253 public function formBegin() 254 254 { 255 255 $app =& App::getInstance(); … … 288 288 * @access public 289 289 */ 290 function printAllForms()290 public function printAllForms() 291 291 { 292 292 if ($this->_authorized && $this->op == 'Edit' && is_array($this->_data) && $this->_data_loaded) { … … 305 305 * @param string $type Type of form to print. Currently only 'text' and 'textarea' supported. 306 306 */ 307 function printForm($name, $type='text')307 public function printForm($name, $type='text') 308 308 { 309 309 if ($this->_authorized && $this->op == 'Edit' && $this->_data_loaded) { … … 345 345 * @return bool False if unauthorized or current page is a version. 346 346 */ 347 function formEnd()347 public function formEnd() 348 348 { 349 349 if (!$this->_authorized || empty($this->_data)) { … … 399 399 * @access public 400 400 */ 401 function printVersions()401 public function printVersions() 402 402 { 403 403 $app =& App::getInstance(); … … 442 442 * @since 12 Apr 2006 10:52:35 443 443 */ 444 function _fileHash()444 private function _fileHash() 445 445 { 446 446 $app =& App::getInstance(); … … 457 457 * @since 11 Apr 2006 20:36:26 458 458 */ 459 function _loadDataFile()459 private function _loadDataFile() 460 460 { 461 461 $app =& App::getInstance(); … … 496 496 * @since 11 Apr 2006 20:53:42 497 497 */ 498 function _initializeDataFile()498 private function _initializeDataFile() 499 499 { 500 500 $app =& App::getInstance(); … … 512 512 * @return bool False if unauthorized or on failure. True on success. 513 513 */ 514 function _writeData()514 private function _writeData() 515 515 { 516 516 $app =& App::getInstance(); … … 560 560 * @since 11 Apr 2006 22:48:30 561 561 */ 562 function _filePutContents($filename, $content)562 private function _filePutContents($filename, $content) 563 563 { 564 564 $app =& App::getInstance(); … … 610 610 * @return bool False on failure. True on success. 611 611 */ 612 function _createVersion()612 private function _createVersion() 613 613 { 614 614 $app =& App::getInstance(); … … 648 648 * @since 12 Apr 2006 11:08:11 649 649 */ 650 function _deleteOldVersions()650 private function _deleteOldVersions() 651 651 { 652 652 $app =& App::getInstance(); … … 676 676 * @return array Array of versions. 677 677 */ 678 function _getVersions()678 private function _getVersions() 679 679 { 680 680 $version_files = array(); … … 707 707 * @return bool False on failure. True on success. 708 708 */ 709 function _restoreVersion($version)709 private function _restoreVersion($version) 710 710 { 711 711 $app =& App::getInstance(); … … 742 742 743 743 } // End class. 744 745 ?> -
branches/eli_branch/lib/PageNumbers.inc.php
r396 r439 39 39 class PageNumbers { 40 40 41 var$total_items; // Total quantity of items.42 var$total_pages; // The total number of pages.43 var$current_page = 1; // Current page number.44 var$first_item; // The counter for the first item on this page (zero index).45 var$last_item; // The counter for the last item on this page (zero index).46 var$max_num_links = 9; // The max number of links to show on page (odd numbers look best).47 var$_num_links; // The number of links to show on page.48 var$_per_page = 25; // Items per page.41 public $total_items; // Total quantity of items. 42 public $total_pages; // The total number of pages. 43 public $current_page = 1; // Current page number. 44 public $first_item; // The counter for the first item on this page (zero index). 45 public $last_item; // The counter for the last item on this page (zero index). 46 public $max_num_links = 9; // The max number of links to show on page (odd numbers look best). 47 private $_num_links; // The number of links to show on page. 48 private $_per_page = 25; // Items per page. 49 49 50 50 // Flags to ensure all necessary values have been set before calling calculate(). 51 var$set_per_page_initialized = false;52 var$set_page_number_initialized = false;53 var$set_total_items_initialized = false;51 public $set_per_page_initialized = false; 52 public $set_page_number_initialized = false; 53 public $set_total_items_initialized = false; 54 54 55 55 // These are initialized in the constructor. 56 var$per_page_options;57 var$left_arrow;58 var$left_arrow_disabled;59 var$left_dbl_arrow;60 var$left_dbl_arrow_disabled;61 var$right_arrow;62 var$right_arrow_disabled;63 var$right_dbl_arrow;64 var$right_dbl_arrow_disabled;56 public $per_page_options; 57 public $left_arrow; 58 public $left_arrow_disabled; 59 public $left_dbl_arrow; 60 public $left_dbl_arrow_disabled; 61 public $right_arrow; 62 public $right_arrow_disabled; 63 public $right_dbl_arrow; 64 public $right_dbl_arrow_disabled; 65 65 66 66 /** 67 67 * PageNumbers constructor. All arguments are depreciated. Use set* functions instead. 68 68 */ 69 function PageNumbers()69 public function __construct() 70 70 { 71 71 // Default options for the quantity per page links. … … 93 93 * Set the number of items per page. 94 94 */ 95 function setPerPage($per_page, $default=25, $save_value=true)95 public function setPerPage($per_page, $default=25, $save_value=true) 96 96 { 97 97 // (1) By provided argument, if valid. … … 115 115 * Set the current page number. 116 116 */ 117 function setPageNumber($page_number, $save_value=true)117 public function setPageNumber($page_number, $save_value=true) 118 118 { 119 119 // (1) By provided argument, if valid. … … 139 139 * Set the total number of items. 140 140 */ 141 function setTotalItems($total_items)141 public function setTotalItems($total_items) 142 142 { 143 143 if (is_numeric($total_items) && $total_items > 0) { … … 158 158 * @access public 159 159 */ 160 function calculate()160 public function calculate() 161 161 { 162 162 $app =& App::getInstance(); … … 212 212 * Returns the SQL code to limit query to items that are on current page. 213 213 */ 214 function getLimitSQL()214 public function getLimitSQL() 215 215 { 216 216 $app =& App::getInstance(); … … 230 230 * @access public 231 231 */ 232 function printPerPageLinks($query_key='per_page')232 public function printPerPageLinks($query_key='per_page') 233 233 { 234 234 $app =& App::getInstance(); … … 260 260 * @access public 261 261 */ 262 function getPageNumURL($page_number, $carry_args=null)262 public function getPageNumURL($page_number, $carry_args=null) 263 263 { 264 264 $app =& App::getInstance(); … … 266 266 return $app->oHREF($this->url_base . $page_number, $carry_args); 267 267 } 268 function printPageNumURL($page_number, $carry_args=null)268 public function printPageNumURL($page_number, $carry_args=null) 269 269 { 270 270 echo $this->getPageNumURL($page_number, $carry_args); … … 276 276 * @access public 277 277 */ 278 function getPageNumbersArray($carry_args=null)278 public function getPageNumbersArray($carry_args=null) 279 279 { 280 280 $page_numbers = array(); … … 296 296 * @access public 297 297 */ 298 function getPageNumbers($carry_args=null)298 public function getPageNumbers($carry_args=null) 299 299 { 300 300 $page_numbers_string = ''; … … 361 361 } 362 362 363 function printPageNumbers($carry_args=null)363 public function printPageNumbers($carry_args=null) 364 364 { 365 365 echo $this->getPageNumbers($carry_args); … … 368 368 } 369 369 370 ?> -
branches/eli_branch/lib/PageSequence.inc.php
r396 r439 35 35 class PageSequence 36 36 { 37 var$current_step_id = 0;38 var$start_url;39 var$sequence_title = '';40 var$seq = '_sequence_';41 var$idle_timeout;37 public $current_step_id = 0; 38 public $start_url; 39 public $sequence_title = ''; 40 public $seq = '_sequence_'; 41 public $idle_timeout; 42 42 43 43 /** … … 47 47 * @access public 48 48 */ 49 function PageSequence($params)49 public function __construct($params) 50 50 { 51 51 if (isset($params['sequence_title'])) { … … 84 84 * @access public 85 85 */ 86 function addStep($step_id, $params)86 public function addStep($step_id, $params) 87 87 { 88 88 // Keys for the steps array cannot be numeric. … … 114 114 * @return bool true on success, false on failure 115 115 */ 116 function setFeature($step_id=null, $features)116 public function setFeature($step_id=null, $features) 117 117 { 118 118 $pos = isset($step_id) ? $this->getPosition($step_id) : $this->getPosition(); … … 134 134 * @return mixed Value stored in session. 135 135 */ 136 function getFeature($step_id, $key, $default='')136 public function getFeature($step_id, $key, $default='') 137 137 { 138 138 $pos = isset($step_id) ? $this->getPosition($step_id) : $this->getPosition(); … … 151 151 * @access public 152 152 */ 153 function setCurrent($step_id)153 public function setCurrent($step_id) 154 154 { 155 155 $app =& App::getInstance(); … … 171 171 * @access public 172 172 */ 173 function getID($pos=null)173 public function getID($pos=null) 174 174 { 175 175 if (isset($pos)) { … … 188 188 * @access public 189 189 */ 190 function getPosition($step_id=null)190 public function getPosition($step_id=null) 191 191 { 192 192 // Get current step id if step not provided. … … 217 217 * @access public 218 218 */ 219 function getRequiredID($curr_step_id)219 public function getRequiredID($curr_step_id) 220 220 { 221 221 if ('' === $curr_step_id) { … … 242 242 * @access public 243 243 */ 244 function getNextID()244 public function getNextID() 245 245 { 246 246 // Loop through all steps. … … 263 263 * @access public 264 264 */ 265 function complete($step_id=null)265 public function complete($step_id=null) 266 266 { 267 267 $pos = isset($step_id) ? $this->getPosition($step_id) : $this->getPosition(); … … 277 277 * @access public 278 278 */ 279 function printEditLink($step_id=null)279 public function printEditLink($step_id=null) 280 280 { 281 281 $app =& App::getInstance(); … … 296 296 * @access public 297 297 */ 298 function setDataDefault($data_key, $data_val)298 public function setDataDefault($data_key, $data_val) 299 299 { 300 300 if (!isset($_SESSION[$this->seq]['data'][$data_key])) { … … 310 310 * @access public 311 311 */ 312 function getData($data_key=null)312 public function getData($data_key=null) 313 313 { 314 314 if (!isset($data_key)) { … … 328 328 * @access public 329 329 */ 330 function clearData($data_key=null)330 public function clearData($data_key=null) 331 331 { 332 332 if (isset($data_key)) { … … 342 342 * Deletes all data that are older than auto_timeout. Set current time if not not expired or not set. 343 343 */ 344 function _auto_timeout()344 private function _auto_timeout() 345 345 { 346 346 $app =& App::getInstance(); … … 363 363 * @access public 364 364 */ 365 function registerData($step_data)365 public function registerData($step_data) 366 366 { 367 367 $_SESSION[$this->seq]['data'] = array_merge($_SESSION[$this->seq]['data'], $step_data); … … 372 372 * 373 373 */ 374 function startOver()374 public function startOver() 375 375 { 376 376 $this->current_step_id = 0; … … 383 383 } // END CLASS 384 384 385 ?> -
branches/eli_branch/lib/PayPal.inc.php
r396 r439 33 33 34 34 // General object parameters. 35 var$_params = array(35 private $_params = array( 36 36 'paypal_url' => 'https://www.paypal.com/cgi-bin/webscr', 37 37 'test_mode' => false, … … 39 39 40 40 // Options used for specific buttons and links. 41 var$_default_button_options = array();41 private $_default_button_options = array(); 42 42 43 43 // Array of buttons created by newButton(). 44 var$_buttons = array();44 private $_buttons = array(); 45 45 46 46 // Store the response from the last IPN. 47 var$_ipn_response;47 private $_ipn_response; 48 48 49 49 /** … … 52 52 * @param bool $test_mode Use PayPal sandbox for testing. 53 53 */ 54 function PayPal($test_mode=false)54 public function __construct($test_mode=false) 55 55 { 56 56 if ($test_mode) { … … 95 95 * @return bool True on success, false on failure. 96 96 */ 97 function setButtonDefaults($type, $options)97 public function setButtonDefaults($type, $options) 98 98 { 99 99 $app =& App::getInstance(); … … 127 127 * @return bool True on success, false on failure. 128 128 */ 129 function newButton($type, $name, $options=null)129 public function newButton($type, $name, $options=null) 130 130 { 131 131 $app =& App::getInstance(); … … 162 162 * @return mixed Link of button, or false on failure. 163 163 */ 164 function getLink($name)164 public function getLink($name) 165 165 { 166 166 $app =& App::getInstance(); … … 196 196 * @param string $name Name of button for which to generate link. 197 197 */ 198 function printLink($name)198 public function printLink($name) 199 199 { 200 200 echo $this->getLink($name); … … 208 208 * @param string $name Name of button to print. 209 209 */ 210 function printButton($name)210 public function printButton($name) 211 211 { 212 212 ?> … … 234 234 * @param array $params Array of parameters (key => val pairs). 235 235 */ 236 function setParam($params)236 public function setParam($params) 237 237 { 238 238 $app =& App::getInstance(); … … 253 253 * @return mixed Configured parameter value. 254 254 */ 255 function getParam($param)255 public function getParam($param) 256 256 { 257 257 $app =& App::getInstance(); … … 272 272 * @return bool True if valid, false if invalid. 273 273 */ 274 function incomingIPNRequest()274 public function incomingIPNRequest() 275 275 { 276 276 if ($_SERVER['REQUEST_METHOD'] == 'POST' … … 290 290 * @return bool True on success, false on failure. 291 291 */ 292 function processIPN()292 public function processIPN() 293 293 { 294 294 $app =& App::getInstance(); … … 351 351 * @return bool True if response contains VERIFIED, false otherwise. 352 352 */ 353 function verifiedIPN()353 public function verifiedIPN() 354 354 { 355 355 $app =& App::getInstance(); … … 380 380 } // End of class. 381 381 382 ?> -
branches/eli_branch/lib/ScriptTimer.inc.php
r396 r439 26 26 class ScriptTimer { 27 27 28 var$time_format = '%.3f';29 var$_timing_start_times = array();30 var$_timing_stop_times = array();31 var$_timing_cumulative_times = array();28 public $time_format = '%.3f'; 29 private $_timing_start_times = array(); 30 private $_timing_stop_times = array(); 31 private $_timing_cumulative_times = array(); 32 32 33 function start($name='default')33 public function start($name='default') 34 34 { 35 35 $this->_timing_start_times[$name] = explode(' ', microtime()); 36 36 } 37 37 38 function stop($name='default')38 public function stop($name='default') 39 39 { 40 40 if (!isset($this->_timing_stop_times[$name]) || !isset($this->_timing_cumulative_times[$name])) { … … 46 46 } 47 47 48 function getTime($name='default')48 public function getTime($name='default') 49 49 { 50 50 if (!isset($this->_timing_start_times[$name])) { … … 62 62 } 63 63 64 function printAll($sort_by_time=false)64 public function printAll($sort_by_time=false) 65 65 { 66 66 $names = array_map('strlen', array_keys($this->_timing_start_times)); … … 81 81 } 82 82 } 83 84 ?> -
branches/eli_branch/lib/SortOrder.inc.php
r396 r439 37 37 class SortOrder { 38 38 39 var$_columns;40 var$sort_by;41 var$order;42 var$asc_widget;43 var$desc_widget;44 var$default_sort;45 var$default_order;39 private $_columns; 40 public $sort_by; 41 public $order; 42 public $asc_widget; 43 public $desc_widget; 44 public $default_sort; 45 public $default_order; 46 46 47 47 /** … … 53 53 * current order. 54 54 */ 55 function SortOrder($default_sort = '', $default_order = '')55 public function __construct($default_sort = '', $default_order = '') 56 56 { 57 57 $app =& App::getInstance(); … … 81 81 * @param string $desc_sql The sort SQL if $this->order is descending. 82 82 */ 83 function setColumn($name, $asc_sql, $desc_sql)83 public function setColumn($name, $asc_sql, $desc_sql) 84 84 { 85 85 $this->_columns[$name] = array( … … 99 99 * current order. 100 100 */ 101 function setDefault($default_sort = '', $default_order = '')101 public function setDefault($default_sort = '', $default_order = '') 102 102 { 103 103 // Which column to sort by? … … 139 139 * for example, for an alphabetical sort) 140 140 */ 141 function set($sort = null, $order = null)141 public function set($sort = null, $order = null) 142 142 { 143 143 // Set new sort value. … … 158 158 * Returns the SQL code to sort by set column and set order. 159 159 */ 160 function getSortOrderSQL()160 public function getSortOrderSQL() 161 161 { 162 162 $app =& App::getInstance(); … … 189 189 * for example, for an alphabetical sort) 190 190 */ 191 function printSortHeader($col, $col_name, $default_order='ASC')191 public function printSortHeader($col, $col_name, $default_order='ASC') 192 192 { 193 193 $app =& App::getInstance(); … … 210 210 } 211 211 212 ?> -
branches/eli_branch/lib/SpellCheck.inc.php
r425 r439 61 61 class SpellCheck { 62 62 63 var$_params = array(63 private $_params = array( 64 64 'language' => 'en', 65 65 'personal_wordlist' => '', // Text file to save custom words to. … … 70 70 ); 71 71 72 var$_pspell_cfg_handle;73 var$_pspell_handle;74 var$_use_personal_wordlist = false;75 var$_errors = array();72 private $_pspell_cfg_handle; 73 private $_pspell_handle; 74 private $_use_personal_wordlist = false; 75 private $_errors = array(); 76 76 77 77 /** … … 80 80 * @param array $params Array of parameters (key => val pairs). 81 81 */ 82 function SpellCheck($params)82 public function __construct($params) 83 83 { 84 84 $app =& App::getInstance(); … … 118 118 * @param array $params Array of parameters (key => val pairs). 119 119 */ 120 function setParam($params)120 public function setParam($params) 121 121 { 122 122 $app =& App::getInstance(); … … 137 137 * @return mixed Configured parameter value. 138 138 */ 139 function getParam($param)139 public function getParam($param) 140 140 { 141 141 $app =& App::getInstance(); … … 154 154 * @return bool True if any errors were found, false otherwise. 155 155 */ 156 function anyErrors()156 public function anyErrors() 157 157 { 158 158 return (sizeof($this->_errors) > 0); … … 162 162 * Reset the error list. 163 163 */ 164 function resetErrorList()164 public function resetErrorList() 165 165 { 166 166 $this->_errors = array(); … … 177 177 * @since 09 Jun 2005 18:23:51 178 178 */ 179 function check($word)179 public function check($word) 180 180 { 181 181 if (pspell_check($this->_pspell_handle, $word)) { … … 197 197 * @since 09 Jun 2005 18:23:51 198 198 */ 199 function suggest($word)199 public function suggest($word) 200 200 { 201 201 return pspell_suggest($this->_pspell_handle, $word); … … 212 212 * @since 09 Jun 2005 18:23:51 213 213 */ 214 function add($word)214 public function add($word) 215 215 { 216 216 $app =& App::getInstance(); … … 237 237 * @since 09 Jun 2005 18:23:51 238 238 */ 239 function save()239 public function save() 240 240 { 241 241 $app =& App::getInstance(); … … 263 263 * @since 09 Jun 2005 21:29:49 264 264 */ 265 function getStringSuggestions($string)265 public function getStringSuggestions($string) 266 266 { 267 267 $corrections = array(); … … 299 299 * @since 09 Jun 2005 22:11:27 300 300 */ 301 function checkString($string)301 public function checkString($string) 302 302 { 303 303 $errors = array(); … … 331 331 * @since 09 Jun 2005 21:29:49 332 332 */ 333 function getStringHighlighted($string, $show_footnote=false)333 public function getStringHighlighted($string, $show_footnote=false) 334 334 { 335 335 $words = preg_split('/([\W]+?)/', $string, -1, PREG_SPLIT_DELIM_CAPTURE); … … 357 357 * @since 09 Jun 2005 21:29:49 358 358 */ 359 function printCorrectionForm($form_name)359 public function printCorrectionForm($form_name) 360 360 { 361 361 ?> … … 402 402 * @since 09 Jun 2005 23:15:35 403 403 */ 404 function anyFormCorrections()404 public function anyFormCorrections() 405 405 { 406 406 return (false !== getFormData('spelling_suggestions', false)) || (false !== getFormData('spelling_corrections', false)); … … 417 417 * @since 09 Jun 2005 23:18:51 418 418 */ 419 function applyFormCorrections($form_name)419 public function applyFormCorrections($form_name) 420 420 { 421 421 $form_words = preg_split('/([\W]+?)/', getFormData($form_name), -1, PREG_SPLIT_DELIM_CAPTURE); … … 445 445 } // End. 446 446 447 ?> -
branches/eli_branch/lib/TemplateGlue.inc.php
r407 r439 501 501 } 502 502 } 503 504 ?> -
branches/eli_branch/lib/Upload.inc.php
r415 r439 41 41 42 42 // General object parameters. 43 var$_params = array(43 private $_params = array( 44 44 45 45 // Which messages do we pass to raiseMsg? … … 63 63 64 64 // Array of files with errors. 65 var$errors = array();65 public $errors = array(); 66 66 67 67 // Array of file name extensions and corresponding mime-types. 68 var$mime_extension_map = array( 'ez' => 'application/andrew-inset', 'hqx' => 'application/mac-binhex40', 'cpt' => 'application/mac-compactpro', 'doc' => 'application/msword', 'bin' => 'application/octet-stream', 'class' => 'application/octet-stream', 'dll' => 'application/octet-stream', 'dms' => 'application/octet-stream', 'exe' => 'application/octet-stream', 'lha' => 'application/octet-stream', 'lzh' => 'application/octet-stream', 'so' => 'application/octet-stream', 'oda' => 'application/oda', 'pdf' => 'application/pdf', 'ai' => 'application/postscript', 'eps' => 'application/postscript', 'ps' => 'application/postscript', 'smi' => 'application/smil', 'smil' => 'application/smil', 'mif' => 'application/vnd.mif', 'xls' => 'application/vnd.ms-excel', 'ppt' => 'application/vnd.ms-powerpoint', 'sxc' => 'application/vnd.sun.xml.calc', 'stc' => 'application/vnd.sun.xml.calc.template', 'sxd' => 'application/vnd.sun.xml.draw', 'std' => 'application/vnd.sun.xml.draw.template', 'sxi' => 'application/vnd.sun.xml.impress', 'sti' => 'application/vnd.sun.xml.impress.template', 'sxm' => 'application/vnd.sun.xml.math', 'sxw' => 'application/vnd.sun.xml.writer', 'sxg' => 'application/vnd.sun.xml.writer.global', 'stw' => 'application/vnd.sun.xml.writer.template', 'vsd' => 'application/vnd.visio', 'wbxml' => 'application/vnd.wap.wbxml', 'wmlc' => 'application/vnd.wap.wmlc', 'wmlsc' => 'application/vnd.wap.wmlscriptc', 'bcpio' => 'application/x-bcpio', 'vcd' => 'application/x-cdlink', 'pgn' => 'application/x-chess-pgn', 'Z' => 'application/x-compress', 'cpio' => 'application/x-cpio', 'csh' => 'application/x-csh', 'dcr' => 'application/x-director', 'dir' => 'application/x-director', 'dxr' => 'application/x-director', 'dvi' => 'application/x-dvi', 'spl' => 'application/x-futuresplash', 'gtar' => 'application/x-gtar', 'tgz' => 'application/x-gtar', 'gz' => 'application/x-gzip', 'hdf' => 'application/x-hdf', 'php' => 'application/x-httpd-php', 'php3' => 'application/x-httpd-php3', 'js' => 'application/x-javascript', 'skd' => 'application/x-koan', 'skm' => 'application/x-koan', 'skp' => 'application/x-koan', 'skt' => 'application/x-koan', 'latex' => 'application/x-latex', 'wmd' => 'application/x-ms-wmd', 'wmz' => 'application/x-ms-wmz', 'cdf' => 'application/x-netcdf', 'nc' => 'application/x-netcdf', 'pl' => 'application/x-perl', 'pm' => 'application/x-perl', 'psd' => 'application/x-photoshop', 'sh' => 'application/x-sh', 'shar' => 'application/x-shar', 'swf' => 'application/x-shockwave-flash', 'sit' => 'application/x-stuffit', 'sv4cpio' => 'application/x-sv4cpio', 'sv4crc' => 'application/x-sv4crc', 'tar' => 'application/x-tar', 'tcl' => 'application/x-tcl', 'tex' => 'application/x-tex', 'texi' => 'application/x-texinfo', 'texinfo' => 'application/x-texinfo', 'roff' => 'application/x-troff', 't' => 'application/x-troff', 'tr' => 'application/x-troff', 'man' => 'application/x-troff-man', 'me' => 'application/x-troff-me', 'ms' => 'application/x-troff-ms', 'ustar' => 'application/x-ustar', 'src' => 'application/x-wais-source', 'xht' => 'application/xhtml+xml', 'xhtml' => 'application/xhtml+xml', 'xml' => 'application/xml', 'zip' => 'application/zip', 'au' => 'audio/basic', 'snd' => 'audio/basic', 'kar' => 'audio/midi', 'mid' => 'audio/midi', 'midi' => 'audio/midi', 'mp2' => 'audio/mpeg', 'mp3' => 'audio/mpeg', 'mpga' => 'audio/mpeg', 'aif' => 'audio/x-aiff', 'aifc' => 'audio/x-aiff', 'aiff' => 'audio/x-aiff', 'm3u' => 'audio/x-mpegurl', 'wax' => 'audio/x-ms-wax', 'wma' => 'audio/x-ms-wma', 'ram' => 'audio/x-pn-realaudio', 'rm' => 'audio/x-pn-realaudio', 'rpm' => 'audio/x-pn-realaudio-plugin', 'ra' => 'audio/x-realaudio', 'wav' => 'audio/x-wav', 'pdb' => 'chemical/x-pdb', 'xyz' => 'chemical/x-xyz', 'bmp' => 'image/bmp', 'gif' => 'image/gif', 'ief' => 'image/ief', 'jpe' => 'image/jpeg', 'jpeg' => 'image/jpeg', 'jpg' => 'image/jpeg', 'png' => 'image/png', 'tif' => 'image/tiff', 'tiff' => 'image/tiff', 'wbmp' => 'image/vnd.wap.wbmp', 'ras' => 'image/x-cmu-raster', 'pnm' => 'image/x-portable-anymap', 'pbm' => 'image/x-portable-bitmap', 'pgm' => 'image/x-portable-graymap', 'ppm' => 'image/x-portable-pixmap', 'rgb' => 'image/x-rgb', 'xbm' => 'image/x-xbitmap', 'xpm' => 'image/x-xpixmap', 'xwd' => 'image/x-xwindowdump', 'iges' => 'model/iges', 'igs' => 'model/iges', 'mesh' => 'model/mesh', 'msh' => 'model/mesh', 'silo' => 'model/mesh', 'vrml' => 'model/vrml', 'wrl' => 'model/vrml', 'ics' => 'text/calendar', 'ifb' => 'text/calendar', 'vcs' => 'text/calendar', 'vfb' => 'text/calendar', 'css' => 'text/css', 'csv' => 'text/csv', 'diff' => 'text/diff', 'patch' => 'text/diff', 'htm' => 'text/html', 'html' => 'text/html', 'shtml' => 'text/html', 'asc' => 'text/plain', 'log' => 'text/plain', 'po' => 'text/plain', 'txt' => 'text/plain', 'rtx' => 'text/richtext', 'rtf' => 'text/rtf', 'sgm' => 'text/sgml', 'sgml' => 'text/sgml', 'tsv' => 'text/tab-separated-values', 'wml' => 'text/vnd.wap.wml', 'wmls' => 'text/vnd.wap.wmlscript', 'etx' => 'text/x-setext', 'vcf' => 'text/x-vcard', 'xsl' => 'text/xml', 'mp4' => 'video/mp4', 'mpe' => 'video/mpeg', 'mpeg' => 'video/mpeg', 'mpg' => 'video/mpeg', 'mov' => 'video/quicktime', 'qt' => 'video/quicktime', 'mxu' => 'video/vnd.mpegurl', 'asf' => 'video/x-ms-asf', 'asx' => 'video/x-ms-asf', 'wm' => 'video/x-ms-wm', 'wmv' => 'video/x-ms-wmv', 'wmx' => 'video/x-ms-wmx', 'wvx' => 'video/x-ms-wvx', 'avi' => 'video/x-msvideo', 'movie' => 'video/x-sgi-movie', 'ice' => 'x-conference/x-cooltalk', );68 public $mime_extension_map = array( 'ez' => 'application/andrew-inset', 'hqx' => 'application/mac-binhex40', 'cpt' => 'application/mac-compactpro', 'doc' => 'application/msword', 'bin' => 'application/octet-stream', 'class' => 'application/octet-stream', 'dll' => 'application/octet-stream', 'dms' => 'application/octet-stream', 'exe' => 'application/octet-stream', 'lha' => 'application/octet-stream', 'lzh' => 'application/octet-stream', 'so' => 'application/octet-stream', 'oda' => 'application/oda', 'pdf' => 'application/pdf', 'ai' => 'application/postscript', 'eps' => 'application/postscript', 'ps' => 'application/postscript', 'smi' => 'application/smil', 'smil' => 'application/smil', 'mif' => 'application/vnd.mif', 'xls' => 'application/vnd.ms-excel', 'ppt' => 'application/vnd.ms-powerpoint', 'sxc' => 'application/vnd.sun.xml.calc', 'stc' => 'application/vnd.sun.xml.calc.template', 'sxd' => 'application/vnd.sun.xml.draw', 'std' => 'application/vnd.sun.xml.draw.template', 'sxi' => 'application/vnd.sun.xml.impress', 'sti' => 'application/vnd.sun.xml.impress.template', 'sxm' => 'application/vnd.sun.xml.math', 'sxw' => 'application/vnd.sun.xml.writer', 'sxg' => 'application/vnd.sun.xml.writer.global', 'stw' => 'application/vnd.sun.xml.writer.template', 'vsd' => 'application/vnd.visio', 'wbxml' => 'application/vnd.wap.wbxml', 'wmlc' => 'application/vnd.wap.wmlc', 'wmlsc' => 'application/vnd.wap.wmlscriptc', 'bcpio' => 'application/x-bcpio', 'vcd' => 'application/x-cdlink', 'pgn' => 'application/x-chess-pgn', 'Z' => 'application/x-compress', 'cpio' => 'application/x-cpio', 'csh' => 'application/x-csh', 'dcr' => 'application/x-director', 'dir' => 'application/x-director', 'dxr' => 'application/x-director', 'dvi' => 'application/x-dvi', 'spl' => 'application/x-futuresplash', 'gtar' => 'application/x-gtar', 'tgz' => 'application/x-gtar', 'gz' => 'application/x-gzip', 'hdf' => 'application/x-hdf', 'php' => 'application/x-httpd-php', 'php3' => 'application/x-httpd-php3', 'js' => 'application/x-javascript', 'skd' => 'application/x-koan', 'skm' => 'application/x-koan', 'skp' => 'application/x-koan', 'skt' => 'application/x-koan', 'latex' => 'application/x-latex', 'wmd' => 'application/x-ms-wmd', 'wmz' => 'application/x-ms-wmz', 'cdf' => 'application/x-netcdf', 'nc' => 'application/x-netcdf', 'pl' => 'application/x-perl', 'pm' => 'application/x-perl', 'psd' => 'application/x-photoshop', 'sh' => 'application/x-sh', 'shar' => 'application/x-shar', 'swf' => 'application/x-shockwave-flash', 'sit' => 'application/x-stuffit', 'sv4cpio' => 'application/x-sv4cpio', 'sv4crc' => 'application/x-sv4crc', 'tar' => 'application/x-tar', 'tcl' => 'application/x-tcl', 'tex' => 'application/x-tex', 'texi' => 'application/x-texinfo', 'texinfo' => 'application/x-texinfo', 'roff' => 'application/x-troff', 't' => 'application/x-troff', 'tr' => 'application/x-troff', 'man' => 'application/x-troff-man', 'me' => 'application/x-troff-me', 'ms' => 'application/x-troff-ms', 'ustar' => 'application/x-ustar', 'src' => 'application/x-wais-source', 'xht' => 'application/xhtml+xml', 'xhtml' => 'application/xhtml+xml', 'xml' => 'application/xml', 'zip' => 'application/zip', 'au' => 'audio/basic', 'snd' => 'audio/basic', 'kar' => 'audio/midi', 'mid' => 'audio/midi', 'midi' => 'audio/midi', 'mp2' => 'audio/mpeg', 'mp3' => 'audio/mpeg', 'mpga' => 'audio/mpeg', 'aif' => 'audio/x-aiff', 'aifc' => 'audio/x-aiff', 'aiff' => 'audio/x-aiff', 'm3u' => 'audio/x-mpegurl', 'wax' => 'audio/x-ms-wax', 'wma' => 'audio/x-ms-wma', 'ram' => 'audio/x-pn-realaudio', 'rm' => 'audio/x-pn-realaudio', 'rpm' => 'audio/x-pn-realaudio-plugin', 'ra' => 'audio/x-realaudio', 'wav' => 'audio/x-wav', 'pdb' => 'chemical/x-pdb', 'xyz' => 'chemical/x-xyz', 'bmp' => 'image/bmp', 'gif' => 'image/gif', 'ief' => 'image/ief', 'jpe' => 'image/jpeg', 'jpeg' => 'image/jpeg', 'jpg' => 'image/jpeg', 'png' => 'image/png', 'tif' => 'image/tiff', 'tiff' => 'image/tiff', 'wbmp' => 'image/vnd.wap.wbmp', 'ras' => 'image/x-cmu-raster', 'pnm' => 'image/x-portable-anymap', 'pbm' => 'image/x-portable-bitmap', 'pgm' => 'image/x-portable-graymap', 'ppm' => 'image/x-portable-pixmap', 'rgb' => 'image/x-rgb', 'xbm' => 'image/x-xbitmap', 'xpm' => 'image/x-xpixmap', 'xwd' => 'image/x-xwindowdump', 'iges' => 'model/iges', 'igs' => 'model/iges', 'mesh' => 'model/mesh', 'msh' => 'model/mesh', 'silo' => 'model/mesh', 'vrml' => 'model/vrml', 'wrl' => 'model/vrml', 'ics' => 'text/calendar', 'ifb' => 'text/calendar', 'vcs' => 'text/calendar', 'vfb' => 'text/calendar', 'css' => 'text/css', 'csv' => 'text/csv', 'diff' => 'text/diff', 'patch' => 'text/diff', 'htm' => 'text/html', 'html' => 'text/html', 'shtml' => 'text/html', 'asc' => 'text/plain', 'log' => 'text/plain', 'po' => 'text/plain', 'txt' => 'text/plain', 'rtx' => 'text/richtext', 'rtf' => 'text/rtf', 'sgm' => 'text/sgml', 'sgml' => 'text/sgml', 'tsv' => 'text/tab-separated-values', 'wml' => 'text/vnd.wap.wml', 'wmls' => 'text/vnd.wap.wmlscript', 'etx' => 'text/x-setext', 'vcf' => 'text/x-vcard', 'xsl' => 'text/xml', 'mp4' => 'video/mp4', 'mpe' => 'video/mpeg', 'mpeg' => 'video/mpeg', 'mpg' => 'video/mpeg', 'mov' => 'video/quicktime', 'qt' => 'video/quicktime', 'mxu' => 'video/vnd.mpegurl', 'asf' => 'video/x-ms-asf', 'asx' => 'video/x-ms-asf', 'wm' => 'video/x-ms-wm', 'wmv' => 'video/x-ms-wmv', 'wmx' => 'video/x-ms-wmx', 'wvx' => 'video/x-ms-wvx', 'avi' => 'video/x-msvideo', 'movie' => 'video/x-sgi-movie', 'ice' => 'x-conference/x-cooltalk', ); 69 69 70 70 /** … … 74 74 * @param array $params Array of parameters (key => val pairs). 75 75 */ 76 function setParam($params)76 public function setParam($params) 77 77 { 78 78 $app =& App::getInstance(); … … 118 118 * @return mixed Configured parameter value. 119 119 */ 120 function getParam($param)120 public function getParam($param) 121 121 { 122 122 $app =& App::getInstance(); … … 144 144 * In this case it is necessary to check the Upload::anyErrors method to discover if any did fail. 145 145 */ 146 function process($form_name, $custom_file_name=null)146 public function process($form_name, $custom_file_name=null) 147 147 { 148 148 $app =& App::getInstance(); … … 351 351 * @return bool Success of operation. 352 352 */ 353 function deleteFile($file_name, $use_glob=false)353 public function deleteFile($file_name, $use_glob=false) 354 354 { 355 355 $app =& App::getInstance(); … … 384 384 * @return bool Success of operation. 385 385 */ 386 function moveFile($old_name, $new_name)386 public function moveFile($old_name, $new_name) 387 387 { 388 388 $app =& App::getInstance(); … … 419 419 * @return bool Existence of file. 420 420 */ 421 function exists($file_name)421 public function exists($file_name) 422 422 { 423 423 $app =& App::getInstance(); … … 442 442 * @since 15 Nov 2005 20:55:22 443 443 */ 444 function getFilenameGlob($pattern)444 public function getFilenameGlob($pattern) 445 445 { 446 446 $file_list = glob(sprintf('%s/%s', $this->getParam('upload_path'), $pattern)); … … 458 458 * @return array List of file names. 459 459 */ 460 function getErrors()460 public function getErrors() 461 461 { 462 462 return $this->errors; … … 468 468 * @access public 469 469 */ 470 function anyErrors()470 public function anyErrors() 471 471 { 472 472 return sizeof($this->errors) > 0; … … 480 480 * @return string The same name, but cleaned. 481 481 */ 482 function cleanFileName($file_name)482 public function cleanFileName($file_name) 483 483 { 484 484 $bad = 'áéÃóúà ÚìòùÀëïöÌÃÃÃÃÃÃÃÃÃÃÃÃÃÃÃâêîÎûÃÃÃÃÃñçÃ@'; … … 499 499 * @return string The value found after the dot 500 500 */ 501 function getFilenameExtension($file_name)501 public function getFilenameExtension($file_name) 502 502 { 503 503 preg_match('/.*?\.(\w+)$/i', trim($file_name), $ext); … … 516 516 * @param string $line __LINE__. 517 517 */ 518 function _raiseMsg($message, $type, $file, $line)518 public function _raiseMsg($message, $type, $file, $line) 519 519 { 520 520 $app =& App::getInstance(); … … 526 526 } 527 527 528 ?> -
branches/eli_branch/lib/Utilities.inc.php
r419 r439 1088 1088 } 1089 1089 } 1090 1091 1092 ?> -
branches/eli_branch/lib/Validator.inc.php
r415 r439 53 53 * @return bool true if form is not empty, false otherwise. 54 54 */ 55 function notEmpty($val)55 public function notEmpty($val) 56 56 { 57 57 return '' != trim((string)$val); … … 64 64 * @return bool true if form is empty, false otherwise. 65 65 */ 66 function isEmpty($val)66 public function isEmpty($val) 67 67 { 68 68 return '' == trim((string)$val); … … 75 75 * @return bool true if form is a string, false otherwise. 76 76 */ 77 function isString($val)77 public function isString($val) 78 78 { 79 79 return '' == trim((string)$val) || is_string($val); … … 86 86 * @return bool True if no errors found, false otherwise. 87 87 */ 88 function isNumber($val)88 public function isNumber($val) 89 89 { 90 90 return '' == trim((string)$val) || is_numeric($val); … … 98 98 * @return bool true if value is an integer 99 99 */ 100 function isInteger($val, $negative_ok=false)100 public function isInteger($val, $negative_ok=false) 101 101 { 102 102 $pattern = $negative_ok ? '/^-?[[:digit:]]+$/' : '/^[[:digit:]]+$/'; … … 112 112 * @return bool true if value is a float 113 113 */ 114 function isFloat($val, $negative_ok=false)114 public function isFloat($val, $negative_ok=false) 115 115 { 116 116 $pattern = $negative_ok ? '/^-?[[:digit:]]*(?:\.?[[:digit:]]+)$/' : '/^[[:digit:]]*(?:\.?[[:digit:]]+)$/'; … … 124 124 * @return bool true if value is a float 125 125 */ 126 function isArray($val)126 public function isArray($val) 127 127 { 128 128 return (is_string($val) && '' == trim((string)$val)) || is_array($val); … … 138 138 * @return bool true if value passes regex test 139 139 */ 140 function checkRegex($val, $regex, $valid_on_match=true)140 public function checkRegex($val, $regex, $valid_on_match=true) 141 141 { 142 142 return $valid_on_match ? preg_match($regex, $val) : !preg_match($regex, $val); … … 151 151 * @return bool true if string length is within given boundaries 152 152 */ 153 function stringLength($val, $min, $max)153 public function stringLength($val, $min, $max) 154 154 { 155 155 return mb_strlen(trim((string)$val)) >= $min && mb_strlen($val) <= $max; … … 164 164 * @return bool True if no errors found, false otherwise. 165 165 */ 166 function numericRange($val, $min, $max)166 public function numericRange($val, $min, $max) 167 167 { 168 168 return '' == trim((string)$val) || (is_numeric($val) && $val >= $min && $val <= $max); … … 183 183 * @author Quinn Comendant <quinn@strangecode.com> 184 184 */ 185 function validateEmail($val)185 public function validateEmail($val) 186 186 { 187 187 require_once 'codebase/lib/Email.inc.php'; … … 222 222 * @return bool True if no errors found, false otherwise. 223 223 */ 224 function validateStrDate($val)224 public function validateStrDate($val) 225 225 { 226 226 $app =& App::getInstance(); … … 250 250 * @return bool True if no errors found, false otherwise. 251 251 */ 252 function validateCCNumber($val, $cc_type=null)252 public function validateCCNumber($val, $cc_type=null) 253 253 { 254 254 // Get rid of any non-digits … … 319 319 * @return bool True if no errors found, false otherwise. 320 320 */ 321 function fileUploaded($form_name)321 public function fileUploaded($form_name) 322 322 { 323 323 if (!isset($_FILES[$form_name]['name']) || empty($_FILES[$form_name]['name'])) { … … 342 342 } // THE END 343 343 344 ?> -
branches/eli_branch/lib/Version.inc.php
r396 r439 40 40 41 41 // Configuration of this object. 42 var$_params = array(42 private $_params = array( 43 43 'max_qty' => 100, // Never have more than this many versions of each record. 44 44 'min_qty' => 25, // Keep at least this many versions of each record. … … 54 54 55 55 // Auth_SQL object from which to access a current user_id. 56 var$_auth;56 private $_auth; 57 57 58 58 /** … … 63 63 * @static 64 64 */ 65 static function &getInstance($auth_object)65 public static function &getInstance($auth_object) 66 66 { 67 67 static $instance = null; … … 79 79 * @param mixed $auth_object An Auth_SQL object. 80 80 */ 81 function Version($auth_object)81 public function __construct($auth_object) 82 82 { 83 83 $app =& App::getInstance(); … … 102 102 * @since 26 Aug 2005 17:09:36 103 103 */ 104 function initDB($recreate_db=false)104 public function initDB($recreate_db=false) 105 105 { 106 106 $app =& App::getInstance(); … … 155 155 * @param array $params Array of param keys and values to set. 156 156 */ 157 function setParam($params=null)157 public function setParam($params=null) 158 158 { 159 159 if (isset($params) && is_array($params)) { … … 170 170 * @return mixed Configured parameter value. 171 171 */ 172 function getParam($param)172 public function getParam($param) 173 173 { 174 174 $app =& App::getInstance(); … … 192 192 * @return int The id for the version (mysql last insert id). 193 193 */ 194 function create($record_table, $record_key, $record_val, $title='', $notes='')194 public function create($record_table, $record_key, $record_val, $title='', $notes='') 195 195 { 196 196 $app =& App::getInstance(); … … 253 253 * @return int The id for the version (mysql last insert id). 254 254 */ 255 function restore($version_id)255 public function restore($version_id) 256 256 { 257 257 $app =& App::getInstance(); … … 314 314 * @return mixed Array of versions, or false if none. 315 315 */ 316 function deleteOld($record_table, $record_key, $record_val)316 public function deleteOld($record_table, $record_key, $record_val) 317 317 { 318 318 $db =& DB::getInstance(); … … 381 381 * @return mixed Array of versions, or false if none. 382 382 */ 383 function getList($record_table, $record_key, $record_val)383 public function getList($record_table, $record_key, $record_val) 384 384 { 385 385 $db =& DB::getInstance(); … … 418 418 * @return mixed Array of data saved in version, or false if none. 419 419 */ 420 function getVerson($version_id)420 public function getVerson($version_id) 421 421 { 422 422 $db =& DB::getInstance(); … … 439 439 * @return mixed Array of data saved in version, or false if none. 440 440 */ 441 function getData($version_id)441 public function getData($version_id) 442 442 { 443 443 $db =& DB::getInstance(); … … 465 465 * @return mixed Array of data saved in version, or false if none. 466 466 */ 467 function getCurrent($record_table, $record_key, $record_val)467 public function getCurrent($record_table, $record_key, $record_val) 468 468 { 469 469 $db =& DB::getInstance(); … … 484 484 485 485 } // End of class. 486 ?> -
branches/eli_branch/services/reset_password.php
r396 r439 87 87 include 'footer.ihtml'; 88 88 89 ?>
Note: See TracChangeset
for help on using the changeset viewer.