Inheritance diagram for ilBaseAuthentication:Public Member Functions | |
| ilBaseAuthentication () | |
| setClient ($a_client) | |
| getClient () | |
| setUsername ($a_username) | |
| getUsername () | |
| setPassword ($a_password) | |
| getPassword () | |
| setSid ($a_sid) | |
| getSid () | |
| getMessage () | |
| getMessageCode () | |
| __setMessage ($a_message) | |
| __setMessageCode ($a_message_code) | |
| setPasswordType ($a_type) | |
| getPasswordType () | |
| authenticate () | |
| start () | |
| validateSession () | |
| logout () | |
| __buildDSN () | |
| __buildAuth () | |
| __setSessionSaveHandler () | |
| __getAuthStatus () | |
Data Fields | |
| $auth = null | |
| $sid = '' | |
| $username = '' | |
| $password = '' | |
| $client = '' | |
Definition at line 39 of file class.ilBaseAuthentication.php.
| ilBaseAuthentication::__buildAuth | ( | ) |
Definition at line 292 of file class.ilBaseAuthentication.php.
References getPasswordType().
Referenced by ilSoapAuthentication::authenticate(), authenticate(), ilSoapAuthentication::validateSession(), and validateSession().
{
$this->auth_params = array(
'dsn' => $this->dsn,
'table' => $this->ini->readVariable("auth", "table"),
'usernamecol' => $this->ini->readVariable("auth", "usercol"),
'passwordcol' => $this->ini->readVariable("auth", "passcol")
);
if($this->getPasswordType() == IL_AUTH_MD5)
{
$this->auth_params['cryptType'] = 'none';
}
$this->auth = new Auth("DB", $this->auth_params,"",false);
return true;
}
Here is the call graph for this function:
Here is the caller graph for this function:| ilBaseAuthentication::__buildDSN | ( | ) |
Definition at line 264 of file class.ilBaseAuthentication.php.
References __setMessage(), __setMessageCode(), and getClient().
Referenced by ilSoapAuthentication::authenticate(), authenticate(), and ilSoapAuthentication::validateSession().
{
include_once './classes/class.ilIniFile.php';
// get ilias ini file
$this->ilias_ini =& new ilIniFile('./ilias.ini.php');
$this->ilias_ini->read();
if(!@file_exists("./".$this->ilias_ini->readVariable('clients','path')."/".$this->getClient()."/client.ini.php"))
{
$this->__setMessageCode('Client');
$this->__setMessage('Client does not exist');
return false;
}
$this->ini =& new ilIniFile("./".$this->ilias_ini->readVariable('clients','path')."/".$this->getClient()."/client.ini.php");
$this->ini->read();
$this->dsn = $this->ini->readVariable("db","type").
"://".$this->ini->readVariable("db", "user").
":".$this->ini->readVariable("db", "pass").
"@".$this->ini->readVariable("db", "host").
"/".$this->ini->readVariable("db", "name");
return true;
}
Here is the call graph for this function:
Here is the caller graph for this function:| ilBaseAuthentication::__getAuthStatus | ( | ) |
Definition at line 336 of file class.ilBaseAuthentication.php.
References __setMessage(), and __setMessageCode().
Referenced by ilSoapAuthentication::authenticate(), and authenticate().
{
switch($this->auth->getStatus())
{
case AUTH_EXPIRED:
$this->__setMessageCode('Server');
$this->__setMessage('Session expired');
return false;
case AUTH_IDLED:
$this->__setMessageCode('Server');
$this->__setMessage('Session idled');
return false;
case AUTH_WRONG_LOGIN:
default:
$this->__setMessageCode('Client');
$this->__setMessage('Wrong Login or Password');
return false;
}
}
Here is the call graph for this function:
Here is the caller graph for this function:| ilBaseAuthentication::__setMessage | ( | $ | a_message | ) |
Definition at line 129 of file class.ilBaseAuthentication.php.
Referenced by __buildDSN(), ilSoapAuthentication::__checkAgreement(), __getAuthStatus(), __setSessionSaveHandler(), ilSoapAuthentication::authenticate(), authenticate(), ilBaseAuthentication(), logout(), start(), ilSoapAuthentication::validateSession(), and validateSession().
{
$this->message = $a_message;
}
Here is the caller graph for this function:| ilBaseAuthentication::__setMessageCode | ( | $ | a_message_code | ) |
Definition at line 133 of file class.ilBaseAuthentication.php.
Referenced by __buildDSN(), __getAuthStatus(), __setSessionSaveHandler(), ilSoapAuthentication::authenticate(), ilBaseAuthentication(), ilSoapAuthentication::ilSoapAuthentication(), and ilSoapAuthentication::validateSession().
{
$this->message_code = $a_message_code;
}
Here is the caller graph for this function:| ilBaseAuthentication::__setSessionSaveHandler | ( | ) |
Definition at line 311 of file class.ilBaseAuthentication.php.
References $GLOBALS, __setMessage(), __setMessageCode(), and db_set_save_handler().
Referenced by ilSoapAuthentication::authenticate(), authenticate(), ilSoapAuthentication::validateSession(), and validateSession().
{
include_once './include/inc.db_session_handler.php';
include_once "./Services/Utilities/classes/class.ilUtil.php";
include_once './classes/class.ilErrorHandling.php';
include_once './classes/class.ilDBx.php';
$GLOBALS['ilDB'] =& new ilDBx($this->dsn);
if(ini_get('session.save_handler') != 'user')
{
ini_set("session.save_handler", "user");
}
if(!db_set_save_handler())
{
$this->__setMessageCode('Server');
$this->__setMessage('Cannot set session handler');
return false;
}
return true;
}
Here is the call graph for this function:
Here is the caller graph for this function:| ilBaseAuthentication::authenticate | ( | ) |
Reimplemented in ilSoapAuthentication.
Definition at line 147 of file class.ilBaseAuthentication.php.
References __buildAuth(), __buildDSN(), __getAuthStatus(), __setMessage(), __setSessionSaveHandler(), getClient(), getUsername(), and setSid().
{
if(!$this->getClient())
{
$this->__setMessage('No client given');
return false;
}
if(!$this->getUsername())
{
$this->__setMessage('No username given');
return false;
}
// Read ilias ini
if(!$this->__buildDSN())
{
return false;
}
if(!$this->__setSessionSaveHandler())
{
return false;
}
if(!$this->__buildAuth())
{
return false;
}
$this->auth->start();
if(!$this->auth->getAuth())
{
$this->__getAuthStatus();
return false;
}
$this->setSid(session_id());
return true;
}
Here is the call graph for this function:| ilBaseAuthentication::getClient | ( | ) |
Definition at line 89 of file class.ilBaseAuthentication.php.
Referenced by __buildDSN(), ilSoapAuthentication::authenticate(), authenticate(), logout(), ilSoapAuthentication::validateSession(), and validateSession().
{
return $this->client;
}
Here is the caller graph for this function:| ilBaseAuthentication::getMessage | ( | ) |
Definition at line 121 of file class.ilBaseAuthentication.php.
{
return $this->message;
}
| ilBaseAuthentication::getMessageCode | ( | ) |
Definition at line 125 of file class.ilBaseAuthentication.php.
{
return $this->message_code;
}
| ilBaseAuthentication::getPassword | ( | ) |
Definition at line 107 of file class.ilBaseAuthentication.php.
{
return $this->password;
}
| ilBaseAuthentication::getPasswordType | ( | ) |
Definition at line 142 of file class.ilBaseAuthentication.php.
Referenced by __buildAuth().
{
return isset($this->password_type) ? $this->password_type : IL_AUTH_PLAIN;
}
Here is the caller graph for this function:| ilBaseAuthentication::getSid | ( | ) |
Definition at line 116 of file class.ilBaseAuthentication.php.
Referenced by logout(), start(), ilSoapAuthentication::validateSession(), and validateSession().
{
return $this->sid;
}
Here is the caller graph for this function:| ilBaseAuthentication::getUsername | ( | ) |
Definition at line 98 of file class.ilBaseAuthentication.php.
Referenced by ilSoapAuthentication::__checkAgreement(), ilSoapAuthentication::authenticate(), and authenticate().
{
return $this->username;
}
Here is the caller graph for this function:| ilBaseAuthentication::ilBaseAuthentication | ( | ) |
Definition at line 75 of file class.ilBaseAuthentication.php.
References __setMessage(), and __setMessageCode().
Referenced by ilCronAuthentication::ilCronAuthentication(), and ilSoapAuthentication::ilSoapAuthentication().
{
$this->__setMessage('');
$this->__setMessageCode('Client');
$this->check_setting = true;
}
Here is the call graph for this function:
Here is the caller graph for this function:| ilBaseAuthentication::logout | ( | ) |
Definition at line 232 of file class.ilBaseAuthentication.php.
References __setMessage(), getClient(), and getSid().
{
if(!$this->getClient())
{
$this->__setMessage('No client given');
return false;
}
if(!$this->getSid())
{
$this->__setMessage('No session id given');
return false;
}
// logged auth users are authenticated
// No preperations are required
#if(!$this->__buildAuth())
#{
# return false;
#}
#if(!$this->__setSessionSaveHandler())
#{
# return false;
#}
// And finally logout
#$this->auth->start();
$this->auth->logout();
session_destroy();
return true;
}
Here is the call graph for this function:| ilBaseAuthentication::setClient | ( | $ | a_client | ) |
Definition at line 84 of file class.ilBaseAuthentication.php.
{
$this->client = $a_client;
$_COOKIE['ilClientId'] = $a_client;
}
| ilBaseAuthentication::setPassword | ( | $ | a_password | ) |
Definition at line 102 of file class.ilBaseAuthentication.php.
{
$this->password = $a_password;
$_POST['password'] = $a_password;
}
| ilBaseAuthentication::setPasswordType | ( | $ | a_type | ) |
Definition at line 138 of file class.ilBaseAuthentication.php.
{
$this->password_type = $a_type;
}
| ilBaseAuthentication::setSid | ( | $ | a_sid | ) |
Definition at line 111 of file class.ilBaseAuthentication.php.
Referenced by ilSoapAuthentication::authenticate(), and authenticate().
{
$this->sid = $a_sid;
$_COOKIE['PHPSESSID'] = $this->sid;
}
Here is the caller graph for this function:| ilBaseAuthentication::setUsername | ( | $ | a_username | ) |
Definition at line 93 of file class.ilBaseAuthentication.php.
{
$this->username = $a_username;
$_POST['username'] = $a_username;
}
| ilBaseAuthentication::start | ( | ) |
Definition at line 186 of file class.ilBaseAuthentication.php.
References __setMessage(), and getSid().
{
if(!$this->getSid())
{
$this->__setMessage('No session id given');
return false;
}
$this->auth->start();
return true;
}
Here is the call graph for this function:| ilBaseAuthentication::validateSession | ( | ) |
Reimplemented in ilSoapAuthentication.
Definition at line 199 of file class.ilBaseAuthentication.php.
References __buildAuth(), __setMessage(), __setSessionSaveHandler(), getClient(), and getSid().
{
if(!$this->getClient())
{
$this->__setMessage('No client given');
return false;
}
if(!$this->getSid())
{
$this->__setMessage('No session id given');
return false;
}
if(!$this->__buildAuth())
{
return false;
}
if(!$this->__setSessionSaveHandler())
{
return false;
}
$this->auth->start();
if(!$this->auth->getAuth())
{
$this->__setMessage('Session not valid');
return false;
}
return true;
}
Here is the call graph for this function:| ilBaseAuthentication::$auth = null |
Definition at line 46 of file class.ilBaseAuthentication.php.
| ilBaseAuthentication::$client = '' |
Definition at line 73 of file class.ilBaseAuthentication.php.
| ilBaseAuthentication::$password = '' |
Definition at line 66 of file class.ilBaseAuthentication.php.
| ilBaseAuthentication::$sid = '' |
Definition at line 54 of file class.ilBaseAuthentication.php.
| ilBaseAuthentication::$username = '' |
Definition at line 60 of file class.ilBaseAuthentication.php.
1.7.1