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)
212 $a_auth->status =
'';
213 $a_auth->setAuth($local_user);
228 if (count($email_user) > 0 &&
$_POST[
"CreateUser"] ==
"")
230 $_GET[
"email"] = $this->response[
"email"];
240 $newUser[
"firstname"] = $this->response[
"firstname"];
241 $newUser[
"lastname"] = $this->response[
"lastname"];
242 $newUser[
"email"] = $this->response[
"email"];
244 $newUser[
"login"] = $local_user;
247 $newUser[
"passwd"] =
"";
254 if ($ilSetting->get(
"soap_auth_allow_local") &&
255 $ilSetting->get(
"soap_auth_account_mail"))
259 $newUser[
"passwd"] = md5($pw);
264 $newUser[
"auth_mode"] =
"soap";
265 $newUser[
"ext_account"] = $a_username;
266 $newUser[
"profile_incomplete"] = 1;
269 $userObj->assignData($newUser);
270 $userObj->setTitle($userObj->getFullname());
271 $userObj->setDescription($userObj->getEmail());
274 $userObj->setLanguage($lng->lang_default);
277 $userObj->setTimeLimitOwner(7);
278 $userObj->setTimeLimitUnlimited(1);
279 $userObj->setTimeLimitFrom(time());
280 $userObj->setTimeLimitUntil(time());
283 $userObj->setOwner(0);
285 $userObj->setActive(1);
287 $userObj->updateOwner();
290 $userObj->saveAsNew(
false);
293 $userObj->writePrefs();
296 $rbacadmin->assignUser($ilSetting->get(
'soap_auth_user_default_role'), $userObj->getId(),
true);
299 if ($ilSetting->get(
"soap_auth_account_mail"))
301 include_once(
'./Services/User/classes/class.ilObjUserFolder.php');
303 if (trim($amail[
"body"]) !=
"" && trim($amail[
"subject"]) !=
"")
305 include_once(
"Services/Mail/classes/class.ilAccountMail.php");
310 $acc_mail->setUserPassword($pw);
312 $acc_mail->setUser($userObj);
318 $a_auth->setAuth($local_user);