ILIAS  Release_4_0_x_branch Revision 61816
 All Data Structures Namespaces Files Functions Variables Groups Pages
ilSoapAuthenticationCAS Class Reference
+ Inheritance diagram for ilSoapAuthenticationCAS:
+ Collaboration diagram for ilSoapAuthenticationCAS:

Public Member Functions

 ilSoapAuthenticationCAS ()
 setPT ($a_pt)
 getPT ()
 authenticate ()
 validateSession ()
 __buildAuth ()

Detailed Description

Definition at line 36 of file class.ilSoapAuthenticationCAS.php.

Member Function Documentation

ilSoapAuthenticationCAS::__buildAuth ( )

Definition at line 235 of file class.ilSoapAuthenticationCAS.php.

References $GLOBALS, $ilDB, CAS_VERSION_2_0, ilDBWrapperFactory\getWrapper(), and phpCAS\setFixedServiceURL().

Referenced by authenticate(), and validateSession().

{
if (!is_object($this->db))
{
require_once("./Services/Database/classes/class.ilDBWrapperFactory.php");
$ilDB->initFromIniFile();
$ilDB->connect();
$this->db = $ilDB;
}
$GLOBALS["ilDB"] = $this->db;
$this->init->initSettings();
$this->init->buildHTTPPath();
include_once './Services/Administration/classes/class.ilSetting.php';
$set = new ilSetting();
/*$query = "SELECT * FROM sett ings WHERE ".
" keyword = ".$this->db->quote("cas_server")." OR ".
" keyword = ".$this->db->quote("cas_port")." OR ".
" keyword = ".$this->db->quote("cas_uri");
$res = $this->db->query($query);
$cas_set = array();
while ($rec = $res->fetchRow(DB_FETCHMODE_ASSOC))
{
$cas_set[$rec["keyword"]] = $rec["value"];
}*/
$cas_set["cas_server"] = $set->get("cas_server");
$cas_set["cas_port"] = $set->get("cas_port");
$cas_set["cas_uri"] = $set->get("cas_uri");
$auth_params = array(
"server_version" => CAS_VERSION_2_0,
"server_hostname" => $cas_set["cas_server"],
"server_port" => $cas_set["cas_port"],
"server_uri" => $cas_set["cas_uri"]);
include_once("Services/CAS/classes/class.ilCASAuth.php");
$this->auth = new ilCASAuth($auth_params);
// HTTP path will return full path to server.php directory
phpCAS::setFixedServiceURL(ILIAS_HTTP_PATH."/webservice/soap/server.php");
return true;
}

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

ilSoapAuthenticationCAS::authenticate ( )

Definition at line 89 of file class.ilSoapAuthenticationCAS.php.

References __buildAuth(), ilObjUser\_checkExternalAuthAccount(), and phpCAS\checkAuthentication().

{
include_once("./Services/Init/classes/class.ilInitialisation.php");
$this->init = new ilInitialisation();
$this->init->requireCommonIncludes();
//$init->initSettings();
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())
{
$this->__setMessage('Error building dsn/Wrong client Id?');
return false;
}
if(!$this->__setSessionSaveHandler())
{
return false;
}
if(!$this->__checkAgreement('cas'))
{
return false;
}
if(!$this->__buildAuth())
{
return false;
}
if($this->soap_check and !$this->__checkSOAPEnabled())
{
$this->__setMessage('SOAP is not enabled in ILIAS administration for this client');
$this->__setMessageCode('Server');
return false;
}
// check whether authentication is valid
//if (!$this->auth->checkCASAuth())
{
$this->__setMessage('ilSOAPAuthenticationCAS::authenticate(): No valid CAS authentication.');
return false;
}
$this->auth->forceCASAuth();
if ($this->getUsername() != $this->auth->getCASUser())
{
$this->__setMessage('ilSOAPAuthenticationCAS::authenticate(): SOAP CAS user does not match to ticket user.');
return false;
}
include_once('./Services/User/classes/class.ilObjUser.php');
$local_user = ilObjUser::_checkExternalAuthAccount("cas", $this->auth->getCASUser());
if ($local_user == "")
{
$this->__setMessage('ilSOAPAuthenticationCAS::authenticate(): SOAP CAS user authenticated but not existing in ILIAS user database.');
return false;
}
/*
$init->initIliasIniFile();
$init->initSettings();
$ilias =& new ILIAS();
$GLOBALS['ilias'] =& $ilias;*/
$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:

ilSoapAuthenticationCAS::getPT ( )

Definition at line 84 of file class.ilSoapAuthenticationCAS.php.

{
return $this->pt;
}
ilSoapAuthenticationCAS::ilSoapAuthenticationCAS ( )

Definition at line 38 of file class.ilSoapAuthenticationCAS.php.

{
parent::ilSOAPAuthentication();
}
ilSoapAuthenticationCAS::setPT (   $a_pt)

Definition at line 79 of file class.ilSoapAuthenticationCAS.php.

References $_GET.

{
$this->pt = $a_pt;
$_GET['ticket'] = $a_pt;
}
ilSoapAuthenticationCAS::validateSession ( )

Definition at line 182 of file class.ilSoapAuthenticationCAS.php.

References __buildAuth().

{
if(!$this->getClient())
{
$this->__setMessage('No client given');
return false;
}
if(!$this->getSid())
{
$this->__setMessage('No session id given');
return false;
}
if(!$this->__buildDSN())
{
$this->__setMessage('Error building dsn');
return false;
}
if(!$this->__setSessionSaveHandler())
{
return false;
}
if(!$this->__buildAuth())
{
return false;
}
if($this->soap_check and !$this->__checkSOAPEnabled())
{
$this->__setMessage('SOAP is not enabled in ILIAS administration for this client');
$this->__setMessageCode('Server');
return false;
}
// check whether authentication is valid
if (!$this->auth->checkCASAuth())
{
$this->__setMessage('ilSOAPAuthenticationCAS::authenticate(): No valid CAS authentication.');
return false;
}
$this->auth->forceCASAuth();
$this->auth->start();
if(!$this->auth->getAuth())
{
$this->__setMessage('Session not valid');
return false;
}
return true;
}

+ Here is the call graph for this function:


The documentation for this class was generated from the following file: