24 include_once
'Auth/Container/LDAP.php';
25 include_once(
"./webservice/soap/lib/nusoap.php");
69 $this->server_host = $ilSetting->get(
'soap_auth_server');
70 $this->server_port = $ilSetting->get(
'soap_auth_port');
71 $this->server_uri = $ilSetting->get(
'soap_auth_uri');
72 $this->server_https = $ilSetting->get(
'soap_auth_use_https');
73 $this->server_nms = $ilSetting->get(
'soap_auth_namespace');
74 $this->use_dot_net = $ilSetting->get(
'use_dotnet');
76 $this->uri = $this->server_https ?
'https://' :
'http://';
79 if($this->server_port > 0)
81 $this->uri .= (
':'.$this->server_port);
85 $this->uri .= (
'/'.$this->server_uri);
97 public function fetchData($a_username,$a_password,$isChallengeResponse =
false)
99 $GLOBALS[
'ilLog']->write(__METHOD__.
': Soap auth fetch data');
104 if ($local_user ==
"")
115 if ($this->use_dotnet)
117 $soapAction = $this->server_nms.
"/isValidSession";
120 $valid = $this->client->call(
'isValidSession',
121 array($nspref.
'ext_uid' => $a_username,
122 $nspref.
'soap_pw' => $a_password,
132 if (trim(
$valid[
"valid"]) ==
"false")
138 $valid[
"local_user"] = $local_user;
140 return $valid[
'valid'] ==
true;
153 $GLOBALS[
'ilLog']->write(__METHOD__.
': SOAP login observer called');
176 $local_user = $this->response[
"local_user"];
177 if ($local_user !=
"")
180 $a_auth->setAuth($local_user);
183 if(!$ilSetting->get(
"soap_auth_create_users"))
191 if ($this->response[
"email"] !=
"")
200 if (
$_POST[
"LoginMappedUser"] !=
"")
202 if (count($email_user) > 0)
205 require_once
'Services/User/classes/class.ilUserPasswordManager.php';
214 $a_auth->status =
'';
215 $a_auth->setAuth($local_user);
230 if (count($email_user) > 0 &&
$_POST[
"CreateUser"] ==
"")
232 $_GET[
"email"] = $this->response[
"email"];
242 $newUser[
"firstname"] = $this->response[
"firstname"];
243 $newUser[
"lastname"] = $this->response[
"lastname"];
244 $newUser[
"email"] = $this->response[
"email"];
246 $newUser[
"login"] = $local_user;
249 $newUser[
"passwd"] =
"";
256 if ($ilSetting->get(
"soap_auth_allow_local") &&
257 $ilSetting->get(
"soap_auth_account_mail"))
261 $newUser[
"passwd"] = $pw;
266 $newUser[
"auth_mode"] =
"soap";
267 $newUser[
"ext_account"] = $a_username;
268 $newUser[
"profile_incomplete"] = 1;
271 $userObj->assignData($newUser);
272 $userObj->setTitle($userObj->getFullname());
273 $userObj->setDescription($userObj->getEmail());
276 $userObj->setLanguage($lng->lang_default);
279 $userObj->setTimeLimitOwner(7);
280 $userObj->setTimeLimitUnlimited(1);
281 $userObj->setTimeLimitFrom(time());
282 $userObj->setTimeLimitUntil(time());
285 $userObj->setOwner(0);
287 $userObj->setActive(1);
289 $userObj->updateOwner();
292 $userObj->saveAsNew(
false);
295 $userObj->writePrefs();
298 $rbacadmin->assignUser($ilSetting->get(
'soap_auth_user_default_role'), $userObj->getId(),
true);
301 if ($ilSetting->get(
"soap_auth_account_mail"))
303 include_once(
'./Services/User/classes/class.ilObjUserFolder.php');
305 if (trim($amail[
"body"]) !=
"" && trim($amail[
"subject"]) !=
"")
307 include_once(
"Services/Mail/classes/class.ilAccountMail.php");
312 $acc_mail->setUserPassword($pw);
314 $acc_mail->setUser($userObj);
320 $a_auth->setAuth($local_user);