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($this->amail[$a_lang][
"body"]);
145 $amail[
"subject"] = trim($this->amail[$a_lang][
"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 $mail_body = $tmp_lang->txt(
'reg_mail_body_salutation').
' '.
$user->getFullname().
",\n\n".
195 $tmp_lang->txt(
'reg_mail_body_text1').
"\n\n".
196 $tmp_lang->txt(
'reg_mail_body_text2').
"\n".
197 ILIAS_HTTP_PATH.
'/login.php?client_id='.CLIENT_ID.
"\n";
198 $mail_body .= $tmp_lang->txt(
'login').
': '.
$user->getLogin().
"\n";
199 $mail_body.= $tmp_lang->txt(
'passwd').
': '.$this->u_password.
"\n";
201 $mail_body .= $tmp_lang->txt(
'reg_mail_body_text3').
"\n\r";
202 $mail_body .=
$user->getProfileAsString($tmp_lang);
212 include_once
'Services/Mail/classes/class.ilMimeMail.php';
214 $mmail->autoCheck(
false);
215 $mmail->From($ilSetting->get(
'admin_email'));
216 $mmail->Subject($mail_subject);
217 $mmail->To(
$user->getEmail());
218 $mmail->Body($mail_body);
220 foreach($this->attachments as
$filename => $display_name)
222 $mmail->Attach(
$filename,
"",
"attachment", $display_name);
240 switch ($a_user->getGender())
242 case "f" : $gender_salut = $a_amail[
"sal_f"];
244 case "m" : $gender_salut = $a_amail[
"sal_m"];
246 default : $gender_salut = $a_amail[
"sal_g"];
248 $gender_salut = trim($gender_salut);
250 $a_string = str_replace(
"[MAIL_SALUTATION]", $gender_salut, $a_string);
251 $a_string = str_replace(
"[LOGIN]", $a_user->getLogin(), $a_string);
252 $a_string = str_replace(
"[FIRST_NAME]", $a_user->getFirstname(), $a_string);
253 $a_string = str_replace(
"[LAST_NAME]", $a_user->getLastname(), $a_string);
255 $a_string = str_replace(
"[EMAIL]", $a_user->getEmail(), $a_string);
257 $a_string = str_replace(
"[PASSWORD]", $this->
getUserPassword(), $a_string);
258 $a_string = str_replace(
"[ILIAS_URL]",
259 ILIAS_HTTP_PATH.
"/login.php?client_id=".CLIENT_ID, $a_string);
260 $a_string = str_replace(
"[CLIENT_NAME]", CLIENT_NAME, $a_string);
261 $a_string = str_replace(
"[ADMIN_MAIL]", $ilSetting->get(
"admin_email"),
268 $a_string = preg_replace(
"/\[IF_PASSWORD\].*\[\/IF_PASSWORD\]/imsU",
"", $a_string);
269 $a_string = preg_replace(
"/\[IF_NO_PASSWORD\](.*)\[\/IF_NO_PASSWORD\]/imsU",
"$1", $a_string);
273 $a_string = preg_replace(
"/\[IF_NO_PASSWORD\].*\[\/IF_NO_PASSWORD\]/imsU",
"", $a_string);
274 $a_string = preg_replace(
"/\[IF_PASSWORD\](.*)\[\/IF_PASSWORD\]/imsU",
"$1", $a_string);
279 if (
$_GET[
"target"] !=
"")
281 $tarr = explode(
"_",
$_GET[
"target"]);
282 if ($tree->isInTree($tarr[1]))
286 if ($type == $tarr[0])
290 $a_string = str_replace(
"[TARGET]",
291 ILIAS_HTTP_PATH.
"/goto.php?client_id=".CLIENT_ID.
"&target=".
$_GET[
"target"],
296 include_once(
"./Services/Language/classes/class.ilLanguage.php");
297 $a_string = str_replace(
"[TARGET_TYPE]",
309 $a_string = preg_replace(
"/\[IF_TARGET\].*\[\/IF_TARGET\]/imsU",
"", $a_string);
313 $a_string = preg_replace(
"/\[IF_TARGET\](.*)\[\/IF_TARGET\]/imsU",
"$1", $a_string);
321 $this->attachments[$a_filename] = $a_display_name;