25 include_once
'./Services/User/classes/class.ilUserDefinedFields.php';
32 $this->settings = $ilias->getAllSettings();
34 $lng->loadLanguageModule(
'chatroom');
35 $lng->loadLanguageModule(
'chatroom_adm');
36 $this->upload_error =
"";
37 $this->password_error =
"";
38 $lng->loadLanguageModule(
"user");
39 $ilCtrl->saveParameter($this,
"user_page");
49 $next_class = $this->ctrl->getNextClass();
55 $cmd = $this->ctrl->getCmd(
"showGeneralSettings");
66 public function saveMailOptions()
77 include_once
'Services/Mail/classes/class.ilMailGlobalServices.php';
80 $this->ilias->raiseError($lng->txt(
'permission_denied'), $this->ilias->error_obj->MESSAGE);
83 $lng->loadLanguageModule(
'mail');
85 $this->__initSubTabs(
'showMailOptions');
86 $ilTabs->activateTab(
'mail_settings');
90 require_once
'Services/Mail/classes/class.ilMailOptions.php';
92 if($ilSetting->get(
'usr_settings_hide_mail_incoming_mail') !=
'1' &&
93 $ilSetting->get(
'usr_settings_disable_mail_incoming_mail') !=
'1')
95 $incoming_type = (int)
$_POST[
'incoming_type'];
99 $incoming_type = $mailOptions->getIncomingType();
103 if($this->form->checkInput())
105 $mailOptions->updateOptions(
109 (
int)$_POST[
'cronjob_notification']
115 if(!isset($_POST[
'incoming_type']))
117 $_POST[
'incoming_type'] = $mailOptions->getIncomingType();
120 $this->form->setValuesByPost();
122 $this->tpl->setContent($this->form->getHTML());
133 include_once
'Services/Form/classes/class.ilPropertyFormGUI.php';
136 $this->form->setFormAction($ilCtrl->getFormAction($this,
'saveMailOptions'));
137 $this->form->setTitle($lng->txt(
'mail_settings'));
140 include_once
'Services/Mail/classes/class.ilMailOptions.php';
141 if($ilSetting->get(
'usr_settings_hide_mail_incoming_mail') !=
'1')
151 $ilSetting->get(
'usr_settings_disable_mail_incoming_mail') ==
'1')
153 $si->setDisabled(
true);
155 $this->form->addItem($si);
160 for($i = 50; $i <= 80; $i++)
166 $this->form->addItem(
$si);
172 $this->form->addItem($ta);
175 if($ilSetting->get(
'mail_notification'))
177 $cb =
new ilCheckboxInputGUI($lng->txt(
'cron_mail_notification'),
'cronjob_notification');
178 $cb->
setInfo($lng->txt(
'mail_cronjob_notification_info'));
180 $this->form->addItem($cb);
183 $this->form->addCommandButton(
'saveMailOptions', $lng->txt(
'save'));
193 require_once
'Services/Mail/classes/class.ilMailOptions.php';
197 'linebreak' => $mailOptions->getLinebreak(),
198 'signature' => $mailOptions->getSignature(),
199 'cronjob_notification' => $mailOptions->getCronjobNotification()
202 if($ilSetting->get(
'usr_settings_hide_mail_incoming_mail') !=
'1')
207 $this->form->setValuesByArray($data);
213 public function showMailOptions()
220 global $ilTabs,
$lng, $rbacsystem;
222 include_once
'Services/Mail/classes/class.ilMailGlobalServices.php';
225 $this->ilias->raiseError($lng->txt(
'permission_denied'), $this->ilias->error_obj->MESSAGE);
228 $lng->loadLanguageModule(
'mail');
230 $this->__initSubTabs(
'showMailOptions');
231 $ilTabs->activateTab(
'mail_settings');
238 $this->tpl->setContent($this->form->getHTML());
291 function __initSubTabs($a_cmd)
298 $ilHelp->setScreenIdComponent(
"user");
300 $showPassword = ($a_cmd ==
'showPassword') ?
true :
false;
301 $showGeneralSettings = ($a_cmd ==
'showGeneralSettings') ?
true :
false;
302 $showMailOptions = ($a_cmd ==
'showMailOptions') ?
true :
false;
304 $showChatOptions = ($a_cmd ==
'showChatOptions') ?
true :
false;
309 $ilTabs->addTarget(
"general_settings", $this->ctrl->getLinkTarget($this,
"showGeneralSettings"),
310 "",
"",
"", $showGeneralSettings);
315 $ilTabs->addTarget(
"password", $this->ctrl->getLinkTarget($this,
"showPassword"),
316 "",
"",
"", $showPassword);
319 include_once
'Services/Mail/classes/class.ilMailGlobalServices.php';
322 $ilTabs->addTarget(
"mail_settings", $this->ctrl->getLinkTarget($this,
"showMailOptions"),
"",
"",
"", $showMailOptions);
325 $chatSettings =
new ilSetting(
'chatroom');
326 $notificationSettings =
new ilSetting(
'notifications');
328 $chatSettings->get(
'chat_enabled',
false) &&
329 $notificationSettings->get(
'enable_osd',
false) &&
330 $chatSettings->get(
'play_invitation_sound',
false)
333 $ilTabs->addTarget(
'chat_settings', $this->ctrl->getLinkTarget($this,
'showChatOptions'),
'',
'',
'', $showChatOptions);
336 include_once
"./Services/Administration/classes/class.ilSetting.php";
344 if((
bool)$ilSetting->get(
'user_delete_own_account') &&
345 $ilUser->getId() != SYSTEM_USER_ID)
347 $ilTabs->addTab(
"delacc", $this->lng->txt(
'user_delete_own_account'),
348 $this->ctrl->getLinkTarget($this,
"deleteOwnAccount1"));
355 private function getChatSettingsForm()
363 include_once
'Services/Form/classes/class.ilPropertyFormGUI.php';
366 $form->setFormAction($this->ctrl->getFormAction($this,
'saveChatOptions'));
367 $form->setTitle($lng->txt(
"chat_settings"));
370 $chb->setOptionTitle($this->lng->txt(
'play_invitation_sound'));
371 $form->addItem($chb);
373 $form->addCommandButton(
"saveChatOptions", $lng->txt(
"save"));
381 public function saveChatOptions()
391 $chatSettings =
new ilSetting(
'chatroom');
392 $notificationSettings =
new ilSetting(
'notifications');
394 $chatSettings->get(
'chat_enabled',
false) &&
395 $notificationSettings->get(
'enable_osd',
false) &&
396 $chatSettings->get(
'play_invitation_sound',
false)
400 $ilCtrl->redirect($this);
403 $form = $this->getChatSettingsForm();
404 if(!$form->checkInput())
406 $this->showChatOptions($form);
410 $ilUser->setPref(
'chat_play_invitation_sound', (
int)$form->getInput(
'play_invitation_sound'));
411 $ilUser->writePrefs();
414 $this->showChatOptions($form);
422 $this->tpl->setVariable(
'HEADER', $this->lng->txt(
'personal_settings'));
436 $chatSettings =
new ilSetting(
'chatroom');
437 $notificationSettings =
new ilSetting(
'notifications');
439 $chatSettings->get(
'chat_enabled',
false) &&
440 $notificationSettings->get(
'enable_osd',
false) &&
441 $chatSettings->get(
'play_invitation_sound',
false)
444 $ilCtrl->redirect($this);
447 $this->__initSubTabs(
'showChatOptions');
452 $form->setValuesByPost();
456 $form = $this->getChatSettingsForm();
457 $form->setValuesByArray(array(
458 'play_invitation_sound' => $ilUser->getPref(
'chat_play_invitation_sound')
462 $this->tpl->setContent($form->getHTML());
481 $this->__initSubTabs(
"showPersonalData");
482 $ilTabs->activateTab(
"password");
487 if($ilUser->isPasswordChangeDemanded())
490 $this->lng->txt(
'password_change_on_first_login_demand')
493 else if($ilUser->isPasswordExpired())
495 $msg = $this->lng->txt(
'password_expired');
496 $password_age = $ilUser->getPasswordAge();
500 if (!$a_no_init && !$hide_form)
504 $this->tpl->setContent(!$hide_form ? $this->form->getHTML() :
'');
517 include_once(
"Services/Form/classes/class.ilPropertyFormGUI.php");
534 $cpass->setSkipSyntaxCheck(
true);
536 if($ilUser->getPasswd())
538 $cpass->setRequired(
true);
540 $this->form->addItem($cpass);
548 if ($ilSetting->get(
"passwd_auto_generate") == 1)
550 $ipass->setPreSelection(
true);
552 $this->form->addItem($ipass);
553 $this->form->addCommandButton(
"savePassword", $lng->txt(
"save"));
554 $this->form->addCommandButton(
"showPassword", $lng->txt(
"new_list_password"));
558 $this->form->addItem($ipass);
559 $this->form->addCommandButton(
"savePassword", $lng->txt(
"save"));
562 switch ($ilUser->getAuthMode(
true))
565 $this->form->setTitle($lng->txt(
"chg_password"));
570 require_once
'Services/WebDAV/classes/class.ilDAVServer.php';
573 $this->form->setTitle($lng->txt(
"chg_ilias_and_webfolder_password"));
577 $this->form->setTitle($lng->txt(
"chg_ilias_password"));
581 $this->form->setTitle($lng->txt(
"chg_ilias_password"));
584 $this->form->setFormAction($this->ctrl->getFormAction($this));
601 if ($ilUser->getAuthMode(
true) !=
AUTH_LOCAL &&
602 ($ilUser->getAuthMode(
true) !=
AUTH_CAS || !$ilSetting->get(
"cas_allow_local")) &&
603 ($ilUser->getAuthMode(
true) !=
AUTH_SHIBBOLETH || !$ilSetting->get(
"shib_auth_allow_local")) &&
604 ($ilUser->getAuthMode(
true) !=
AUTH_SOAP || !$ilSetting->get(
"soap_auth_allow_local")) &&
611 $this->ilias->getSetting(
'usr_settings_disable_password'))
629 $ilCtrl->redirect($this,
"showPersonalData");
634 if ($this->form->checkInput())
636 $cp = $this->form->getItemByPostVar(
"current_password");
637 $np = $this->form->getItemByPostVar(
"new_password");
643 #if ($ilUser->getAuthMode(true) != AUTH_SHIBBOLETH || ! $ilSetting->get("shib_auth_allow_local"))
646 require_once
'Services/User/classes/class.ilUserPasswordManager.php';
647 if(!ilUserPasswordManager::getInstance()->verifyPassword($ilUser,
ilUtil::stripSlashes($_POST[
'current_password'])))
650 $cp->setAlert($this->lng->txt(
'passwd_wrong'));
655 if ($this->ilias->getSetting(
"passwd_auto_generate") == 1 &&
659 $np->setAlert($this->lng->txt(
"passwd_not_selected"));
663 if ($this->ilias->getSetting(
"passwd_auto_generate") != 1 &&
667 if ($custom_error !=
'')
669 $np->setAlert($custom_error);
673 $np->setAlert($this->lng->txt(
"passwd_invalid"));
678 $this->ilias->getSetting(
"passwd_auto_generate") != 1 &&
683 $np->setAlert($this->lng->txt($error_lng_var));
686 if ($this->ilias->getSetting(
"passwd_auto_generate") != 1 &&
687 ($ilUser->isPasswordExpired() || $ilUser->isPasswordChangeDemanded()) &&
688 ($_POST[
"current_password"] == $_POST[
"new_password"]))
691 $np->setAlert($this->lng->txt(
"new_pass_equals_old_pass"));
696 $ilUser->resetPassword($_POST[
"new_password"], $_POST[
"new_password"]);
697 if ($_POST[
"current_password"] != $_POST[
"new_password"])
699 $ilUser->setLastPasswordChangeToNow();
717 $this->form->setValuesByPost();
734 if ($this->settings[
"usr_settings_hide_".$setting] == 1)
738 if ($this->settings[
"usr_settings_disable_".$setting] == 1)
752 if (isset($this->settings[
"usr_settings_hide_".$setting]) &&
753 $this->settings[
"usr_settings_hide_".$setting] == 1)
767 if ($this->settings[
"usr_settings_disable_".$setting] == 1)
779 global $ilTabs, $ilToolbar,
$ilCtrl;
785 $this->__initSubTabs(
"showPersonalData");
786 $ilTabs->activateTab(
"general_settings");
794 $this->tpl->setContent($this->form->getHTML());
807 include_once(
"Services/Form/classes/class.ilPropertyFormGUI.php");
813 $languages = $this->lng->getInstalledLanguages();
815 foreach($languages as $lang_key)
822 $si->setValue($ilUser->getLanguage());
823 $si->setDisabled($ilSetting->get(
"usr_settings_disable_language"));
824 $this->form->addItem(
$si);
828 include_once(
"./Services/Style/classes/class.ilObjStyleSettings.php");
831 $templates = $styleDefinition->getAllTemplates();
832 if (is_array($templates))
837 foreach($templates as $template)
841 $styleDef->startParsing();
842 $styles = $styleDef->getStyles();
844 foreach($styles as $style)
851 $options[$template[
"id"].
":".$style[
"id"]] =
852 $styleDef->getTemplateName().
" / ".$style[
"name"];
855 $si->setOptions($options);
856 $si->setValue($ilUser->skin.
":".$ilUser->prefs[
"style"]);
857 $si->setDisabled($ilSetting->get(
"usr_settings_disable_skin_style"));
858 $this->form->addItem(
$si);
865 $cb =
new ilCheckboxInputGUI($this->lng->txt(
"user_screen_reader_optimization"),
"screen_reader_optimization");
866 $cb->
setChecked($ilUser->prefs[
"screen_reader_optimization"]);
867 $cb->setDisabled($ilSetting->get(
"usr_settings_disable_screen_reader_optimization"));
868 $cb->setInfo($this->lng->txt(
"user_screen_reader_optimization_info"));
869 $this->form->addItem($cb);
877 $hits_options = array(10,15,20,30,40,50,100,9999);
880 foreach($hits_options as $hits_option)
882 $hstr = ($hits_option == 9999)
883 ? $this->lng->txt(
"no_limit")
888 $si->setValue($ilUser->prefs[
"hits_per_page"]);
889 $si->setDisabled($ilSetting->get(
"usr_settings_disable_hits_per_page"));
890 $this->form->addItem(
$si);
899 "y" => $this->lng->txt(
"users_online_show_y"),
900 "associated" => $this->lng->txt(
"users_online_show_associated"),
901 "n" => $this->lng->txt(
"users_online_show_n"));
902 $si->setOptions($options);
903 $si->setValue($ilUser->prefs[
"show_users_online"]);
904 $si->setDisabled($ilSetting->get(
"usr_settings_disable_show_users_online"));
905 $this->form->addItem(
$si);
909 $lv =
new ilSelectInputGUI($this->lng->txt(
"user_store_last_visited"),
"store_last_visited");
911 0 => $this->lng->txt(
"user_lv_keep_entries"),
912 1 => $this->lng->txt(
"user_lv_keep_only_for_session"),
913 2 => $this->lng->txt(
"user_lv_do_not_store"));
914 $lv->setOptions($options);
915 $lv->setValue((
int) $ilUser->prefs[
"store_last_visited"]);
916 $this->form->addItem($lv);
921 $cb =
new ilCheckboxInputGUI($this->lng->txt(
"hide_own_online_status"),
"hide_own_online_status");
922 $cb->
setChecked($ilUser->prefs[
"hide_own_online_status"] ==
"y");
923 $cb->setDisabled($ilSetting->get(
"usr_settings_disable_hide_own_online_status"));
924 $this->form->addItem($cb);
927 include_once
'Services/Authentication/classes/class.ilSessionReminder.php';
928 if(ilSessionReminder::isGloballyActivated())
930 $cb =
new ilCheckboxInputGUI($this->lng->txt(
'session_reminder'),
'session_reminder_enabled');
931 $cb->
setInfo($this->lng->txt(
'session_reminder_info'));
933 $cb->setChecked((
int)$ilUser->getPref(
'session_reminder_enabled'));
936 $lead_time_gui =
new ilNumberInputGUI($this->lng->txt(
'session_reminder_lead_time'),
'session_reminder_lead_time');
940 $max_value = max($min_value, ((
int)$expires / 60) - 1);
942 $current_user_value = $ilUser->getPref(
'session_reminder_lead_time');
943 if($current_user_value < $min_value ||
944 $current_user_value > $max_value)
950 $min_value, $current_user_value
955 $lead_time_gui->setValue($value);
956 $lead_time_gui->setSize(3);
957 $lead_time_gui->setMinValue($min_value);
958 $lead_time_gui->setMaxValue($max_value);
959 $cb->addSubItem($lead_time_gui);
961 $this->form->addItem($cb);
967 include_once(
'Services/Calendar/classes/class.ilCalendarUserSettings.php');
968 include_once(
'Services/Calendar/classes/class.ilCalendarUtil.php');
969 $lng->loadLanguageModule(
"dateplaner");
974 $select->setInfo($lng->txt(
'cal_timezone_info'));
975 $select->setValue($user_settings->getTimeZone());
976 $this->form->addItem($select);
979 $select =
new ilSelectInputGUI($lng->txt(
'cal_user_date_format'),
'date_format');
984 $select->setInfo($lng->txt(
'cal_date_format_info'));
985 $select->setValue($user_settings->getDateFormat());
986 $this->form->addItem($select);
988 $select =
new ilSelectInputGUI($lng->txt(
'cal_user_time_format'),
'time_format');
992 $select->setInfo($lng->txt(
'cal_time_format_info'));
993 $select->setValue($user_settings->getTimeFormat());
994 $this->form->addItem($select);
998 include_once
"Services/User/classes/class.ilUserUtil.php";
1001 $this->lng->loadLanguageModule(
"administration");
1003 $si->setRequired(
true);
1004 $si->setInfo($this->lng->txt(
"adm_user_starting_point_info"));
1005 $def_opt =
new ilRadioOption($this->lng->txt(
"adm_user_starting_point_inherit"), 0);
1006 $def_opt->
setInfo($this->lng->txt(
"adm_user_starting_point_inherit_info"));
1007 $si->addOption($def_opt);
1015 $this->form->addItem(
$si);
1019 $repobj_id =
new ilTextInputGUI($lng->txt(
"adm_user_starting_point_ref_id"),
"usr_start_ref_id");
1020 $repobj_id->setRequired(
true);
1021 $repobj_id->setSize(5);
1025 $repobj_id->
setValue($start_ref_id);
1031 $repobj_id->
setInfo($lng->txt(
"obj_".ilObject::_lookupType($start_obj_id)).
1036 $repobj->addSubItem($repobj_id);
1037 $si->addOption($repobj);
1042 if ($ilSetting->get(
'char_selector_availability') > 0)
1044 require_once
'Services/UIComponent/CharSelector/classes/class.ilCharSelectorGUI.php';
1046 $char_selector->getConfig()->setAvailability($ilUser->getPref(
'char_selector_availability'));
1047 $char_selector->getConfig()->setDefinition($ilUser->getPref(
'char_selector_definition'));
1048 $char_selector->addFormProperties($this->form);
1049 $char_selector->setFormValues($this->form);
1052 $this->form->addCommandButton(
"saveGeneralSettings", $lng->txt(
"save"));
1053 $this->form->setTitle($lng->txt(
"general_settings"));
1054 $this->form->setFormAction($this->ctrl->getFormAction($this));
1066 if ($this->form->checkInput())
1071 if ($_POST[
"skin_style"] !=
"")
1073 $sknst = explode(
":", $_POST[
"skin_style"]);
1075 if ($ilUser->getPref(
"style") != $sknst[1] ||
1076 $ilUser->getPref(
"skin") != $sknst[0])
1078 $ilUser->setPref(
"skin", $sknst[0]);
1079 $ilUser->setPref(
"style", $sknst[1]);
1087 $ilUser->setLanguage($_POST[
"language"]);
1093 if ($_POST[
"hits_per_page"] !=
"")
1095 $ilUser->setPref(
"hits_per_page",$_POST[
"hits_per_page"]);
1102 $ilUser->setPref(
"show_users_online", $_POST[
"show_users_online"]);
1106 global $ilNavigationHistory;
1107 $ilUser->setPref(
"store_last_visited", (
int) $_POST[
"store_last_visited"]);
1108 if ((
int) $_POST[
"store_last_visited"] > 0)
1110 $ilNavigationHistory->deleteDBEntries();
1111 if ((
int) $_POST[
"store_last_visited"] == 2)
1113 $ilNavigationHistory->deleteSessionEntries();
1120 if ($_POST[
"hide_own_online_status"] == 1)
1122 $ilUser->setPref(
"hide_own_online_status",
"y");
1126 $ilUser->setPref(
"hide_own_online_status",
"n");
1133 $ilUser->setPref(
"screen_reader_optimization", $_POST[
"screen_reader_optimization"]);
1137 include_once
'Services/Authentication/classes/class.ilSessionReminder.php';
1138 if(ilSessionReminder::isGloballyActivated())
1140 $ilUser->setPref(
'session_reminder_enabled', (
int)$this->form->getInput(
'session_reminder_enabled'));
1141 $ilUser->setPref(
'session_reminder_lead_time', $this->form->getInput(
'session_reminder_lead_time'));
1145 include_once
"Services/User/classes/class.ilUserUtil.php";
1149 $this->form->getInput(
'usr_start_ref_id'));
1154 if ($ilSetting->get(
'char_selector_availability') > 0)
1156 require_once
'Services/UIComponent/CharSelector/classes/class.ilCharSelectorGUI.php';
1158 $char_selector->getFormValues($this->form);
1159 $ilUser->setPref(
'char_selector_availability', $char_selector->getConfig()->getAvailability());
1160 $ilUser->setPref(
'char_selector_definition', $char_selector->getConfig()->getDefinition());
1166 include_once(
'Services/Calendar/classes/class.ilCalendarUserSettings.php');
1168 $user_settings->setTimeZone($this->form->getInput(
"timezone"));
1169 $user_settings->setDateFormat((
int)$this->form->getInput(
"date_format"));
1170 $user_settings->setTimeFormat((
int)$this->form->getInput(
"time_format"));
1171 $user_settings->save();
1174 $ilCtrl->redirect($this,
"showGeneralSettings");
1177 $this->form->setValuesByPost();
1188 if(!(
bool)$ilSetting->get(
'user_delete_own_account') ||
1189 $ilUser->getId() == SYSTEM_USER_ID)
1191 $this->ctrl->redirect($this,
"showGeneralSettings");
1195 $ilUser->removeDeletionFlag();
1198 $this->__initSubTabs(
"deleteOwnAccount");
1199 $ilTabs->activateTab(
"delacc");
1202 $ilToolbar->addButton($this->lng->txt(
'btn_next'),
1203 $this->ctrl->getLinkTarget($this,
'deleteOwnAccount2'));
1215 if(!(
bool)$ilSetting->get(
'user_delete_own_account') ||
1216 $ilUser->getId() == SYSTEM_USER_ID)
1218 $this->ctrl->redirect($this,
"showGeneralSettings");
1222 $this->__initSubTabs(
"deleteOwnAccount");
1223 $ilTabs->activateTab(
"delacc");
1225 include_once
"Services/Utilities/classes/class.ilConfirmationGUI.php";
1227 $cgui->setHeaderText($this->lng->txt(
'user_delete_own_account_logout_confirmation'));
1228 $cgui->setFormAction($this->ctrl->getFormAction($this));
1229 $cgui->setCancel($this->lng->txt(
"cancel"),
"abortDeleteOwnAccount");
1230 $cgui->setConfirm($this->lng->txt(
"user_delete_own_account_logout_button"),
"deleteOwnAccountLogout");
1231 $this->tpl->setContent($cgui->getHTML());
1239 $ilUser->removeDeletionFlag();
1241 ilUtil::sendInfo($this->lng->txt(
"user_delete_own_account_aborted"),
true);
1242 $ilCtrl->redirect($this,
"showGeneralSettings");
1251 $ilUser->activateDeletionFlag();
1268 if(!(
bool)$ilSetting->get(
'user_delete_own_account') ||
1269 $ilUser->getId() == SYSTEM_USER_ID ||
1270 !$ilUser->hasDeletionFlag())
1272 $this->ctrl->redirect($this,
"showGeneralSettings");
1276 $this->__initSubTabs(
"deleteOwnAccount");
1277 $ilTabs->activateTab(
"delacc");
1279 include_once
"Services/Utilities/classes/class.ilConfirmationGUI.php";
1281 $cgui->setHeaderText($this->lng->txt(
'user_delete_own_account_final_confirmation'));
1282 $cgui->setFormAction($this->ctrl->getFormAction($this));
1283 $cgui->setCancel($this->lng->txt(
"cancel"),
"abortDeleteOwnAccount");
1284 $cgui->setConfirm($this->lng->txt(
"confirm"),
"deleteOwnAccount4");
1285 $this->tpl->setContent($cgui->getHTML());
1296 if(!(
bool)$ilSetting->get(
'user_delete_own_account') ||
1297 $ilUser->getId() == SYSTEM_USER_ID ||
1298 !$ilUser->hasDeletionFlag())
1300 $this->ctrl->redirect($this,
"showGeneralSettings");
1305 include_once
"./Services/Notification/classes/class.ilSystemNotification.php";
1307 $ntf->setLangModules(array(
"user"));
1308 $ntf->addAdditionalInfo(
"profile", $ilUser->getProfileAsString($this->lng),
true);
1312 $ntf->setIntroductionDirect(
1313 sprintf($this->lng->txt(
"user_delete_own_account_email_body"),
1314 $ilUser->getLogin(),
1318 $message = $ntf->composeAndGetMessage($ilUser->getId(), null, null,
true);
1319 $subject = $this->lng->txt(
"user_delete_own_account_email_subject");
1324 include_once
"Services/Mail/classes/class.ilMail.php";
1325 $mail =
new ilMail(ANONYMOUS_USER_ID);
1327 $user_email = $ilUser->getEmail();
1328 $admin_mail = $ilSetting->get(
"user_delete_own_account_email");
1333 $mail->sendMimeMail($user_email, null, $admin_mail, $subject, $message, null,
true);
1336 else if($admin_mail)
1338 $mail->sendMimeMail($admin_mail, null, null, $subject, $message, null,
true);
1341 $ilLog->write(
"Account deleted: ".$ilUser->getLogin().
" (".$ilUser->getId().
")");