ILIAS  release_5-2 Revision v5.2.25-18-g3f80b828510
ilSoapAuthentication Class Reference
+ Inheritance diagram for ilSoapAuthentication:
+ Collaboration diagram for ilSoapAuthentication:

Public Member Functions

 __construct ()
 Constructor. More...
 
 disableSoapCheck ()
 
 authenticate ()
 
 validateSession ()
 
 __checkSOAPEnabled ()
 
 __checkClientEnabled ()
 
- Public Member Functions inherited from ilBaseAuthentication
 __construct ()
 
 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

 $soap_check = true
 
- Data Fields inherited from ilBaseAuthentication
 $auth = null
 
 $sid = ''
 
 $username = ''
 
 $password = ''
 
 $client = ''
 

Protected Member Functions

 __checkAgreement ($a_auth_mode)
 Check if user agreement is accepted. More...
 

Detailed Description

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

Constructor & Destructor Documentation

◆ __construct()

ilSoapAuthentication::__construct ( )

Constructor.

Definition at line 44 of file class.ilSoapAuthentication.php.

References $_COOKIE, and ilBaseAuthentication\__setMessageCode().

45  {
46  // First unset all cookie inforamtions
47  unset($_COOKIE['PHPSESSID']);
48 
49  parent::__construct();
50  $this->__setMessageCode('Client');
51  }
$_COOKIE['ilClientId']
Definition: BPMN2Parser.php:15
+ Here is the call graph for this function:

Member Function Documentation

◆ __checkAgreement()

ilSoapAuthentication::__checkAgreement (   $a_auth_mode)
protected

Check if user agreement is accepted.

protected

Parameters
stringauth_mode local,ldap or cas

Definition at line 118 of file class.ilSoapAuthentication.php.

References $GLOBALS, ilBaseAuthentication\__setMessage(), ilObjUser\_checkExternalAuthAccount(), and ilBaseAuthentication\getUsername().

Referenced by authenticate().

119  {
120  include_once('./Services/User/classes/class.ilObjUser.php');
121  include_once('./Services/Administration/classes/class.ilSetting.php');
122 
123  $GLOBALS['ilSetting'] = new ilSetting();
124 
125  if(!$login = ilObjUser::_checkExternalAuthAccount($a_auth_mode,$this->getUsername()))
126  {
127  return true;
128  }
129 
130  if(ilObjUser::hasUserToAcceptTermsOfService($login))
131  {
132  $this->__setMessage('User agreement no accepted.');
133  return false;
134  }
135 
136  return true;
137  }
ILIAS Setting Class.
$GLOBALS['loaded']
Global hash that tracks already loaded includes.
static _checkExternalAuthAccount($a_auth, $a_account)
check whether external account and authentication method matches with a user
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ __checkClientEnabled()

ilSoapAuthentication::__checkClientEnabled ( )

Definition at line 212 of file class.ilSoapAuthentication.php.

Referenced by validateSession().

213  {
214  if(is_object($this->ini) and $this->ini->readVariable('client','access'))
215  {
216  return true;
217  }
218  return false;
219  }
+ Here is the caller graph for this function:

◆ __checkSOAPEnabled()

ilSoapAuthentication::__checkSOAPEnabled ( )

Definition at line 192 of file class.ilSoapAuthentication.php.

References $GLOBALS, and $ilDB.

Referenced by authenticate(), and validateSession().

193  {
194  include_once './Services/Database/classes/MDB2/class.ilDB.php';
195 
196  //$db = new ilDB($this->dsn);
197  $ilDB = $this->db;
198  $ilDB->connect();
199 
200  $GLOBALS["ilDB"] = $ilDB;
201  include_once './Services/Administration/classes/class.ilSetting.php';
202  $set = new ilSetting();
203  return ($set->get("soap_user_administration") == 1);
204 
205  /*$query = "SELECT * FROM set tings WHERE keyword = 'soap_user_administration' AND value = 1";
206 
207  $res = $db->query($query);
208 
209  return $res->numRows() ? true : false;*/
210  }
ILIAS Setting Class.
$GLOBALS['loaded']
Global hash that tracks already loaded includes.
global $ilDB
+ Here is the caller graph for this function:

