50 $this->lang_variables_as_fallback = $a_status;
66 $this->u_password = $a_pwd;
89 $this->user =& $a_user;
111 $this->u_target = $a_target;
130 unset($this->u_password);
132 unset($this->target);
140 if (!is_array($this->amail[$a_lang]))
142 include_once(
'./Services/User/classes/class.ilObjUserFolder.php');
144 $amail[
"body"] = trim($amail[
"body"]);
145 $amail[
"subject"] = trim($amail[
"subject"]);
148 return $this->amail[$a_lang];
165 if (!
$user->getEmail())
173 if ($amail[
'body'] ==
'' || $amail[
'subject'] ==
'')
176 $lang = $ilSetting->get(
'language');
185 ($amail[
'body'] ==
'' || $amail[
'subject'] ==
''))
191 $mail_subject = $tmp_lang->txt(
'reg_mail_subject');
194 if (!
$user->checkTimeLimit())
196 $tmp_lang->loadLanguageModule(
"registration");
202 $timelimit =
"\n".sprintf($tmp_lang->txt(
'reg_mail_body_timelimit'), $timelimit).
"\n\n";
206 $mail_body = $tmp_lang->txt(
'reg_mail_body_salutation').
' '.
$user->getFullname().
",\n\n".
207 $tmp_lang->txt(
'reg_mail_body_text1').
"\n\n".
208 $tmp_lang->txt(
'reg_mail_body_text2').
"\n".
209 ILIAS_HTTP_PATH.
'/login.php?client_id='.CLIENT_ID.
"\n";
210 $mail_body .= $tmp_lang->txt(
'login').
': '.
$user->getLogin().
"\n";
211 $mail_body.= $tmp_lang->txt(
'passwd').
': '.$this->u_password.
"\n";
212 $mail_body.=
"\n".$timelimit;
213 $mail_body .= $tmp_lang->txt(
'reg_mail_body_text3').
"\n\r";
214 $mail_body .=
$user->getProfileAsString($tmp_lang);
224 include_once
'Services/Mail/classes/class.ilMimeMail.php';
226 $mmail->autoCheck(
false);
227 $mmail->From($ilSetting->get(
'admin_email'));
228 $mmail->Subject($mail_subject);
229 $mmail->To(
$user->getEmail());
230 $mmail->Body($mail_body);
232 foreach($this->attachments as
$filename => $display_name)
234 $mmail->Attach(
$filename,
"",
"attachment", $display_name);
252 switch ($a_user->getGender())
254 case "f" : $gender_salut = $a_amail[
"sal_f"];
256 case "m" : $gender_salut = $a_amail[
"sal_m"];
258 default : $gender_salut = $a_amail[
"sal_g"];
260 $gender_salut = trim($gender_salut);
262 $a_string = str_replace(
"[MAIL_SALUTATION]", $gender_salut, $a_string);
263 $a_string = str_replace(
"[LOGIN]", $a_user->getLogin(), $a_string);
264 $a_string = str_replace(
"[FIRST_NAME]", $a_user->getFirstname(), $a_string);
265 $a_string = str_replace(
"[LAST_NAME]", $a_user->getLastname(), $a_string);
267 $a_string = str_replace(
"[EMAIL]", $a_user->getEmail(), $a_string);
269 $a_string = str_replace(
"[PASSWORD]", $this->
getUserPassword(), $a_string);
270 $a_string = str_replace(
"[ILIAS_URL]",
271 ILIAS_HTTP_PATH.
"/login.php?client_id=".CLIENT_ID, $a_string);
272 $a_string = str_replace(
"[CLIENT_NAME]", CLIENT_NAME, $a_string);
273 $a_string = str_replace(
"[ADMIN_MAIL]", $ilSetting->get(
"admin_email"),
280 $a_string = preg_replace(
"/\[IF_PASSWORD\].*\[\/IF_PASSWORD\]/imsU",
"", $a_string);
281 $a_string = preg_replace(
"/\[IF_NO_PASSWORD\](.*)\[\/IF_NO_PASSWORD\]/imsU",
"$1", $a_string);
285 $a_string = preg_replace(
"/\[IF_NO_PASSWORD\].*\[\/IF_NO_PASSWORD\]/imsU",
"", $a_string);
286 $a_string = preg_replace(
"/\[IF_PASSWORD\](.*)\[\/IF_PASSWORD\]/imsU",
"$1", $a_string);
290 if (!$a_user->getTimeLimitUnlimited())
293 $a_string = preg_replace(
"/\[IF_TIMELIMIT\](.*)\[\/IF_TIMELIMIT\]/imsU",
"$1", $a_string);
297 $a_string = str_replace(
"[TIMELIMIT]", $timelimit, $a_string);
301 $a_string = preg_replace(
"/\[IF_TIMELIMIT\](.*)\[\/IF_TIMELIMIT\]/imsU",
"", $a_string);
306 if (
$_GET[
"target"] !=
"")
308 $tarr = explode(
"_",
$_GET[
"target"]);
309 if ($tree->isInTree($tarr[1]))
313 if ($type == $tarr[0])
317 $a_string = str_replace(
"[TARGET]",
318 ILIAS_HTTP_PATH.
"/goto.php?client_id=".CLIENT_ID.
"&target=".
$_GET[
"target"],
323 include_once(
"./Services/Language/classes/class.ilLanguage.php");
324 $a_string = str_replace(
"[TARGET_TYPE]",
336 $a_string = preg_replace(
"/\[IF_TARGET\].*\[\/IF_TARGET\]/imsU",
"", $a_string);
340 $a_string = preg_replace(
"/\[IF_TARGET\](.*)\[\/IF_TARGET\]/imsU",
"$1", $a_string);
348 $this->attachments[$a_filename] = $a_display_name;