43        $this->logger = 
$DIC->logger()->auth();
 
   44        $this->language = 
$DIC->language();
 
   45        $this->rbacAdmin = 
$DIC->rbac()->admin();
 
   55        $this->server_host = (string) $this->
settings->get(
'soap_auth_server', 
'');
 
   56        $this->server_port = (string) $this->
settings->get(
'soap_auth_port', 
'');
 
   57        $this->server_uri = (string) $this->
settings->get(
'soap_auth_uri', 
'');
 
   58        $this->server_nms = (string) $this->
settings->get(
'soap_auth_namespace', 
'');
 
   59        $this->server_https = (bool) $this->
settings->get(
'soap_auth_use_https', 
false);
 
   60        $this->use_dot_net = (bool) $this->
settings->get(
'use_dotnet', 
false);
 
   62        $this->uri = $this->server_https ? 
'https://' : 
'http://';
 
   65        if ($this->server_port > 0) {
 
   68        if ($this->server_uri) {
 
   72        require_once 
'./webservice/soap/lib/nusoap.php';
 
   84        } 
catch (Exception $e) {
 
   85            $this->
getLogger()->error($e->getMessage());
 
   86            $status->setTranslatedReason($e->getMessage());
 
   89        if (
$status->getAuthenticatedUserId() > 0) {
 
   90            $this->logger->info(
'Successfully authenticated user via SOAP: ' . $this->
getCredentials()->getUsername());
 
  108        $this->logger->debug(sprintf(
 
  109            'Login observer called for SOAP authentication request of ext_account "%s" and auth_mode "%s".',
 
  113        $this->logger->debug(sprintf(
 
  114            'Trying to find ext_account "%s" for auth_mode "%s".',
 
  125        if (
'' === $internalLogin || 
false === $internalLogin) {
 
  131        if ($this->use_dot_net) {
 
  132            $soapAction = $this->server_nms . 
'/isValidSession';
 
  136        $valid = $this->client->call(
 
  141                $nspref . 
'new_user' => $isNewUser
 
  147        if (
$valid[
'valid'] !== 
true) {
 
  152            $status->setReason(
'err_wrong_login');
 
  159        } elseif (!$this->
settings->get(
'soap_auth_create_users')) {
 
  161            $status->
setTranslatedReason($this->language->txt(
'err_valid_login_account_creation_disabled'));
 
  169        $usrData[
'firstname'] = 
$valid[
'firstname'];
 
  170        $usrData[
'lastname'] = 
$valid[
'lastname'];
 
  171        $usrData[
'email'] = 
$valid[
'email'];
 
  172        $usrData[
'login'] = $internalLogin;
 
  173        $usrData[
'passwd'] = 
'';
 
  177        if ($this->
settings->get(
'soap_auth_allow_local')) {
 
  184        $usrData[
'auth_mode'] = 
'soap';
 
  186        $usrData[
'profile_incomplete'] = 1;
 
  188        $userObj->assignData($usrData);
 
  189        $userObj->setTitle($userObj->getFullname());
 
  190        $userObj->setDescription($userObj->getEmail());
 
  191        $userObj->setLanguage($this->language->getDefaultLanguage());
 
  194        $userObj->setTimeLimitUnlimited(1);
 
  195        $userObj->setTimeLimitFrom(time());
 
  196        $userObj->setTimeLimitUntil(time());
 
  197        $userObj->setOwner(0);
 
  199        $userObj->setActive(1);
 
  200        $userObj->updateOwner();
 
  201        $userObj->saveAsNew(
false);
 
  202        $userObj->writePrefs();
 
  204        $this->rbacAdmin->assignUser(
 
  205            $this->
settings->get(
'soap_auth_user_default_role', 4),
 
  209        if ($this->
settings->get(
'soap_auth_account_mail', 
false)) {
 
  211            $registrationSettings->setPasswordGenerationStatus(
true);
 
  214                $registrationSettings,
 
  219                ->withDirectRegistrationMode()
 
  223        $status->setAuthenticatedUserId($userObj->getId());
 
An exception for terminatinating execution or to throw for unit testing.
const USER_FOLDER_ID
Class ilObjUserFolder.
Class ilAccountRegistrationMail.
Class ilAuthProviderSoap.
handleSoapAuth(ilAuthStatus $status)
doAuthentication(ilAuthStatus $status)
@inheritDoc
__construct(ilAuthCredentials $credentials)
@inheritDoc
Base class for authentication providers (radius, ldap, apache, ...)
Auth status implementation.
setTranslatedReason($a_reason)
Set translated reason.
const STATUS_AUTHENTICATED
const STATUS_AUTHENTICATION_FAILED
static _generateLogin($a_login)
generate free login by starting with a default string and adding postfix numbers
static _checkExternalAuthAccount($a_auth, $a_account, $tryFallback=true)
check whether external account and authentication method matches with a user
static _lookupId($a_user_str)
Lookup id by login.
Class ilObjAuthSettingsGUI.
static set($a_var, $a_val)
Set a value.
static generatePasswords($a_number)
Generate a number of passwords.
[nu]soapclient higher level class for easy usage.
Interface of auth credentials.
Standard interface for auth provider implementations.