◆ authenticate()

ilSoapAuthentication::authenticate ( )

Definition at line 58 of file class.ilSoapAuthentication.php.

References ilBaseAuthentication\__buildAuth(), ilBaseAuthentication\__buildDSN(), __checkAgreement(), __checkSOAPEnabled(), ilBaseAuthentication\__getAuthStatus(), ilBaseAuthentication\__setMessage(), ilBaseAuthentication\__setMessageCode(), ilBaseAuthentication\__setSessionSaveHandler(), ilBaseAuthentication\getClient(), ilBaseAuthentication\getUsername(), and ilBaseAuthentication\setSid().

59  {
60  if(!$this->getClient())
61  {
62  $this->__setMessage('No client given');
63  return false;
64  }
65  if(!$this->getUsername())
66  {
67  $this->__setMessage('No username given');
68  return false;
69  }
70  // Read ilias ini
71  if(!$this->__buildDSN())
72  {
73  $this->__setMessage('Error building dsn/Wrong client Id?');
74  return false;
75  }
76  if(!$this->__setSessionSaveHandler())
77  {
78  return false;
79  }
80  if(!$this->__checkAgreement('local'))
81  {
82  return false;
83  }
84  if(!$this->__buildAuth())
85  {
86  return false;
87  }
88  if($this->soap_check and !$this->__checkSOAPEnabled())
89  {
90  $this->__setMessage('SOAP is not enabled in ILIAS administration for this client');
91  $this->__setMessageCode('Server');
92 
93  return false;
94  }
95 
96 
97  $this->auth->start();
98 
99  if(!$this->auth->getAuth())
100  {
101  $this->__getAuthStatus();
102 
103  return false;
104  }
105 
106  $this->setSid(session_id());
107 
108  return true;
109  }
__checkAgreement($a_auth_mode)
Check if user agreement is accepted.
+ Here is the call graph for this function:

◆ disableSoapCheck()

ilSoapAuthentication::disableSoapCheck ( )

Definition at line 53 of file class.ilSoapAuthentication.php.

54  {
55  $this->soap_check = false;
56  }

◆ validateSession()

ilSoapAuthentication::validateSession ( )

Definition at line 141 of file class.ilSoapAuthentication.php.

References ilBaseAuthentication\__buildAuth(), ilBaseAuthentication\__buildDSN(), __checkClientEnabled(), __checkSOAPEnabled(), ilBaseAuthentication\__setMessage(), ilBaseAuthentication\__setMessageCode(), ilBaseAuthentication\__setSessionSaveHandler(), ilBaseAuthentication\getClient(), and ilBaseAuthentication\getSid().

142  {
143  if(!$this->getClient())
144  {
145  $this->__setMessage('No client given');
146  return false;
147  }
148  if(!$this->getSid())
149  {
150  $this->__setMessage('No session id given');
151  return false;
152  }
153 
154  if(!$this->__buildDSN())
155  {
156  $this->__setMessage('Error building dsn');
157  return false;
158  }
159  if(!$this->__checkClientEnabled())
160  {
161  $this->__setMessage('Client disabled.');
162  return false;
163  }
164 
165  if(!$this->__setSessionSaveHandler())
166  {
167  return false;
168  }
169  if(!$this->__buildAuth())
170  {
171  return false;
172  }
173  if($this->soap_check and !$this->__checkSOAPEnabled())
174  {
175  $this->__setMessage('SOAP is not enabled in ILIAS administration for this client');
176  $this->__setMessageCode('Server');
177 
178  return false;
179  }
180  $this->auth->start();
181  if(!$this->auth->getAuth())
182  {
183  $this->__setMessage('Session not valid');
184 
185  return false;
186  }
187 
188  return true;
189  }
+ Here is the call graph for this function:

Field Documentation

◆ $soap_check

ilSoapAuthentication::$soap_check = true

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


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