ILIAS  release_5-1 Revision 5.0.0-5477-g43f3e3fab5f
Auth_Container_SOAP5 Class Reference
+ Inheritance diagram for Auth_Container_SOAP5:
+ Collaboration diagram for Auth_Container_SOAP5:

Public Member Functions

 Auth_Container_SOAP5 ($options)
 Constructor of the container class. More...
 
 fetchData ($username, $password)
 Fetch data from SOAP service. More...
 
 _validateOptions ()
 Validate that the options passed to the container class are enough for us to proceed. More...
 
 _setDefaults ()
 Set some default options. More...
 
- Public Member Functions inherited from Auth_Container
 Auth_Container ()
 Constructor. More...
 
 fetchData ($username, $password, $isChallengeResponse=false)
 Fetch data from storage container. More...
 
 verifyPassword ($password1, $password2, $cryptType="md5")
 Crypt and verfiy the entered password. More...
 
 supportsChallengeResponse ()
 Returns true if the container supports Challenge Response password authentication. More...
 
 getCryptType ()
 Returns the crypt current crypt type of the container. More...
 
 listUsers ()
 List all users that are available from the storage container. More...
 
 getUser ($username)
 Returns a user assoc array. More...
 
 addUser ($username, $password, $additional=null)
 Add a new user to the storage container. More...
 
 removeUser ($username)
 Remove user from the storage container. More...
 
 changePassword ($username, $password)
 Change password for user in the storage container. More...
 
 log ($message, $level=AUTH_LOG_DEBUG)
 Log a message to the Auth log. More...
 
- Public Member Functions inherited from ilAuthContainerBase
 loginObserver ($a_username, $a_auth)
 Called after successful login. More...
 
 failedLoginObserver ($a_username, $a_auth)
 Called after failed login. More...
 
 checkAuthObserver ($a_username, $a_auth)
 Called after check auth requests. More...
 
 logoutObserver ($a_username, $a_auth)
 Called after logout. More...
 
 supportsCaptchaVerification ()
 Returns whether or not the auth container supports the verification of captchas This should be true for those auth methods, which are available in the default login form. More...
 

Data Fields

 $_requiredOptions
 
 $_options = array()
 
 $_features = array()
 
 $soapResponse = array()
 
- Data Fields inherited from Auth_Container
 $activeUser = ""
 User that is currently selected from the storage container. More...
 
 $_auth_obj = null
 The Auth object this container is attached to. More...
 

Detailed Description

Definition at line 107 of file SOAP5.php.

Member Function Documentation

◆ _setDefaults()

Auth_Container_SOAP5::_setDefaults ( )

Set some default options.

@access private

Returns
void

Definition at line 254 of file SOAP5.php.

255 {
256 $this->_options['wsdl'] = null;
257 $this->_options['location'] = null;
258 $this->_options['uri'] = null;
259 $this->_options['method'] = null;
260 $this->_options['usernamefield'] = 'username';
261 $this->_options['passwordfield'] = 'password';
262 $this->_options['matchpasswords'] = true;
263 }

Referenced by Auth_Container_SOAP5().

+ Here is the caller graph for this function:

◆ _validateOptions()

Auth_Container_SOAP5::_validateOptions ( )

Validate that the options passed to the container class are enough for us to proceed.

@access private

Parameters
array

Definition at line 229 of file SOAP5.php.

230 {
231 if ( ( is_null($this->_options['wsdl'])
232 && is_null($this->_options['location'])
233 && is_null($this->_options['uri']))
234 || ( is_null($this->_options['wsdl'])
235 && ( is_null($this->_options['location'])
236 || is_null($this->_options['uri'])))) {
237 return PEAR::raiseError('Either a WSDL file or a location/uri pair must be specified.');
238 }
239 if (is_null($this->_options['method'])) {
240 return PEAR::raiseError('A method to call on the soap service must be specified.');
241 }
242 return true;
243 }
& raiseError($message=null, $code=null, $mode=null, $options=null, $userinfo=null, $error_class=null, $skipmsg=false)
This method is a wrapper that returns an instance of the configured error class with this object's de...
Definition: PEAR.php:524

