Changeset 439 for branches/eli_branch/lib/Auth_SQL.inc.php
- Timestamp:
- Nov 30, 2013 7:30:44 PM (11 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
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 ?>
Note: See TracChangeset
for help on using the changeset viewer.