{
if (array_intersect($this->_requiredOptions, array_keys($this->_options)) != $this->_requiredOptions) {
return false;
} else {
$this->soapClient = new SOAP_Client($this->_options['endpoint']);
$this->soapClient->setEncoding($this->_options['encoding']);
}
if (isset($this->_options['trace'])) {
$this->soapClient->__options['trace'] = true;
}
if (isset($this->_options['timeout'])) {
$this->soapClient->__options['timeout'] = $this->_options['timeout'];
}
$usernameField = new SOAP_Value($this->_options['usernamefield'],'string', $username);
$passwordField = new SOAP_Value($this->_options['passwordfield'],'string', $password);
$SOAPParams = array($usernameField, $passwordField);
foreach ($this->_features as $fieldName => $fieldValue) {
$SOAPParams[] = new SOAP_Value($fieldName, 'string', $fieldValue);
}
$this->soapResponse = $this->soapClient->call(
$this->_options['method'],
$SOAPParams,
array('namespace' => $this->_options['namespace'])
);
if ($this->_options['matchpasswords']) {
if ($password == $this->soapResponse->{$this->_options['passwordfield']}) {
return true;
} else {
return false;
}
} else {
return true;
}
} else {
return false;
}
}