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) | |
| authenticate () | |
| start () | |
| validateSession () | |
| logout () | |
| __buildAuth () | |
| __setSessionSaveHandler () | |
| __getAuthStatus () | |
Data Fields | |
| $auth = null | |
| $sid = '' | |
| $username = '' | |
| $password = '' | |
| $client = '' | |
Definition at line 37 of file class.ilBaseAuthentication.php.
| ilBaseAuthentication::__buildAuth | ( | ) |
Definition at line 249 of file class.ilBaseAuthentication.php.
References __setMessage(), __setMessageCode(), and getClient().
Referenced by ilSoapAuthentication::authenticate(), authenticate(), ilSoapAuthentication::validateSession(), and 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");
$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")
);
$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::__getAuthStatus | ( | ) |
Definition at line 312 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');
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 127 of file class.ilBaseAuthentication.php.
Referenced by __buildAuth(), __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 131 of file class.ilBaseAuthentication.php.
Referenced by __buildAuth(), __getAuthStatus(), __setSessionSaveHandler(), ilSoapAuthentication::authenticate(), ilBaseAuthentication(), ilRADIUSAuthentication::ilRADIUSAuthentication(), ilSoapAuthentication::ilSoapAuthentication(), and ilSoapAuthentication::validateSession().
{
$this->message_code = $a_message_code;
}
Here is the caller graph for this function:| ilBaseAuthentication::__setSessionSaveHandler | ( | ) |
Definition at line 287 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 './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 136 of file class.ilBaseAuthentication.php.
References __buildAuth(), __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->__buildAuth())
{
return false;
}
if(!$this->__setSessionSaveHandler())
{
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 87 of file class.ilBaseAuthentication.php.
Referenced by __buildAuth(), ilSoapAuthentication::authenticate(), authenticate(), logout(), ilSoapAuthentication::validateSession(), and validateSession().
{
return $this->client;
}
Here is the caller graph for this function:| ilBaseAuthentication::getMessage | ( | ) |
Definition at line 119 of file class.ilBaseAuthentication.php.
{
return $this->message;
}
| ilBaseAuthentication::getMessageCode | ( | ) |
Definition at line 123 of file class.ilBaseAuthentication.php.
{
return $this->message_code;
}
| ilBaseAuthentication::getPassword | ( | ) |
Definition at line 105 of file class.ilBaseAuthentication.php.
{
return $this->password;
}
| ilBaseAuthentication::getSid | ( | ) |
Definition at line 114 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 96 of file class.ilBaseAuthentication.php.
Referenced by ilSoapAuthentication::authenticate(), and authenticate().
{
return $this->username;
}
Here is the caller graph for this function:| ilBaseAuthentication::ilBaseAuthentication | ( | ) |
Definition at line 73 of file class.ilBaseAuthentication.php.
References __setMessage(), and __setMessageCode().
Referenced by ilCronAuthentication::ilCronAuthentication(), ilRADIUSAuthentication::ilRADIUSAuthentication(), 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 217 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 82 of file class.ilBaseAuthentication.php.
References $_COOKIE.
{
$this->client = $a_client;
$_COOKIE['ilClientId'] = $a_client;
}
| ilBaseAuthentication::setPassword | ( | $ | a_password | ) |
Definition at line 100 of file class.ilBaseAuthentication.php.
References $_POST.
{
$this->password = $a_password;
$_POST['password'] = $a_password;
}
| ilBaseAuthentication::setSid | ( | $ | a_sid | ) |
Definition at line 109 of file class.ilBaseAuthentication.php.
References $_COOKIE.
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 91 of file class.ilBaseAuthentication.php.
References $_POST.
{
$this->username = $a_username;
$_POST['username'] = $a_username;
}
| ilBaseAuthentication::start | ( | ) |
Definition at line 171 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 184 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 44 of file class.ilBaseAuthentication.php.
| ilBaseAuthentication::$client = '' |
Definition at line 71 of file class.ilBaseAuthentication.php.
| ilBaseAuthentication::$password = '' |
Definition at line 64 of file class.ilBaseAuthentication.php.
| ilBaseAuthentication::$sid = '' |
Definition at line 52 of file class.ilBaseAuthentication.php.
| ilBaseAuthentication::$username = '' |
Definition at line 58 of file class.ilBaseAuthentication.php.
1.7.1