ILIAS  release_5-0 Revision 5.0.0-1144-gc4397b1f870
All Data Structures Namespaces Files Functions Variables Modules Pages
ilSoapAuthentication Class Reference
+ Inheritance diagram for ilSoapAuthentication:
+ Collaboration diagram for ilSoapAuthentication:

Public Member Functions

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

 $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.

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 115 of file class.ilSoapAuthentication.php.

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

Referenced by authenticate().

116  {
117  include_once('./Services/User/classes/class.ilObjUser.php');
118  include_once('./Services/Administration/classes/class.ilSetting.php');
119 
120  $GLOBALS['ilSetting'] = new ilSetting();
121 
122  if(!$login = ilObjUser::_checkExternalAuthAccount($a_auth_mode,$this->getUsername()))
123  {
124  return true;
125  }
126 
127  if(ilObjUser::hasUserToAcceptTermsOfService($login))
128  {
129  $this->__setMessage('User agreement no accepted.');
130  return false;
131  }
132 
133  return true;
134  }
ILIAS Setting Class.
$GLOBALS['ct_recipient']
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 209 of file class.ilSoapAuthentication.php.

Referenced by validateSession().

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

◆ __checkSOAPEnabled()

ilSoapAuthentication::__checkSOAPEnabled ( )

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

References $GLOBALS, and $ilDB.

Referenced by authenticate(), and validateSession().

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

◆ authenticate()

ilSoapAuthentication::authenticate ( )

Definition at line 55 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().

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

◆ disableSoapCheck()

ilSoapAuthentication::disableSoapCheck ( )

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

51  {
52  $this->soap_check = false;
53  }

◆ ilSoapAuthentication()

ilSoapAuthentication::ilSoapAuthentication ( )

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

References $_COOKIE, and ilBaseAuthentication\__setMessageCode().

42  {
43  // First unset all cookie inforamtions
44  unset($_COOKIE['PHPSESSID']);
45 
46  parent::ilBaseAuthentication();
47  $this->__setMessageCode('Client');
48  }
$_COOKIE["ilClientId"]
Definition: cron.php:11
+ Here is the call graph for this function:

◆ validateSession()

ilSoapAuthentication::validateSession ( )

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

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

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