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");
72 if ($ilUser->getAuthMode(
true) !=
AUTH_LOCAL &&
73 ($ilUser->getAuthMode(
true) !=
AUTH_CAS || !$ilSetting->get(
"cas_allow_local")) &&
74 ($ilUser->getAuthMode(
true) !=
AUTH_SHIBBOLETH || !$ilSetting->get(
"shib_auth_allow_local")) &&
75 ($ilUser->getAuthMode(
true) !=
AUTH_SOAP || !$ilSetting->get(
"soap_auth_allow_local"))
78 $this->password_error = $this->lng->txt(
"not_changeable_for_non_local_auth");
82 if ($this->ilias->getSetting(
"passwd_auto_generate") == 1)
87 if ($ilUser->getAuthMode(
true) !=
AUTH_SHIBBOLETH || ! $ilSetting->get(
"shib_auth_allow_local"))
90 if (md5(
$_POST[
"current_password"]) != $ilUser->getPasswd())
92 $this->password_error = $this->lng->txt(
"passwd_wrong");
98 $this->password_error = $this->lng->txt(
"passwd_not_selected");
101 if (empty($this->password_error))
104 $ilUser->updatePassword(
$_POST[
"current_password"],
$_POST[
"new_passwd"],
$_POST[
"new_passwd"]);
110 if (md5(
$_POST[
"current_password"]) != $ilUser->getPasswd())
112 $this->password_error = $this->lng->txt(
"passwd_wrong");
115 else if (
$_POST[
"desired_password"] !=
$_POST[
"retype_password"])
117 $this->password_error = $this->lng->txt(
"passwd_not_match");
122 if( $custom_error !=
'' )
123 $this->password_error = $custom_error;
124 else $this->password_error = $this->lng->txt(
"passwd_invalid");
126 else if (
$_POST[
"current_password"] !=
"" and empty($this->password_error))
128 if( $ilUser->isPasswordExpired() || $ilUser->isPasswordChangeDemanded() )
130 if(
$_POST[
"current_password"] !=
$_POST[
"desired_password"] )
132 if( $ilUser->updatePassword(
$_POST[
"current_password"],
$_POST[
"desired_password"],
$_POST[
"retype_password"]) )
135 $ilUser->setLastPasswordChangeToNow();
140 $this->password_error = $this->lng->txt(
"new_pass_equals_old_pass");
146 $ilUser->updatePassword(
$_POST[
"current_password"],
$_POST[
"desired_password"],
$_POST[
"retype_password"]);
147 $ilUser->setLastPasswordChangeToNow();
152 $this->saveProfile();
160 public function saveMailOptions()
171 include_once
'Services/Mail/classes/class.ilMailGlobalServices.php';
174 $this->ilias->raiseError($lng->txt(
'permission_denied'), $this->ilias->error_obj->MESSAGE);
177 $lng->loadLanguageModule(
'mail');
179 $this->__initSubTabs(
'showMailOptions');
180 $ilTabs->activateTab(
'mail_settings');
184 require_once
'Services/Mail/classes/class.ilMailOptions.php';
186 if($ilSetting->get(
'usr_settings_hide_mail_incoming_mail') !=
'1' &&
187 $ilSetting->get(
'usr_settings_disable_mail_incoming_mail') !=
'1')
189 $incoming_type = (int)
$_POST[
'incoming_type'];
193 $incoming_type = $mailOptions->getIncomingType();
197 if($this->form->checkInput())
199 $mailOptions->updateOptions(
203 (
int)$_POST[
'cronjob_notification']
209 if(!isset($_POST[
'incoming_type']))
211 $_POST[
'incoming_type'] = $mailOptions->getIncomingType();
214 $this->form->setValuesByPost();
216 $this->tpl->setContent($this->form->getHTML());
227 include_once
'Services/Form/classes/class.ilPropertyFormGUI.php';
230 $this->form->setFormAction($ilCtrl->getFormAction($this,
'saveMailOptions'));
231 $this->form->setTitle($lng->txt(
'mail_settings'));
234 include_once
'Services/Mail/classes/class.ilMailOptions.php';
235 if($ilSetting->get(
'usr_settings_hide_mail_incoming_mail') !=
'1')
245 $ilSetting->get(
'usr_settings_disable_mail_incoming_mail') ==
'1')
247 $si->setDisabled(
true);
249 $this->form->addItem($si);
254 for($i = 50; $i <= 80; $i++)
260 $this->form->addItem(
$si);
266 $this->form->addItem($ta);
269 if($ilSetting->get(
'mail_notification'))
271 $cb =
new ilCheckboxInputGUI($lng->txt(
'cron_mail_notification'),
'cronjob_notification');
272 $cb->
setInfo($lng->txt(
'mail_cronjob_notification_info'));
274 $this->form->addItem($cb);
277 $this->form->addCommandButton(
'saveMailOptions', $lng->txt(
'save'));
287 require_once
'Services/Mail/classes/class.ilMailOptions.php';
291 'linebreak' => $mailOptions->getLinebreak(),
292 'signature' => $mailOptions->getSignature(),
293 'cronjob_notification' => $mailOptions->getCronjobNotification()
296 if($ilSetting->get(
'usr_settings_hide_mail_incoming_mail') !=
'1')
301 $this->form->setValuesByArray($data);
307 public function showMailOptions()
314 global $ilTabs,
$lng, $rbacsystem;
316 include_once
'Services/Mail/classes/class.ilMailGlobalServices.php';
319 $this->ilias->raiseError($lng->txt(
'permission_denied'), $this->ilias->error_obj->MESSAGE);
322 $lng->loadLanguageModule(
'mail');
324 $this->__initSubTabs(
'showMailOptions');
325 $ilTabs->activateTab(
'mail_settings');
332 $this->tpl->setContent($this->form->getHTML());
385 function __initSubTabs($a_cmd)
392 $ilHelp->setScreenIdComponent(
"user");
394 $showPassword = ($a_cmd ==
'showPassword') ?
true :
false;
395 $showGeneralSettings = ($a_cmd ==
'showGeneralSettings') ?
true :
false;
396 $showMailOptions = ($a_cmd ==
'showMailOptions') ?
true :
false;
398 $showChatOptions = ($a_cmd ==
'showChatOptions') ?
true :
false;
403 $ilTabs->addTarget(
"general_settings", $this->ctrl->getLinkTarget($this,
"showGeneralSettings"),
404 "",
"",
"", $showGeneralSettings);
409 $ilTabs->addTarget(
"password", $this->ctrl->getLinkTarget($this,
"showPassword"),
410 "",
"",
"", $showPassword);
413 include_once
'Services/Mail/classes/class.ilMailGlobalServices.php';
416 $ilTabs->addTarget(
"mail_settings", $this->ctrl->getLinkTarget($this,
"showMailOptions"),
"",
"",
"", $showMailOptions);
419 $chatSettings =
new ilSetting(
'chatroom');
420 $notificationSettings =
new ilSetting(
'notifications');
422 $chatSettings->get(
'chat_enabled',
false) &&
423 $notificationSettings->get(
'enable_osd',
false) &&
424 $chatSettings->get(
'play_invitation_sound',
false)
427 $ilTabs->addTarget(
'chat_settings', $this->ctrl->getLinkTarget($this,
'showChatOptions'),
'',
'',
'', $showChatOptions);
430 include_once
"./Services/Administration/classes/class.ilSetting.php";
438 if((
bool)$ilSetting->get(
'user_delete_own_account') &&
439 $ilUser->getId() != SYSTEM_USER_ID)
441 $ilTabs->addTab(
"delacc", $this->lng->txt(
'user_delete_own_account'),
442 $this->ctrl->getLinkTarget($this,
"deleteOwnAccount1"));
449 private function getChatSettingsForm()
457 include_once
'Services/Form/classes/class.ilPropertyFormGUI.php';
460 $form->setFormAction($this->ctrl->getFormAction($this,
'saveChatOptions'));
461 $form->setTitle($lng->txt(
"chat_settings"));
464 $chb->setOptionTitle($this->lng->txt(
'play_invitation_sound'));
465 $form->addItem($chb);
467 $form->addCommandButton(
"saveChatOptions", $lng->txt(
"save"));
475 public function saveChatOptions()
485 $chatSettings =
new ilSetting(
'chatroom');
486 $notificationSettings =
new ilSetting(
'notifications');
488 $chatSettings->get(
'chat_enabled',
false) &&
489 $notificationSettings->get(
'enable_osd',
false) &&
490 $chatSettings->get(
'play_invitation_sound',
false)
494 $ilCtrl->redirect($this);
497 $form = $this->getChatSettingsForm();
498 if(!$form->checkInput())
500 $this->showChatOptions($form);
504 $ilUser->setPref(
'chat_play_invitation_sound', (
int)$form->getInput(
'play_invitation_sound'));
505 $ilUser->writePrefs();
508 $this->showChatOptions($form);
516 $this->tpl->setVariable(
'HEADER', $this->lng->txt(
'personal_settings'));
530 $chatSettings =
new ilSetting(
'chatroom');
531 $notificationSettings =
new ilSetting(
'notifications');
533 $chatSettings->get(
'chat_enabled',
false) &&
534 $notificationSettings->get(
'enable_osd',
false) &&
535 $chatSettings->get(
'play_invitation_sound',
false)
538 $ilCtrl->redirect($this);
541 $this->__initSubTabs(
'showChatOptions');
546 $form->setValuesByPost();
550 $form = $this->getChatSettingsForm();
551 $form->setValuesByArray(array(
552 'play_invitation_sound' => $ilUser->getPref(
'chat_play_invitation_sound')
556 $this->tpl->setContent($form->getHTML());
575 $this->__initSubTabs(
"showPersonalData");
576 $ilTabs->activateTab(
"password");
581 if($ilUser->isPasswordChangeDemanded())
584 $this->lng->txt(
'password_change_on_first_login_demand')
587 else if($ilUser->isPasswordExpired())
589 $msg = $this->lng->txt(
'password_expired');
590 $password_age = $ilUser->getPasswordAge();
594 if (!$a_no_init && !$hide_form)
598 $this->tpl->setContent(!$hide_form ? $this->form->getHTML() :
'');
611 include_once(
"Services/Form/classes/class.ilPropertyFormGUI.php");
628 $cpass->setSkipSyntaxCheck(
true);
630 if($ilUser->getPasswd())
632 $cpass->setRequired(
true);
634 $this->form->addItem($cpass);
642 if ($ilSetting->get(
"passwd_auto_generate") == 1)
644 $ipass->setPreSelection(
true);
646 $this->form->addItem($ipass);
647 $this->form->addCommandButton(
"savePassword", $lng->txt(
"save"));
648 $this->form->addCommandButton(
"showPassword", $lng->txt(
"new_list_password"));
652 $this->form->addItem($ipass);
653 $this->form->addCommandButton(
"savePassword", $lng->txt(
"save"));
656 switch ($ilUser->getAuthMode(
true))
659 $this->form->setTitle($lng->txt(
"chg_password"));
664 require_once
'Services/WebDAV/classes/class.ilDAVServer.php';
667 $this->form->setTitle($lng->txt(
"chg_ilias_and_webfolder_password"));
671 $this->form->setTitle($lng->txt(
"chg_ilias_password"));
675 $this->form->setTitle($lng->txt(
"chg_ilias_password"));
678 $this->form->setFormAction($this->ctrl->getFormAction($this));
695 if ($ilUser->getAuthMode(
true) !=
AUTH_LOCAL &&
696 ($ilUser->getAuthMode(
true) !=
AUTH_CAS || !$ilSetting->get(
"cas_allow_local")) &&
697 ($ilUser->getAuthMode(
true) !=
AUTH_SHIBBOLETH || !$ilSetting->get(
"shib_auth_allow_local")) &&
698 ($ilUser->getAuthMode(
true) !=
AUTH_SOAP || !$ilSetting->get(
"soap_auth_allow_local")) &&
705 $this->ilias->getSetting(
'usr_settings_disable_password'))
723 $ilCtrl->redirect($this,
"showPersonalData");
728 if ($this->form->checkInput())
730 $cp = $this->form->getItemByPostVar(
"current_password");
731 $np = $this->form->getItemByPostVar(
"new_password");
737 #if ($ilUser->getAuthMode(true) != AUTH_SHIBBOLETH || ! $ilSetting->get("shib_auth_allow_local"))
741 if (md5($_POST[
"current_password"]) != $ilUser->getPasswd() and
742 $ilUser->getPasswd())
745 $cp->setAlert($this->lng->txt(
"passwd_wrong"));
750 if ($this->ilias->getSetting(
"passwd_auto_generate") == 1 &&
754 $np->setAlert($this->lng->txt(
"passwd_not_selected"));
758 if ($this->ilias->getSetting(
"passwd_auto_generate") != 1 &&
762 if ($custom_error !=
'')
764 $np->setAlert($custom_error);
768 $np->setAlert($this->lng->txt(
"passwd_invalid"));
773 $this->ilias->getSetting(
"passwd_auto_generate") != 1 &&
778 $np->setAlert($this->lng->txt($error_lng_var));
781 if ($this->ilias->getSetting(
"passwd_auto_generate") != 1 &&
782 ($ilUser->isPasswordExpired() || $ilUser->isPasswordChangeDemanded()) &&
783 ($_POST[
"current_password"] == $_POST[
"new_password"]))
786 $np->setAlert($this->lng->txt(
"new_pass_equals_old_pass"));
791 $ilUser->resetPassword($_POST[
"new_password"], $_POST[
"new_password"]);
792 if ($_POST[
"current_password"] != $_POST[
"new_password"])
794 $ilUser->setLastPasswordChangeToNow();
812 $this->form->setValuesByPost();
829 if ($this->settings[
"usr_settings_hide_".$setting] == 1)
833 if ($this->settings[
"usr_settings_disable_".$setting] == 1)
847 if (isset($this->settings[
"usr_settings_hide_".$setting]) &&
848 $this->settings[
"usr_settings_hide_".$setting] == 1)
862 if ($this->settings[
"usr_settings_disable_".$setting] == 1)
874 global $ilTabs, $ilToolbar,
$ilCtrl;
880 $this->__initSubTabs(
"showPersonalData");
881 $ilTabs->activateTab(
"general_settings");
889 $this->tpl->setContent($this->form->getHTML());
902 include_once(
"Services/Form/classes/class.ilPropertyFormGUI.php");
908 $languages = $this->lng->getInstalledLanguages();
910 foreach($languages as $lang_key)
917 $si->setValue($ilUser->getLanguage());
918 $si->setDisabled($ilSetting->get(
"usr_settings_disable_language"));
919 $this->form->addItem(
$si);
923 include_once(
"./Services/Style/classes/class.ilObjStyleSettings.php");
926 $templates = $styleDefinition->getAllTemplates();
927 if (is_array($templates))
932 foreach($templates as $template)
936 $styleDef->startParsing();
937 $styles = $styleDef->getStyles();
939 foreach($styles as $style)
946 $options[$template[
"id"].
":".$style[
"id"]] =
947 $styleDef->getTemplateName().
" / ".$style[
"name"];
950 $si->setOptions($options);
951 $si->setValue($ilUser->skin.
":".$ilUser->prefs[
"style"]);
952 $si->setDisabled($ilSetting->get(
"usr_settings_disable_skin_style"));
953 $this->form->addItem(
$si);
960 $cb =
new ilCheckboxInputGUI($this->lng->txt(
"user_screen_reader_optimization"),
"screen_reader_optimization");
961 $cb->
setChecked($ilUser->prefs[
"screen_reader_optimization"]);
962 $cb->setDisabled($ilSetting->get(
"usr_settings_disable_screen_reader_optimization"));
963 $cb->setInfo($this->lng->txt(
"user_screen_reader_optimization_info"));
964 $this->form->addItem($cb);
972 $hits_options = array(10,15,20,30,40,50,100,9999);
975 foreach($hits_options as $hits_option)
977 $hstr = ($hits_option == 9999)
978 ? $this->lng->txt(
"no_limit")
983 $si->setValue($ilUser->prefs[
"hits_per_page"]);
984 $si->setDisabled($ilSetting->get(
"usr_settings_disable_hits_per_page"));
985 $this->form->addItem(
$si);
994 "y" => $this->lng->txt(
"users_online_show_y"),
995 "associated" => $this->lng->txt(
"users_online_show_associated"),
996 "n" => $this->lng->txt(
"users_online_show_n"));
997 $si->setOptions($options);
998 $si->setValue($ilUser->prefs[
"show_users_online"]);
999 $si->setDisabled($ilSetting->get(
"usr_settings_disable_show_users_online"));
1000 $this->form->addItem(
$si);
1004 $lv =
new ilSelectInputGUI($this->lng->txt(
"user_store_last_visited"),
"store_last_visited");
1006 0 => $this->lng->txt(
"user_lv_keep_entries"),
1007 1 => $this->lng->txt(
"user_lv_keep_only_for_session"),
1008 2 => $this->lng->txt(
"user_lv_do_not_store"));
1009 $lv->setOptions($options);
1010 $lv->setValue((
int) $ilUser->prefs[
"store_last_visited"]);
1011 $this->form->addItem($lv);
1016 $cb =
new ilCheckboxInputGUI($this->lng->txt(
"hide_own_online_status"),
"hide_own_online_status");
1017 $cb->
setChecked($ilUser->prefs[
"hide_own_online_status"] ==
"y");
1018 $cb->setDisabled($ilSetting->get(
"usr_settings_disable_hide_own_online_status"));
1019 $this->form->addItem($cb);
1022 include_once
'Services/Authentication/classes/class.ilSessionReminder.php';
1023 if(ilSessionReminder::isGloballyActivated())
1025 $cb =
new ilCheckboxInputGUI($this->lng->txt(
'session_reminder'),
'session_reminder_enabled');
1026 $cb->
setInfo($this->lng->txt(
'session_reminder_info'));
1028 $cb->setChecked((
int)$ilUser->getPref(
'session_reminder_enabled'));
1031 $lead_time_gui =
new ilNumberInputGUI($this->lng->txt(
'session_reminder_lead_time'),
'session_reminder_lead_time');
1035 $max_value = max($min_value, ((
int)$expires / 60) - 1);
1037 $current_user_value = $ilUser->getPref(
'session_reminder_lead_time');
1038 if($current_user_value < $min_value ||
1039 $current_user_value > $max_value)
1045 $min_value, $current_user_value
1050 $lead_time_gui->setValue($value);
1051 $lead_time_gui->setSize(3);
1052 $lead_time_gui->setMinValue($min_value);
1053 $lead_time_gui->setMaxValue($max_value);
1054 $cb->addSubItem($lead_time_gui);
1056 $this->form->addItem($cb);
1062 include_once(
'Services/Calendar/classes/class.ilCalendarUserSettings.php');
1063 include_once(
'Services/Calendar/classes/class.ilCalendarUtil.php');
1064 $lng->loadLanguageModule(
"dateplaner");
1069 $select->setInfo($lng->txt(
'cal_timezone_info'));
1070 $select->setValue($user_settings->getTimeZone());
1071 $this->form->addItem($select);
1074 $select =
new ilSelectInputGUI($lng->txt(
'cal_user_date_format'),
'date_format');
1079 $select->setInfo($lng->txt(
'cal_date_format_info'));
1080 $select->setValue($user_settings->getDateFormat());
1081 $this->form->addItem($select);
1083 $select =
new ilSelectInputGUI($lng->txt(
'cal_user_time_format'),
'time_format');
1087 $select->setInfo($lng->txt(
'cal_time_format_info'));
1088 $select->setValue($user_settings->getTimeFormat());
1089 $this->form->addItem($select);
1093 include_once
"Services/User/classes/class.ilUserUtil.php";
1096 $this->lng->loadLanguageModule(
"administration");
1098 $si->setRequired(
true);
1099 $si->setInfo($this->lng->txt(
"adm_user_starting_point_info"));
1105 $this->form->addItem(
$si);
1109 $repobj_id =
new ilTextInputGUI($lng->txt(
"adm_user_starting_point_ref_id"),
"usr_start_ref_id");
1110 $repobj_id->setRequired(
true);
1111 $repobj_id->setSize(5);
1115 $repobj_id->
setValue($start_ref_id);
1121 $repobj_id->
setInfo($lng->txt(
"obj_".ilObject::_lookupType($start_obj_id)).
1126 $repobj->addSubItem($repobj_id);
1127 $si->addOption($repobj);
1132 if ($ilSetting->get(
'char_selector_availability') > 0)
1134 require_once
'Services/UIComponent/CharSelector/classes/class.ilCharSelectorGUI.php';
1136 $char_selector->getConfig()->setAvailability($ilUser->getPref(
'char_selector_availability'));
1137 $char_selector->getConfig()->setDefinition($ilUser->getPref(
'char_selector_definition'));
1138 $char_selector->addFormProperties($this->form);
1139 $char_selector->setFormValues($this->form);
1142 $this->form->addCommandButton(
"saveGeneralSettings", $lng->txt(
"save"));
1143 $this->form->setTitle($lng->txt(
"general_settings"));
1144 $this->form->setFormAction($this->ctrl->getFormAction($this));
1156 if ($this->form->checkInput())
1161 if ($_POST[
"skin_style"] !=
"")
1163 $sknst = explode(
":", $_POST[
"skin_style"]);
1165 if ($ilUser->getPref(
"style") != $sknst[1] ||
1166 $ilUser->getPref(
"skin") != $sknst[0])
1168 $ilUser->setPref(
"skin", $sknst[0]);
1169 $ilUser->setPref(
"style", $sknst[1]);
1177 $ilUser->setLanguage($_POST[
"language"]);
1183 if ($_POST[
"hits_per_page"] !=
"")
1185 $ilUser->setPref(
"hits_per_page",$_POST[
"hits_per_page"]);
1192 $ilUser->setPref(
"show_users_online", $_POST[
"show_users_online"]);
1196 global $ilNavigationHistory;
1197 $ilUser->setPref(
"store_last_visited", (
int) $_POST[
"store_last_visited"]);
1198 if ((
int) $_POST[
"store_last_visited"] > 0)
1200 $ilNavigationHistory->deleteDBEntries();
1201 if ((
int) $_POST[
"store_last_visited"] == 2)
1203 $ilNavigationHistory->deleteSessionEntries();
1210 if ($_POST[
"hide_own_online_status"] == 1)
1212 $ilUser->setPref(
"hide_own_online_status",
"y");
1216 $ilUser->setPref(
"hide_own_online_status",
"n");
1223 $ilUser->setPref(
"screen_reader_optimization", $_POST[
"screen_reader_optimization"]);
1227 include_once
'Services/Authentication/classes/class.ilSessionReminder.php';
1228 if(ilSessionReminder::isGloballyActivated())
1230 $ilUser->setPref(
'session_reminder_enabled', (
int)$this->form->getInput(
'session_reminder_enabled'));
1231 $ilUser->setPref(
'session_reminder_lead_time', $this->form->getInput(
'session_reminder_lead_time'));
1235 include_once
"Services/User/classes/class.ilUserUtil.php";
1239 $this->form->getInput(
'usr_start_ref_id'));
1244 if ($ilSetting->get(
'char_selector_availability') > 0)
1246 require_once
'Services/UIComponent/CharSelector/classes/class.ilCharSelectorGUI.php';
1248 $char_selector->getFormValues($this->form);
1249 $ilUser->setPref(
'char_selector_availability', $char_selector->getConfig()->getAvailability());
1250 $ilUser->setPref(
'char_selector_definition', $char_selector->getConfig()->getDefinition());
1256 include_once(
'Services/Calendar/classes/class.ilCalendarUserSettings.php');
1258 $user_settings->setTimeZone($this->form->getInput(
"timezone"));
1259 $user_settings->setDateFormat((
int)$this->form->getInput(
"date_format"));
1260 $user_settings->setTimeFormat((
int)$this->form->getInput(
"time_format"));
1261 $user_settings->save();
1264 $ilCtrl->redirect($this,
"showGeneralSettings");
1267 $this->form->setValuesByPost();
1278 if(!(
bool)$ilSetting->get(
'user_delete_own_account') ||
1279 $ilUser->getId() == SYSTEM_USER_ID)
1281 $this->ctrl->redirect($this,
"showGeneralSettings");
1285 $ilUser->removeDeletionFlag();
1288 $this->__initSubTabs(
"deleteOwnAccount");
1289 $ilTabs->activateTab(
"delacc");
1292 $ilToolbar->addButton($this->lng->txt(
'btn_next'),
1293 $this->ctrl->getLinkTarget($this,
'deleteOwnAccount2'));
1305 if(!(
bool)$ilSetting->get(
'user_delete_own_account') ||
1306 $ilUser->getId() == SYSTEM_USER_ID)
1308 $this->ctrl->redirect($this,
"showGeneralSettings");
1312 $this->__initSubTabs(
"deleteOwnAccount");
1313 $ilTabs->activateTab(
"delacc");
1315 include_once
"Services/Utilities/classes/class.ilConfirmationGUI.php";
1317 $cgui->setHeaderText($this->lng->txt(
'user_delete_own_account_logout_confirmation'));
1318 $cgui->setFormAction($this->ctrl->getFormAction($this));
1319 $cgui->setCancel($this->lng->txt(
"cancel"),
"abortDeleteOwnAccount");
1320 $cgui->setConfirm($this->lng->txt(
"user_delete_own_account_logout_button"),
"deleteOwnAccountLogout");
1321 $this->tpl->setContent($cgui->getHTML());
1329 $ilUser->removeDeletionFlag();
1331 ilUtil::sendInfo($this->lng->txt(
"user_delete_own_account_aborted"),
true);
1332 $ilCtrl->redirect($this,
"showGeneralSettings");
1341 $ilUser->activateDeletionFlag();
1358 if(!(
bool)$ilSetting->get(
'user_delete_own_account') ||
1359 $ilUser->getId() == SYSTEM_USER_ID ||
1360 !$ilUser->hasDeletionFlag())
1362 $this->ctrl->redirect($this,
"showGeneralSettings");
1366 $this->__initSubTabs(
"deleteOwnAccount");
1367 $ilTabs->activateTab(
"delacc");
1369 include_once
"Services/Utilities/classes/class.ilConfirmationGUI.php";
1371 $cgui->setHeaderText($this->lng->txt(
'user_delete_own_account_final_confirmation'));
1372 $cgui->setFormAction($this->ctrl->getFormAction($this));
1373 $cgui->setCancel($this->lng->txt(
"cancel"),
"abortDeleteOwnAccount");
1374 $cgui->setConfirm($this->lng->txt(
"confirm"),
"deleteOwnAccount4");
1375 $this->tpl->setContent($cgui->getHTML());
1386 if(!(
bool)$ilSetting->get(
'user_delete_own_account') ||
1387 $ilUser->getId() == SYSTEM_USER_ID ||
1388 !$ilUser->hasDeletionFlag())
1390 $this->ctrl->redirect($this,
"showGeneralSettings");
1395 include_once
"./Services/Notification/classes/class.ilSystemNotification.php";
1397 $ntf->setLangModules(array(
"user"));
1398 $ntf->addAdditionalInfo(
"profile", $ilUser->getProfileAsString($this->lng),
true);
1402 $ntf->setIntroductionDirect(
1403 sprintf($this->lng->txt(
"user_delete_own_account_email_body"),
1404 $ilUser->getLogin(),
1408 $message = $ntf->composeAndGetMessage($ilUser->getId(), null, null,
true);
1409 $subject = $this->lng->txt(
"user_delete_own_account_email_subject");
1414 include_once
"Services/Mail/classes/class.ilMail.php";
1415 $mail =
new ilMail(ANONYMOUS_USER_ID);
1417 $user_email = $ilUser->getEmail();
1418 $admin_mail = $ilSetting->get(
"user_delete_own_account_email");
1423 $mail->sendMimeMail($user_email, null, $admin_mail, $subject, $message, null,
true);
1426 else if($admin_mail)
1428 $mail->sendMimeMail($admin_mail, null, null, $subject, $message, null,
true);
1431 $ilLog->write(
"Account deleted: ".$ilUser->getLogin().
" (".$ilUser->getId().
")");