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])) {
141 include_once(
'./Services/User/classes/class.ilObjUserFolder.php');
143 $amail[
"body"] = trim($amail[
"body"]);
144 $amail[
"subject"] = trim($amail[
"subject"]);
147 return $this->amail[$a_lang];
158 public function send()
164 if (!
$user->getEmail()) {
171 if ($amail[
'body'] ==
'' || $amail[
'subject'] ==
'') {
173 $lang = $ilSetting->get(
'language');
180 ($amail[
'body'] ==
'' || $amail[
'subject'] ==
'')) {
185 $mail_subject = $tmp_lang->txt(
'reg_mail_subject');
188 if (!
$user->checkTimeLimit()) {
189 $tmp_lang->loadLanguageModule(
"registration");
195 $timelimit =
"\n" . sprintf($tmp_lang->txt(
'reg_mail_body_timelimit'), $timelimit) .
"\n\n";
199 $mail_body = $tmp_lang->txt(
'reg_mail_body_salutation') .
' ' .
$user->getFullname() .
",\n\n" .
200 $tmp_lang->txt(
'reg_mail_body_text1') .
"\n\n" .
201 $tmp_lang->txt(
'reg_mail_body_text2') .
"\n" .
202 ILIAS_HTTP_PATH .
'/login.php?client_id=' . CLIENT_ID .
"\n";
203 $mail_body .= $tmp_lang->txt(
'login') .
': ' .
$user->getLogin() .
"\n";
204 $mail_body.= $tmp_lang->txt(
'passwd') .
': ' . $this->u_password .
"\n";
205 $mail_body.=
"\n" . $timelimit;
206 $mail_body .= $tmp_lang->txt(
'reg_mail_body_text3') .
"\n\r";
207 $mail_body .=
$user->getProfileAsString($tmp_lang);
215 $senderFactory =
$GLOBALS[
"DIC"][
"mail.mime.sender.factory"];
218 include_once
'Services/Mail/classes/class.ilMimeMail.php';
220 $mmail->From($senderFactory->system());
221 $mmail->Subject($mail_subject);
222 $mmail->To(
$user->getEmail());
223 $mmail->Body($mail_body);
225 foreach ($this->attachments as
$filename => $display_name) {
226 $mmail->Attach(
$filename,
"",
"attachment", $display_name);
244 switch ($a_user->getGender()) {
245 case "f": $gender_salut = $a_amail[
"sal_f"];
247 case "m": $gender_salut = $a_amail[
"sal_m"];
249 default: $gender_salut = $a_amail[
"sal_g"];
251 $gender_salut = trim($gender_salut);
253 $a_string = str_replace(
"[MAIL_SALUTATION]", $gender_salut, $a_string);
254 $a_string = str_replace(
"[LOGIN]", $a_user->getLogin(), $a_string);
255 $a_string = str_replace(
"[FIRST_NAME]", $a_user->getFirstname(), $a_string);
256 $a_string = str_replace(
"[LAST_NAME]", $a_user->getLastname(), $a_string);
258 $a_string = str_replace(
"[EMAIL]", $a_user->getEmail(), $a_string);
260 $a_string = str_replace(
"[PASSWORD]", $this->
getUserPassword(), $a_string);
261 $a_string = str_replace(
263 ILIAS_HTTP_PATH .
"/login.php?client_id=" . CLIENT_ID,
266 $a_string = str_replace(
"[CLIENT_NAME]", CLIENT_NAME, $a_string);
267 $a_string = str_replace(
269 $ilSetting->get(
"admin_email"),
276 $a_string = preg_replace(
"/\[IF_PASSWORD\].*\[\/IF_PASSWORD\]/imsU",
"", $a_string);
277 $a_string = preg_replace(
"/\[IF_NO_PASSWORD\](.*)\[\/IF_NO_PASSWORD\]/imsU",
"$1", $a_string);
279 $a_string = preg_replace(
"/\[IF_NO_PASSWORD\].*\[\/IF_NO_PASSWORD\]/imsU",
"", $a_string);
280 $a_string = preg_replace(
"/\[IF_PASSWORD\](.*)\[\/IF_PASSWORD\]/imsU",
"$1", $a_string);
284 if (!$a_user->getTimeLimitUnlimited()) {
286 $a_string = preg_replace(
"/\[IF_TIMELIMIT\](.*)\[\/IF_TIMELIMIT\]/imsU",
"$1", $a_string);
290 $a_string = str_replace(
"[TIMELIMIT]", $timelimit, $a_string);
292 $a_string = preg_replace(
"/\[IF_TIMELIMIT\](.*)\[\/IF_TIMELIMIT\]/imsU",
"", $a_string);
297 if (
$_GET[
"target"] !=
"") {
298 $tarr = explode(
"_",
$_GET[
"target"]);
299 if ($tree->isInTree($tarr[1])) {
302 if (
$type == $tarr[0]) {
303 $a_string = str_replace(
308 $a_string = str_replace(
310 ILIAS_HTTP_PATH .
"/goto.php?client_id=" . CLIENT_ID .
"&target=" .
$_GET[
"target"],
316 include_once(
"./Services/Language/classes/class.ilLanguage.php");
317 $a_string = str_replace(
330 $a_string = preg_replace(
"/\[IF_TARGET\].*\[\/IF_TARGET\]/imsU",
"", $a_string);
332 $a_string = preg_replace(
"/\[IF_TARGET\](.*)\[\/IF_TARGET\]/imsU",
"$1", $a_string);
340 $this->attachments[$a_filename] = $a_display_name;
setUserPassword($a_pwd)
set user password
setUser(&$a_user)
Set user.
$GLOBALS['loaded']
Global hash that tracks already loaded includes.
static _lookupTitle($a_id)
lookup object title
addAttachment($a_filename, $a_display_name)
static _lookupEntry($a_lang_key, $a_mod, $a_id)
areLangVariablesUsedAsFallback()
$lang_variables_as_fallback
static _lookupNewAccountMail($a_lang)
setTarget($a_target)
set repository item target
static _lookupObjId($a_id)
& getUser()
get user object
Create styles array
The data for the language used.
static _lookupType($a_id, $a_reference=false)
lookup object type
getUserPassword()
get user password
static formatPeriod(ilDateTime $start, ilDateTime $end, $a_skip_starting_day=false)
Format a period of two date Shows: 14.
__construct()
constructor public
readAccountMail($a_lang)
get new account mail array (including subject and message body)
replacePlaceholders($a_string, &$a_user, $a_amail, $a_lang)
useLangVariablesAsFallback($a_status)