24 include_once(
'Auth/Container.php');
118 $ilLog->write(__METHOD__.
': Starting ECS authentication.');
122 $GLOBALS[
'ilLog']->write(__METHOD__.
': no active ecs server found. Aborting');
127 include_once
'./Services/WebServices/ECS/classes/class.ilECSServerSettings.php';
136 $GLOBALS[
'ilLog']->write(__METHOD__.
': Could not validate ecs hash for any server');
157 include_once(
'./Services/WebServices/ECS/classes/class.ilECSConnector.php');
159 $res = $connector->getAuth(
$_GET[
'ecs_hash']);
160 $auths =
$res->getResult();
161 $this->abreviation = $auths->abbr;
162 $ilLog->write(__METHOD__.
': Got abr: '.$this->abreviation);
167 $ilLog->write(__METHOD__.
': Authentication failed with message: '.$e->getMessage());
179 include_once(
'./Services/WebServices/ECS/classes/class.ilECSUser.php');
192 $a_auth->setAuth($username);
193 $this->
log->write(__METHOD__.
': Login succesesful');
204 $this->
log->write(__METHOD__.
': Login failed');
221 include_once(
'./Services/Authentication/classes/class.ilAuthUtils.php');
224 $newUser[
"login"] = $local_user;
227 $newUser[
'email'] = $user->
getEmail();
231 $newUser[
"passwd"] =
"";
234 $newUser[
"auth_mode"] =
"ecs";
235 $newUser[
"profile_incomplete"] = 0;
238 $userObj->assignData($newUser);
239 $userObj->setTitle($userObj->getFullname());
240 $userObj->setDescription($userObj->getEmail());
243 $userObj->setLanguage($ilSetting->get(
"language"));
246 $userObj->setTimeLimitOwner(7);
247 $userObj->setTimeLimitUnlimited(0);
248 $userObj->setTimeLimitFrom(time() - 5);
249 $userObj->setTimeLimitUntil(time() + $ilClientIniFile->readVariable(
"session",
"expire"));
252 $userObj->setOwner(6);
254 $userObj->setActive(1);
255 $userObj->updateOwner();
256 $userObj->saveAsNew();
257 $userObj->writePrefs();
261 $rbacadmin->assignUser($this->
getCurrentServer()->getGlobalRole(), $userObj->getId(),
true);
265 $ilLog->write(__METHOD__ .
': Created new remote user with usr_id: ' . $user->
getImportId());
268 #$this->sendNotification($userObj);
270 return $userObj->getLogin();
280 global $ilClientIniFile,
$ilLog,$rbacadmin;
282 $user_obj =
new ilObjUser($a_local_user_id);
285 $user_obj->setEmail($user->
getEmail());
288 $until = $user_obj->getTimeLimitUntil();
289 $user_obj->setTimeLimitFrom(time() - 5);
291 if($until < (time() + $ilClientIniFile->readVariable(
'session',
'expire')))
293 $user_obj->setTimeLimitUntil(time() + $ilClientIniFile->readVariable(
"session",
"expire"));
296 $user_obj->refreshLogin();
300 $rbacadmin->assignUser(
307 $ilLog->write(__METHOD__.
': Finished update of remote user with usr_id: '.$user->
getImportId());
308 return $user_obj->getLogin();
320 include_once
'./Services/WebServices/ECS/classes/class.ilECSServerSettings.php';
338 include_once(
'./Services/Language/classes/class.ilLanguageFactory.php');
342 $lang->loadLanguageModule(
'ecs');
344 include_once(
'./Services/Mail/classes/class.ilMail.php');
346 $mail->enableSoap(
false);
347 $subject =
$lang->txt(
'ecs_new_user_subject');
350 $body =
$lang->txt(
'ecs_new_user_body').
"\n\n";
351 $body .=
$lang->txt(
'ecs_new_user_profile').
"\n\n";
352 $body .= $user_obj->getProfileAsString(
$lang).
"\n\n";