Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 9 additions & 7 deletions Auth.php
Original file line number Diff line number Diff line change
Expand Up @@ -314,6 +314,10 @@ class Auth {
var $regenerateSessionId = false;

// }}}

private $storage_driver;
private $storage_options;

// {{{ Auth() [constructor]

/**
Expand All @@ -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);

Expand Down Expand Up @@ -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];
}
}

Expand Down Expand Up @@ -866,6 +866,7 @@ function setAuth($username)
$this->session['username'] = $username;
$this->session['timestamp'] = time();
$this->session['idle'] = time();
$_SESSION[$this->_sessionName] = $this->session;
}

// }}}
Expand Down Expand Up @@ -1086,6 +1087,7 @@ function logout()
$this->password = '';

$this->session = null;
$_SESSION[$this->_sessionName] = null;
}

// }}}
Expand Down
2 changes: 1 addition & 1 deletion Auth/Anonymous.php
Original file line number Diff line number Diff line change
Expand Up @@ -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);
}

Expand Down
2 changes: 1 addition & 1 deletion Auth/Container.php
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,7 @@ class Auth_Container
*
* @access public
*/
function Auth_Container()
function __construct()
{
}

Expand Down
2 changes: 1 addition & 1 deletion Auth/Container/Array.php
Original file line number Diff line number Diff line change
Expand Up @@ -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');
Expand Down
4 changes: 2 additions & 2 deletions Auth/Container/CAS.php
Original file line number Diff line number Diff line change
Expand Up @@ -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) {
Expand Down Expand Up @@ -165,4 +165,4 @@ function fetchData($username = null, $password = null)
$this->_auth_obj->username = phpCAS::getUser();
return true;
}
}
}
2 changes: 1 addition & 1 deletion Auth/Container/DB.php
Original file line number Diff line number Diff line change
Expand Up @@ -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();

Expand Down
2 changes: 1 addition & 1 deletion Auth/Container/DBLite.php
Original file line number Diff line number Diff line change
Expand Up @@ -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';
Expand Down
2 changes: 1 addition & 1 deletion Auth/Container/File.php
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion Auth/Container/IMAP.php
100755 → 100644
Original file line number Diff line number Diff line change
Expand Up @@ -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, '
Expand Down
2 changes: 1 addition & 1 deletion Auth/Container/KADM5.php
Original file line number Diff line number Diff line change
Expand Up @@ -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);
}
Expand Down
4 changes: 2 additions & 2 deletions Auth/Container/LDAP.php
100755 → 100644
Original file line number Diff line number Diff line change
Expand Up @@ -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',
Expand Down Expand Up @@ -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();
Expand Down
4 changes: 2 additions & 2 deletions Auth/Container/MDB.php
100755 → 100644
Original file line number Diff line number Diff line change
Expand Up @@ -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();

Expand Down Expand Up @@ -633,4 +633,4 @@ function getCryptType()

// }}}

}
}
2 changes: 1 addition & 1 deletion Auth/Container/MDB2.php
Original file line number Diff line number Diff line change
Expand Up @@ -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();

Expand Down
2 changes: 1 addition & 1 deletion Auth/Container/Multiple.php
Original file line number Diff line number Diff line change
Expand Up @@ -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');
Expand Down
2 changes: 1 addition & 1 deletion Auth/Container/NetVPOPMaild.php
Original file line number Diff line number Diff line change
Expand Up @@ -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)) {
Expand Down
2 changes: 1 addition & 1 deletion Auth/Container/PEAR.php
Original file line number Diff line number Diff line change
Expand Up @@ -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');
Expand Down
4 changes: 2 additions & 2 deletions Auth/Container/POP3.php
Original file line number Diff line number Diff line change
Expand Up @@ -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)) {
Expand Down Expand Up @@ -141,4 +141,4 @@ function fetchData($username, $password)

// }}}

}
}
2 changes: 1 addition & 1 deletion Auth/Container/RADIUS.php
Original file line number Diff line number Diff line change
Expand Up @@ -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'])) {
Expand Down
2 changes: 1 addition & 1 deletion Auth/Container/SAP.php
Original file line number Diff line number Diff line change
Expand Up @@ -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) {
Expand Down
2 changes: 1 addition & 1 deletion Auth/Container/SMBPasswd.php
Original file line number Diff line number Diff line change
Expand Up @@ -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);

Expand Down
4 changes: 2 additions & 2 deletions Auth/Container/SOAP.php
Original file line number Diff line number Diff line change
Expand Up @@ -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'])) {
Expand Down Expand Up @@ -225,4 +225,4 @@ function fetchData($username, $password)

// }}}

}
}
2 changes: 1 addition & 1 deletion Auth/Container/SOAP5.php
Original file line number Diff line number Diff line change
Expand Up @@ -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();

Expand Down
4 changes: 2 additions & 2 deletions Auth/Container/vpopmail.php
100755 → 100644
Original file line number Diff line number Diff line change
Expand Up @@ -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, '
Expand Down Expand Up @@ -84,4 +84,4 @@ function fetchData($username, $password)

// }}}

}
}
2 changes: 1 addition & 1 deletion Auth/Controller.php
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down
Empty file modified README.Auth
100755 → 100644
Empty file.