24 include_once
'Auth/Container/LDAP.php';
25 include_once(
"./webservice/soap/lib/nusoap.php");
55 parent::__construct();
66 $this->server_host = $ilSetting->get(
'soap_auth_server');
67 $this->server_port = $ilSetting->get(
'soap_auth_port');
68 $this->server_uri = $ilSetting->get(
'soap_auth_uri');
69 $this->server_https = $ilSetting->get(
'soap_auth_use_https');
70 $this->server_nms = $ilSetting->get(
'soap_auth_namespace');
71 $this->use_dot_net = $ilSetting->get(
'use_dotnet');
73 $this->uri = $this->server_https ?
'https://' :
'http://';
76 if($this->server_port > 0)
78 $this->uri .= (
':'.$this->server_port);
82 $this->uri .= (
'/'.$this->server_uri);
94 public function fetchData($a_username, $a_password, $isChallengeResponse =
false)
96 $GLOBALS[
'ilLog']->write(__METHOD__.
': Soap auth fetch data');
101 if ($local_user ==
"")
112 if ($this->use_dotnet)
114 $soapAction = $this->server_nms.
"/isValidSession";
117 $valid = $this->client->call(
'isValidSession',
118 array($nspref.
'ext_uid' => $a_username,
119 $nspref.
'soap_pw' => $a_password,
124 if (trim(
$valid[
"valid"]) ==
"false")
130 $valid[
"local_user"] = $local_user;
133 return $valid[
'valid'] ==
true;
146 $GLOBALS[
'ilLog']->write(__METHOD__.
': SOAP login observer called');
148 $local_user = $this->response[
"local_user"];
149 if ($local_user !=
"")
152 $a_auth->setAuth($local_user);
155 if(!$ilSetting->get(
"soap_auth_create_users"))
165 $newUser[
"firstname"] = $this->response[
"firstname"];
166 $newUser[
"lastname"] = $this->response[
"lastname"];
167 $newUser[
"email"] = $this->response[
"email"];
169 $newUser[
"login"] = $local_user;
172 $newUser[
"passwd"] =
"";
179 if ($ilSetting->get(
"soap_auth_allow_local") &&
180 $ilSetting->get(
"soap_auth_account_mail"))
184 $newUser[
"passwd"] = $pw;
189 $newUser[
"auth_mode"] =
"soap";
190 $newUser[
"ext_account"] = $a_username;
191 $newUser[
"profile_incomplete"] = 1;
194 $userObj->assignData($newUser);
195 $userObj->setTitle($userObj->getFullname());
196 $userObj->setDescription($userObj->getEmail());
199 $userObj->setLanguage($lng->lang_default);
202 $userObj->setTimeLimitOwner(7);
203 $userObj->setTimeLimitUnlimited(1);
204 $userObj->setTimeLimitFrom(time());
205 $userObj->setTimeLimitUntil(time());
208 $userObj->setOwner(0);
210 $userObj->setActive(1);
212 $userObj->updateOwner();
215 $userObj->saveAsNew(
false);
218 $userObj->writePrefs();
221 $rbacadmin->assignUser($ilSetting->get(
'soap_auth_user_default_role'), $userObj->getId(),
true);
224 if ($ilSetting->get(
"soap_auth_account_mail"))
226 include_once(
'./Services/User/classes/class.ilObjUserFolder.php');
228 if (trim($amail[
"body"]) !=
"" && trim($amail[
"subject"]) !=
"")
230 include_once(
"Services/Mail/classes/class.ilAccountMail.php");
235 $acc_mail->setUserPassword($pw);
237 $acc_mail->setUser($userObj);
243 $a_auth->setAuth($local_user);
initClient()
Init soap client.
__construct()
Constructor.
loginObserver($a_username, $a_auth)
Called after login and successful call of fetch data.
static generatePasswords($a_number)
Generate a number of passwords.
fetchData($a_username, $a_password, $isChallengeResponse=false)
Call is isValidSession of soap server.
_lookupNewAccountMail($a_lang)
const AUTH_SOAP_NO_ILIAS_USER
_generateLogin($a_login)
generate free login by starting with a default string and adding postfix numbers
[nu]soapclient higher level class for easy usage.
static _checkExternalAuthAccount($a_auth, $a_account)
check whether external account and authentication method matches with a user
$GLOBALS['PHPCAS_CLIENT']
This global variable is used by the interface class phpCAS.
Authentication against external SOAP server