ILIAS  release_5-3 Revision v5.3.23-19-g915713cf615
ilSoapAuthentication Class Reference
+ Inheritance diagram for ilSoapAuthentication:
+ Collaboration diagram for ilSoapAuthentication:

Public Member Functions

 __construct ()
 Constructor. More...
 
 disableSoapCheck ()
 
 authenticate ()
 
 validateSession ()
 
 __checkSOAPEnabled ()
 
 __checkClientEnabled ()
 

Data Fields

 $soap_check = true
 

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.

45 {
46 // First unset all cookie inforamtions
47 unset($_COOKIE['PHPSESSID']);
48
49 parent::__construct();
50 $this->__setMessageCode('Client');
51 }
$_COOKIE['client_id']
Definition: server.php:9

References $_COOKIE.

Member Function Documentation

◆ __checkAgreement()

ilSoapAuthentication::__checkAgreement (   $a_auth_mode)
protected

Check if user agreement is accepted.

@access protected

Parameters
stringauth_mode local,ldap or cas

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

111 {
112 include_once('./Services/User/classes/class.ilObjUser.php');
113 include_once('./Services/Administration/classes/class.ilSetting.php');
114
115 $GLOBALS['ilSetting'] = new ilSetting();
116
117 if (!$login = ilObjUser::_checkExternalAuthAccount($a_auth_mode, $this->getUsername())) {
118 return true;
119 }
120
121 if (ilObjUser::hasUserToAcceptTermsOfService($login)) {
122 $this->__setMessage('User agreement no accepted.');
123 return false;
124 }
125
126 return true;
127 }
static _checkExternalAuthAccount($a_auth, $a_account, $tryFallback=true)
check whether external account and authentication method matches with a user
ILIAS Setting Class.
$GLOBALS['loaded']
Global hash that tracks already loaded includes.

References $GLOBALS, and ilObjUser\_checkExternalAuthAccount().

Referenced by authenticate().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ __checkClientEnabled()

ilSoapAuthentication::__checkClientEnabled ( )

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

195 {
196 if (is_object($this->ini) and $this->ini->readVariable('client', 'access')) {
197 return true;
198 }
199 return false;
200 }

Referenced by validateSession().

+ Here is the caller graph for this function:

◆ __checkSOAPEnabled()

ilSoapAuthentication::__checkSOAPEnabled ( )

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

175 {
176 include_once './Services/Database/classes/MDB2/class.ilDB.php';
177
178 //$db = new ilDB($this->dsn);
179 $ilDB = $this->db;
180 $ilDB->connect();
181
182 $GLOBALS["ilDB"] = $ilDB;
183 include_once './Services/Administration/classes/class.ilSetting.php';
184 $set = new ilSetting();
185 return ($set->get("soap_user_administration") == 1);
186
187 /*$query = "SELECT * FROM set tings WHERE keyword = 'soap_user_administration' AND value = 1";
188
189 $res = $db->query($query);
190
191 return $res->numRows() ? true : false;*/
192 }
global $ilDB

References $GLOBALS, and $ilDB.

Referenced by authenticate(), and validateSession().

+ Here is the caller graph for this function:

◆ authenticate()

ilSoapAuthentication::authenticate ( )

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

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

References __checkAgreement(), and __checkSOAPEnabled().

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

132 {
133 if (!$this->getClient()) {
134 $this->__setMessage('No client given');
135 return false;
136 }
137 if (!$this->getSid()) {
138 $this->__setMessage('No session id given');
139 return false;
140 }
141
142 if (!$this->__buildDSN()) {
143 $this->__setMessage('Error building dsn');
144 return false;
145 }
146 if (!$this->__checkClientEnabled()) {
147 $this->__setMessage('Client disabled.');
148 return false;
149 }
150
151 if (!$this->__setSessionSaveHandler()) {
152 return false;
153 }
154 if (!$this->__buildAuth()) {
155 return false;
156 }
157 if ($this->soap_check and !$this->__checkSOAPEnabled()) {
158 $this->__setMessage('SOAP is not enabled in ILIAS administration for this client');
159 $this->__setMessageCode('Server');
160
161 return false;
162 }
163 $this->auth->start();
164 if (!$this->auth->getAuth()) {
165 $this->__setMessage('Session not valid');
166
167 return false;
168 }
169
170 return true;
171 }

References __checkClientEnabled(), and __checkSOAPEnabled().

+ 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: