34 include_once(
'Auth/Auth.php');
54 $this->log->write(__METHOD__.
': Called constructor...');
56 $_POST[
'username'] =
'dummy';
59 include_once(
'./Services/WebServices/ECS/classes/class.ilAuthContainerECS.php');
73 include_once(
'./Services/WebServices/ECS/classes/class.ilECSUser.php');
86 $this->setAuth($username);
87 $this->log->write(__METHOD__.
': Login succesesful');
103 include_once(
'./Services/Authentication/classes/class.ilAuthUtils.php');
106 $newUser[
"login"] = $local_user;
109 $newUser[
'email'] = $user->
getEmail();
113 $newUser[
"passwd"] =
"";
116 $newUser[
"auth_mode"] =
"ecs";
117 $newUser[
"profile_incomplete"] = 0;
120 $userObj->assignData($newUser);
121 $userObj->setTitle($userObj->getFullname());
122 $userObj->setDescription($userObj->getEmail());
125 $userObj->setLanguage($ilSetting->get(
"language"));
128 $userObj->setTimeLimitOwner(7);
129 $userObj->setTimeLimitUnlimited(0);
130 $userObj->setTimeLimitFrom(time());
131 $userObj->setTimeLimitUntil(time() + $ilClientIniFile->readVariable(
"session",
"expire"));
134 $userObj->setOwner(6);
136 $userObj->setActive(1);
137 $userObj->updateOwner();
138 $userObj->saveAsNew();
139 $userObj->writePrefs();
142 if($global_role = $this->settings->getGlobalRole())
144 $rbacadmin->assignUser($this->settings->getGlobalRole(),$userObj->getId(),
true);
148 $ilLog->write(__METHOD__.
': Created new remote user with usr_id: '.$user->
getImportId());
151 #$this->sendNotification($userObj);
153 return $userObj->getLogin();
163 global $ilClientIniFile,
$ilLog,$rbacadmin;
165 $user_obj =
new ilObjUser($a_local_user_id);
168 $user_obj->setEmail($user->
getEmail());
171 $until = $user_obj->getTimeLimitUntil();
173 if($until < (time() + $ilClientIniFile->readVariable(
'session',
'expire')))
175 $user_obj->setTimeLimitFrom(time());
176 $user_obj->setTimeLimitUntil(time() + $ilClientIniFile->readVariable(
"session",
"expire"));
179 $user_obj->refreshLogin();
182 if($global_role = $this->settings->getGlobalRole())
184 $rbacadmin->assignUser($this->settings->getGlobalRole(),$user_obj->getId(),
true);
187 $ilLog->write(__METHOD__.
': Finished update of remote user with usr_id: '.$user->
getImportId());
188 return $user_obj->getLogin();
198 $this->log->write(__METHOD__.
': Login failed');
208 $this->setLoginCallback(array($this,
'loginObserver'));
209 $this->setFailedLoginCallback(array($this,
'failedLoginObserver'));
223 if(!method_exists($this,
'attachLogObserver'))
225 $ilLog->write(__METHOD__.
': PEAR Auth < 1.5 => disabling logging.');
229 if(@include_once(
'Log.php'))
231 if(@include_once(
'Log/observer.php'))
233 $ilLog->write(__METHOD__.
': Attached Logging observer.');
234 include_once(
'Services/LDAP/classes/class.ilAuthLDAPLogObserver.php');
239 $ilLog->write(__METHOD__.
': PEAR Log not installed. Logging disabled');
250 include_once(
'./Services/WebServices/ECS/classes/class.ilECSSettings.php');
263 if(!count($this->settings->getUserRecipients()))
268 include_once(
'./Services/Language/classes/class.ilLanguageFactory.php');
272 $lang->loadLanguageModule(
'ecs');
274 include_once(
'./Services/Mail/classes/class.ilMail.php');
276 $mail->enableSoap(
false);
277 $subject =
$lang->txt(
'ecs_new_user_subject');
280 $body =
$lang->txt(
'ecs_new_user_body').
"\n\n";
281 $body .=
$lang->txt(
'ecs_new_user_profile').
"\n\n";
282 $body .= $user_obj->getProfileAsString(
$lang).
"\n\n";
285 $mail->sendMail($this->settings->getUserRecipientsAsString(),
"",
"",$subject,$body,array(),array(
"normal"));