ILIAS  release_4-4 Revision
Auth_Container_SOAP Class Reference
+ Inheritance diagram for Auth_Container_SOAP:
+ Collaboration diagram for Auth_Container_SOAP:

Public Member Functions

 Auth_Container_SOAP ($options)
 Constructor of the container class. More...
 
 fetchData ($username, $password)
 Fetch data from SOAP service. 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()
 
 $soapClient = null
 
- 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 90 of file SOAP.php.

Member Function Documentation

◆ Auth_Container_SOAP()

Auth_Container_SOAP::Auth_Container_SOAP (   $options)

Constructor of the container class.

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

Definition at line 146 of file SOAP.php.

References $options.

147  {
148  $this->_options = $options;
149  if (!isset($this->_options['matchpasswords'])) {
150  $this->_options['matchpasswords'] = true;
151  }
152  if (!empty($this->_options['_features'])) {
153  $this->_features = $this->_options['_features'];
154  unset($this->_options['_features']);
155  }
156  }
if(!is_array($argv)) $options

◆ fetchData()

Auth_Container_SOAP::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 171 of file SOAP.php.

References AUTH_LOG_DEBUG, PEAR\isError(), and Auth_Container\log().

172  {
173  $this->log('Auth_Container_SOAP::fetchData() called.', AUTH_LOG_DEBUG);
174  // check if all required options are set
175  if (array_intersect($this->_requiredOptions, array_keys($this->_options)) != $this->_requiredOptions) {
176  return false;
177  } else {
178  // create a SOAP client and set encoding
179  $this->soapClient = new SOAP_Client($this->_options['endpoint']);
180  $this->soapClient->setEncoding($this->_options['encoding']);
181  }
182 
183  // set the trace option if requested
184  if (isset($this->_options['trace'])) {
185  $this->soapClient->__options['trace'] = true;
186  }
187 
188  // set the timeout option if requested
189  if (isset($this->_options['timeout'])) {
190  $this->soapClient->__options['timeout'] = $this->_options['timeout'];
191  }
192 
193  // assign username and password fields
194  $usernameField = new SOAP_Value($this->_options['usernamefield'],'string', $username);
195  $passwordField = new SOAP_Value($this->_options['passwordfield'],'string', $password);
196  $SOAPParams = array($usernameField, $passwordField);
197 
198  // assign optional features
199  foreach ($this->_features as $fieldName => $fieldValue) {
200  $SOAPParams[] = new SOAP_Value($fieldName, 'string', $fieldValue);
201  }
202 
203  // make SOAP call
204  $this->soapResponse = $this->soapClient->call(
205  $this->_options['method'],
206  $SOAPParams,
207  array('namespace' => $this->_options['namespace'])
208  );
209 
210  if (!PEAR::isError($this->soapResponse)) {
211  if ($this->_options['matchpasswords']) {
212  // check if passwords match
213  if ($password == $this->soapResponse->{$this->_options['passwordfield']}) {
214  return true;
215  } else {
216  return false;
217  }
218  } else {
219  return true;
220  }
221  } else {
222  return false;
223  }
224  }
const AUTH_LOG_DEBUG
Auth Log level - DEBUG.
Definition: Auth.php:59
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
+ Here is the call graph for this function:

Field Documentation

◆ $_features

Auth_Container_SOAP::$_features = array()

Definition at line 121 of file SOAP.php.

◆ $_options

Auth_Container_SOAP::$_options = array()

Definition at line 114 of file SOAP.php.

◆ $_requiredOptions

Auth_Container_SOAP::$_requiredOptions
Initial value:
= array(
'endpoint',
'namespace',
'method',
'encoding',
'usernamefield',
'passwordfield',
)

Definition at line 100 of file SOAP.php.

◆ $soapClient

Auth_Container_SOAP::$soapClient = null

Definition at line 135 of file SOAP.php.

◆ $soapResponse

Auth_Container_SOAP::$soapResponse = array()

Definition at line 128 of file SOAP.php.


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