24 include_once
'Auth/Container/LDAP.php';
25 include_once(
"./webservice/soap/lib/nusoap.php");
57 parent::__construct();
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"))
193 $newUser[
"firstname"] = $this->response[
"firstname"];
194 $newUser[
"lastname"] = $this->response[
"lastname"];
195 $newUser[
"email"] = $this->response[
"email"];
197 $newUser[
"login"] = $local_user;
200 $newUser[
"passwd"] =
"";
207 if ($ilSetting->get(
"soap_auth_allow_local") &&
208 $ilSetting->get(
"soap_auth_account_mail"))
212 $newUser[
"passwd"] = $pw;
217 $newUser[
"auth_mode"] =
"soap";
218 $newUser[
"ext_account"] = $a_username;
219 $newUser[
"profile_incomplete"] = 1;
222 $userObj->assignData($newUser);
223 $userObj->setTitle($userObj->getFullname());
224 $userObj->setDescription($userObj->getEmail());
227 $userObj->setLanguage($lng->lang_default);
230 $userObj->setTimeLimitOwner(7);
231 $userObj->setTimeLimitUnlimited(1);
232 $userObj->setTimeLimitFrom(
time());
233 $userObj->setTimeLimitUntil(
time());
236 $userObj->setOwner(0);
238 $userObj->setActive(1);
240 $userObj->updateOwner();
243 $userObj->saveAsNew(
false);
246 $userObj->writePrefs();
249 $rbacadmin->assignUser($ilSetting->get(
'soap_auth_user_default_role'), $userObj->getId(),
true);
252 if ($ilSetting->get(
"soap_auth_account_mail"))
254 include_once(
'./Services/User/classes/class.ilObjUserFolder.php');
256 if (trim($amail[
"body"]) !=
"" && trim($amail[
"subject"]) !=
"")
258 include_once(
"Services/Mail/classes/class.ilAccountMail.php");
263 $acc_mail->setUserPassword($pw);
265 $acc_mail->setUser($userObj);
271 $a_auth->setAuth($local_user);
initClient()
Init soap client.
__construct()
Constructor.
static _generateLogin($a_login)
generate free login by starting with a default string and adding postfix numbers
$GLOBALS['loaded']
Global hash that tracks already loaded includes.
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.
const AUTH_SOAP_NO_ILIAS_USER
static _lookupNewAccountMail($a_lang)
[nu]soapclient higher level class for easy usage.
Create styles array
The data for the language used.
static _checkExternalAuthAccount($a_auth, $a_account)
check whether external account and authentication method matches with a user
Add data(end) time
Method that wraps PHPs time in order to allow simulations with the workflow.
Authentication against external SOAP server