References PEAR\raiseError().

Referenced by fetchData().

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

◆ Auth_Container_SOAP5()

Auth_Container_SOAP5::Auth_Container_SOAP5 (   $options)

Constructor of the container class.

Parameters
$options,associativearray with endpoint, namespace, method, usernamefield, passwordfield and optional features

Definition at line 156 of file SOAP5.php.

157 {
158 $this->_setDefaults();
159
160 foreach ($options as $name => $value) {
161 $this->_options[$name] = $value;
162 }
163
164 if (!empty($this->_options['_features'])) {
165 $this->_features = $this->_options['_features'];
166 unset($this->_options['_features']);
167 }
168 }
_setDefaults()
Set some default options.
Definition: SOAP5.php:254
if(!is_array($argv)) $options

References $options, and _setDefaults().

+ Here is the call graph for this function:

◆ fetchData()

Auth_Container_SOAP5::fetchData (   $username,
  $password 
)

Fetch data from SOAP service.

Requests the SOAP service for the given username/password combination.

Parameters
stringUsername
stringPassword
Returns
mixed Returns the SOAP response or false if something went wrong

Definition at line 183 of file SOAP5.php.

184 {
185 $this->log('Auth_Container_SOAP5::fetchData() called.', AUTH_LOG_DEBUG);
186 $result = $this->_validateOptions();
188 return $result;
189
190 // create a SOAP client
191 $soapClient = new SoapClient($this->_options["wsdl"], $this->_options);
192
193 $params = array();
194 // first, assign the optional features
195 foreach ($this->_features as $fieldName => $fieldValue) {
196 $params[$fieldName] = $fieldValue;
197 }
198 // assign username and password ...
199 $params[$this->_options['usernamefield']] = $username;
200 $params[$this->_options['passwordfield']] = $password;
201
202 try {
203 $this->soapResponse = $soapClient->__soapCall($this->_options['method'], $params);
204
205 if ($this->_options['matchpasswords']) {
206 // check if passwords match
207 if ($password == $this->soapResponse[$this->_options['passwordfield']]) {
208 return true;
209 } else {
210 return false;
211 }
212 } else {
213 return true;
214 }
215 } catch (SoapFault $e) {
216 return PEAR::raiseError("Error retrieving authentication data. Received SOAP Fault: ".$e->faultstring, $e->faultcode);
217 }
218 }
const AUTH_LOG_DEBUG
Auth Log level - DEBUG.
Definition: Auth.php:59
$result
_validateOptions()
Validate that the options passed to the container class are enough for us to proceed.
Definition: SOAP5.php:229
log($message, $level=AUTH_LOG_DEBUG)
Log a message to the Auth log.
Definition: Container.php:246
isError($data, $code=null)
Tell whether a value is a PEAR error.
Definition: PEAR.php:279
$params
Definition: example_049.php:96

References $params, $result, _validateOptions(), AUTH_LOG_DEBUG, PEAR\isError(), Auth_Container\log(), and PEAR\raiseError().

+ Here is the call graph for this function:

Field Documentation

◆ $_features

Auth_Container_SOAP5::$_features = array()

Definition at line 138 of file SOAP5.php.

◆ $_options

Auth_Container_SOAP5::$_options = array()

Definition at line 131 of file SOAP5.php.

◆ $_requiredOptions

Auth_Container_SOAP5::$_requiredOptions
Initial value:
= array(
'location',
'uri',
'method',
'usernamefield',
'passwordfield',
'wsdl',
)

Definition at line 117 of file SOAP5.php.

◆ $soapResponse

Auth_Container_SOAP5::$soapResponse = array()

Definition at line 145 of file SOAP5.php.


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