diff --git a/Auth.php b/Auth.php index 2d3a220..17b3085 100644 --- a/Auth.php +++ b/Auth.php @@ -314,6 +314,10 @@ class Auth { var $regenerateSessionId = false; // }}} + + private $storage_driver; + private $storage_options; + // {{{ Auth() [constructor] /** @@ -330,7 +334,7 @@ class Auth { * @param boolean Should the login form be displayed if necessary? * @return void */ - function Auth($storageDriver, $options = '', $loginFunction = '', $showLogin = true) + function __construct($storageDriver, $options = '', $loginFunction = '', $showLogin = true) { $this->applyAuthOptions($options); @@ -492,15 +496,11 @@ function assignData() if ( isset($this->post[$this->_postUsername]) && $this->post[$this->_postUsername] != '') { - $this->username = (get_magic_quotes_gpc() == 1 - ? stripslashes($this->post[$this->_postUsername]) - : $this->post[$this->_postUsername]); + $this->username = $this->post[$this->_postUsername]; } if ( isset($this->post[$this->_postPassword]) && $this->post[$this->_postPassword] != '') { - $this->password = (get_magic_quotes_gpc() == 1 - ? stripslashes($this->post[$this->_postPassword]) - : $this->post[$this->_postPassword] ); + $this->password = $this->post[$this->_postPassword]; } } @@ -866,6 +866,7 @@ function setAuth($username) $this->session['username'] = $username; $this->session['timestamp'] = time(); $this->session['idle'] = time(); + $_SESSION[$this->_sessionName] = $this->session; } // }}} @@ -1086,6 +1087,7 @@ function logout() $this->password = ''; $this->session = null; + $_SESSION[$this->_sessionName] = null; } // }}} diff --git a/Auth/Anonymous.php b/Auth/Anonymous.php index c0969bc..f463fa3 100644 --- a/Auth/Anonymous.php +++ b/Auth/Anonymous.php @@ -81,7 +81,7 @@ class Auth_Anonymous extends Auth * @return void * @see Auth::Auth() */ - function Auth_Anonymous($storageDriver, $options = '', $loginFunction = '', $showLogin = true) { + function __construct($storageDriver, $options = '', $loginFunction = '', $showLogin = true) { parent::Auth($storageDriver, $options, $loginFunction, $showLogin); } diff --git a/Auth/Container.php b/Auth/Container.php index d60dd79..0d6d197 100644 --- a/Auth/Container.php +++ b/Auth/Container.php @@ -63,7 +63,7 @@ class Auth_Container * * @access public */ - function Auth_Container() + function __construct() { } diff --git a/Auth/Container/Array.php b/Auth/Container/Array.php index 94c45cd..7de6fc4 100644 --- a/Auth/Container/Array.php +++ b/Auth/Container/Array.php @@ -95,7 +95,7 @@ class Auth_Container_Array extends Auth_Container { * @param array $data Options for the container * @return void */ - function Auth_Container_Array($data) + function __construct($data) { if (!is_array($data)) { PEAR::raiseError('The options for Auth_Container_Array must be an array'); diff --git a/Auth/Container/CAS.php b/Auth/Container/CAS.php index 0016a22..c26568a 100644 --- a/Auth/Container/CAS.php +++ b/Auth/Container/CAS.php @@ -119,7 +119,7 @@ class Auth_Container_CAS extends Auth_Container * @param $options, associative array with cas options features * @see $_options */ - function Auth_Container_CAS($options) + function __construct($options) { //Check for valid options foreach ($options as $key => $value) { @@ -165,4 +165,4 @@ function fetchData($username = null, $password = null) $this->_auth_obj->username = phpCAS::getUser(); return true; } -} \ No newline at end of file +} diff --git a/Auth/Container/DB.php b/Auth/Container/DB.php index 12796e2..9d81414 100644 --- a/Auth/Container/DB.php +++ b/Auth/Container/DB.php @@ -82,7 +82,7 @@ class Auth_Container_DB extends Auth_Container * @param string Connection data or DB object * @return object Returns an error object if something went wrong */ - function Auth_Container_DB($dsn) + function __construct($dsn) { $this->_setDefaults(); diff --git a/Auth/Container/DBLite.php b/Auth/Container/DBLite.php index 1d45728..03cef04 100644 --- a/Auth/Container/DBLite.php +++ b/Auth/Container/DBLite.php @@ -84,7 +84,7 @@ class Auth_Container_DBLite extends Auth_Container * @param string Connection data or DB object * @return object Returns an error object if something went wrong */ - function Auth_Container_DBLite($dsn) + function __construct($dsn) { $this->options['table'] = 'auth'; $this->options['usernamecol'] = 'username'; diff --git a/Auth/Container/File.php b/Auth/Container/File.php index 909bac4..9499884 100644 --- a/Auth/Container/File.php +++ b/Auth/Container/File.php @@ -83,7 +83,7 @@ class Auth_Container_File extends Auth_Container * @param string $filename path to passwd file * @return object Auth_Container_File new Auth_Container_File object */ - function Auth_Container_File($filename) { + function __construct($filename) { $this->_setDefaults(); // Only file is a valid option here diff --git a/Auth/Container/IMAP.php b/Auth/Container/IMAP.php old mode 100755 new mode 100644 index 9eb6391..c32a482 --- a/Auth/Container/IMAP.php +++ b/Auth/Container/IMAP.php @@ -103,7 +103,7 @@ class Auth_Container_IMAP extends Auth_Container * @return object Returns an error object if something went wrong * @todo Use PEAR Net_IMAP if IMAP extension not loaded */ - function Auth_Container_IMAP($params) + function __construct($params) { if (!extension_loaded('imap')) { return PEAR::raiseError('Cannot use IMAP authentication, ' diff --git a/Auth/Container/KADM5.php b/Auth/Container/KADM5.php index abe68ba..ff08bc2 100644 --- a/Auth/Container/KADM5.php +++ b/Auth/Container/KADM5.php @@ -78,7 +78,7 @@ class Auth_Container_KADM5 extends Auth_Container { * @param $options associative array * @return object Returns an error object if something went wrong */ - function Auth_Container_KADM5($options) { + function __construct($options) { if (!extension_loaded('kadm5')) { return PEAR::raiseError("Cannot use Kerberos V authentication, KADM5 extension not loaded!", 41, PEAR_ERROR_DIE); } diff --git a/Auth/Container/LDAP.php b/Auth/Container/LDAP.php old mode 100755 new mode 100644 index 6872e3b..aa38e48 --- a/Auth/Container/LDAP.php +++ b/Auth/Container/LDAP.php @@ -227,7 +227,7 @@ class Auth_Container_LDAP extends Auth_Container * @param $params, associative hash with host,port,basedn and userattr key * @return object Returns an error object if something went wrong */ - function Auth_Container_LDAP($params) + function __construct($params) { if (false === extension_loaded('ldap')) { return PEAR::raiseError('Auth_Container_LDAP: LDAP Extension not loaded', @@ -544,7 +544,7 @@ function _scope2function($scope) * @param string Password * @return boolean */ - function fetchData($username, $password) + function fetchData($username, $password, $isChallengeResponse=false) { $this->log('Auth_Container_LDAP::fetchData() called.', AUTH_LOG_DEBUG); $err = $this->_prepare(); diff --git a/Auth/Container/MDB.php b/Auth/Container/MDB.php old mode 100755 new mode 100644 index d5b624a..dac3e8c --- a/Auth/Container/MDB.php +++ b/Auth/Container/MDB.php @@ -83,7 +83,7 @@ class Auth_Container_MDB extends Auth_Container * @param string Connection data or MDB object * @return object Returns an error object if something went wrong */ - function Auth_Container_MDB($dsn) + function __construct($dsn) { $this->_setDefaults(); @@ -633,4 +633,4 @@ function getCryptType() // }}} -} \ No newline at end of file +} diff --git a/Auth/Container/MDB2.php b/Auth/Container/MDB2.php index 94f1723..5c4f3c8 100644 --- a/Auth/Container/MDB2.php +++ b/Auth/Container/MDB2.php @@ -83,7 +83,7 @@ class Auth_Container_MDB2 extends Auth_Container * @param string Connection data or MDB2 object * @return object Returns an error object if something went wrong */ - function Auth_Container_MDB2($dsn) + function __construct($dsn) { $this->_setDefaults(); diff --git a/Auth/Container/Multiple.php b/Auth/Container/Multiple.php index cee6699..b6ae704 100644 --- a/Auth/Container/Multiple.php +++ b/Auth/Container/Multiple.php @@ -104,7 +104,7 @@ class Auth_Container_Multiple extends Auth_Container { * @param array $data Options for the container * @return void */ - function Auth_Container_Multiple($options) + function __construct($options) { if (!is_array($options)) { PEAR::raiseError('The options for Auth_Container_Multiple must be an array'); diff --git a/Auth/Container/NetVPOPMaild.php b/Auth/Container/NetVPOPMaild.php index 4315c74..6b6ff76 100644 --- a/Auth/Container/NetVPOPMaild.php +++ b/Auth/Container/NetVPOPMaild.php @@ -73,7 +73,7 @@ class Auth_Container_Vpopmaild extends Auth_Container * @param $server string server or server:port combination * @return object Returns an error object if something went wrong */ - function Auth_Container_Vpopmaild($server=null) + function __construct($server=null) { if (isset($server) && !is_null($server)) { if (is_array($server)) { diff --git a/Auth/Container/PEAR.php b/Auth/Container/PEAR.php index 6a1dd1b..ee595b7 100644 --- a/Auth/Container/PEAR.php +++ b/Auth/Container/PEAR.php @@ -86,7 +86,7 @@ class Auth_Container_Pear extends Auth_Container * * @return void */ - function Auth_Container_Pear($data = null) + function __construct($data = null) { if (!is_array($data)) { PEAR::raiseError('The options for Auth_Container_Pear must be an array'); diff --git a/Auth/Container/POP3.php b/Auth/Container/POP3.php index 629b5d8..ed92b53 100644 --- a/Auth/Container/POP3.php +++ b/Auth/Container/POP3.php @@ -90,7 +90,7 @@ class Auth_Container_POP3 extends Auth_Container * @param $server string server or server:port combination * @return object Returns an error object if something went wrong */ - function Auth_Container_POP3($server=null) + function __construct($server=null) { if (isset($server) && !is_null($server)) { if (is_array($server)) { @@ -141,4 +141,4 @@ function fetchData($username, $password) // }}} -} \ No newline at end of file +} diff --git a/Auth/Container/RADIUS.php b/Auth/Container/RADIUS.php index a428f6e..e877f40 100644 --- a/Auth/Container/RADIUS.php +++ b/Auth/Container/RADIUS.php @@ -78,7 +78,7 @@ class Auth_Container_RADIUS extends Auth_Container * @param $options associative array * @return object Returns an error object if something went wrong */ - function Auth_Container_RADIUS($options) + function __construct($options) { $this->authtype = 'PAP'; if (isset($options['authtype'])) { diff --git a/Auth/Container/SAP.php b/Auth/Container/SAP.php index cd6a017..39d24e5 100644 --- a/Auth/Container/SAP.php +++ b/Auth/Container/SAP.php @@ -91,7 +91,7 @@ class Auth_Container_SAP extends Auth_Container { * @param array array of options. * @return void */ - function Auth_Container_SAP($options) + function __construct($options) { $saprfc_loaded = PEAR::loadExtension('saprfc'); if (!$saprfc_loaded) { diff --git a/Auth/Container/SMBPasswd.php b/Auth/Container/SMBPasswd.php index 61f2cf4..4a56f21 100644 --- a/Auth/Container/SMBPasswd.php +++ b/Auth/Container/SMBPasswd.php @@ -81,7 +81,7 @@ class Auth_Container_SMBPasswd extends Auth_Container * @param $filename string filename for a passwd type file * @return object Returns an error object if something went wrong */ - function Auth_Container_SMBPasswd($filename) + function __construct($filename) { $this->pwfile = new File_SMBPasswd($filename,0); diff --git a/Auth/Container/SOAP.php b/Auth/Container/SOAP.php index cceea43..3dd0d5b 100644 --- a/Auth/Container/SOAP.php +++ b/Auth/Container/SOAP.php @@ -143,7 +143,7 @@ class Auth_Container_SOAP extends Auth_Container * @param $options, associative array with endpoint, namespace, method, * usernamefield, passwordfield and optional features */ - function Auth_Container_SOAP($options) + function __construct($options) { $this->_options = $options; if (!isset($this->_options['matchpasswords'])) { @@ -225,4 +225,4 @@ function fetchData($username, $password) // }}} -} \ No newline at end of file +} diff --git a/Auth/Container/SOAP5.php b/Auth/Container/SOAP5.php index b0d5e6d..e6ee689 100644 --- a/Auth/Container/SOAP5.php +++ b/Auth/Container/SOAP5.php @@ -153,7 +153,7 @@ class Auth_Container_SOAP5 extends Auth_Container * @param $options, associative array with endpoint, namespace, method, * usernamefield, passwordfield and optional features */ - function Auth_Container_SOAP5($options) + function __construct($options) { $this->_setDefaults(); diff --git a/Auth/Container/vpopmail.php b/Auth/Container/vpopmail.php old mode 100755 new mode 100644 index 8b5c0c7..6af3842 --- a/Auth/Container/vpopmail.php +++ b/Auth/Container/vpopmail.php @@ -54,7 +54,7 @@ class Auth_Container_vpopmail extends Auth_Container { * * @return void */ - function Auth_Container_vpopmail() + function __construct() { if (!extension_loaded('vpopmail')) { return PEAR::raiseError('Cannot use VPOPMail authentication, ' @@ -84,4 +84,4 @@ function fetchData($username, $password) // }}} -} \ No newline at end of file +} diff --git a/Auth/Controller.php b/Auth/Controller.php index 9f3a657..a69c114 100644 --- a/Auth/Controller.php +++ b/Auth/Controller.php @@ -104,7 +104,7 @@ class Auth_Controller * @return void * @todo Add a list of urls which need redirection */ - function Auth_Controller(&$auth_obj, $login='login.php', $default='index.php', $accessList=array()) + function __construct(&$auth_obj, $login='login.php', $default='index.php', $accessList=array()) { $this->auth = $auth_obj; $this->_loginPage = $login; diff --git a/README.Auth b/README.Auth old mode 100755 new mode 100644