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");
59 if( $ilUser->isPasswordChangeDemanded() &&
$cmd !=
'savePassword' )
61 $cmd =
'showPassword';
64 $this->lng->txt(
'password_change_on_first_login_demand'), true
67 elseif( $ilUser->isPasswordExpired() &&
$cmd !=
'savePassword' )
69 $cmd =
'showPassword';
71 $msg = $this->lng->txt(
'password_expired');
72 $password_age = $ilUser->getPasswordAge();
93 if ($ilUser->getAuthMode(
true) !=
AUTH_LOCAL &&
94 ($ilUser->getAuthMode(
true) !=
AUTH_CAS || !$ilSetting->get(
"cas_allow_local")) &&
95 ($ilUser->getAuthMode(
true) !=
AUTH_SHIBBOLETH || !$ilSetting->get(
"shib_auth_allow_local")) &&
96 ($ilUser->getAuthMode(
true) !=
AUTH_SOAP || !$ilSetting->get(
"soap_auth_allow_local"))
99 $this->password_error = $this->lng->txt(
"not_changeable_for_non_local_auth");
103 if ($this->ilias->getSetting(
"passwd_auto_generate") == 1)
108 if ($ilUser->getAuthMode(
true) !=
AUTH_SHIBBOLETH || ! $ilSetting->get(
"shib_auth_allow_local"))
111 if (md5(
$_POST[
"current_password"]) != $ilUser->getPasswd())
113 $this->password_error = $this->lng->txt(
"passwd_wrong");
119 $this->password_error = $this->lng->txt(
"passwd_not_selected");
122 if (empty($this->password_error))
125 $ilUser->updatePassword(
$_POST[
"current_password"],
$_POST[
"new_passwd"],
$_POST[
"new_passwd"]);
131 if (md5(
$_POST[
"current_password"]) != $ilUser->getPasswd())
133 $this->password_error = $this->lng->txt(
"passwd_wrong");
136 else if (
$_POST[
"desired_password"] !=
$_POST[
"retype_password"])
138 $this->password_error = $this->lng->txt(
"passwd_not_match");
143 if( $custom_error !=
'' )
144 $this->password_error = $custom_error;
145 else $this->password_error = $this->lng->txt(
"passwd_invalid");
147 else if (
$_POST[
"current_password"] !=
"" and empty($this->password_error))
149 if( $ilUser->isPasswordExpired() || $ilUser->isPasswordChangeDemanded() )
151 if(
$_POST[
"current_password"] !=
$_POST[
"desired_password"] )
153 if( $ilUser->updatePassword(
$_POST[
"current_password"],
$_POST[
"desired_password"],
$_POST[
"retype_password"]) )
156 $ilUser->setLastPasswordChangeToNow();
161 $this->password_error = $this->lng->txt(
"new_pass_equals_old_pass");
167 $ilUser->updatePassword(
$_POST[
"current_password"],
$_POST[
"desired_password"],
$_POST[
"retype_password"]);
168 $ilUser->setLastPasswordChangeToNow();
173 $this->saveProfile();
181 public function saveMailOptions()
192 include_once
'Services/Mail/classes/class.ilMailGlobalServices.php';
195 $this->ilias->raiseError($lng->txt(
'permission_denied'), $this->ilias->error_obj->MESSAGE);
198 $lng->loadLanguageModule(
'mail');
200 $this->__initSubTabs(
'showMailOptions');
201 $ilTabs->activateTab(
'mail_settings');
205 require_once
'Services/Mail/classes/class.ilMailOptions.php';
207 if($ilSetting->get(
'usr_settings_hide_mail_incoming_mail') !=
'1' &&
208 $ilSetting->get(
'usr_settings_disable_mail_incoming_mail') !=
'1')
210 $incoming_type = (int)
$_POST[
'incoming_type'];
214 $incoming_type = $mailOptions->getIncomingType();
218 if($this->form->checkInput())
220 $mailOptions->updateOptions(
224 (
int)$_POST[
'cronjob_notification']
230 if(!isset($_POST[
'incoming_type']))
232 $_POST[
'incoming_type'] = $mailOptions->getIncomingType();
235 $this->form->setValuesByPost();
237 $this->tpl->setContent($this->form->getHTML());
248 include_once
'Services/Form/classes/class.ilPropertyFormGUI.php';
251 $this->form->setFormAction($ilCtrl->getFormAction($this,
'saveMailOptions'));
252 $this->form->setTitle($lng->txt(
'mail_settings'));
255 include_once
'Services/Mail/classes/class.ilMailOptions.php';
256 if($ilSetting->get(
'usr_settings_hide_mail_incoming_mail') !=
'1')
266 $ilSetting->get(
'usr_settings_disable_mail_incoming_mail') ==
'1')
268 $si->setDisabled(
true);
270 $this->form->addItem($si);
275 for($i = 50; $i <= 80; $i++)
280 $si->setOptions($options);
281 $this->form->addItem(
$si);
287 $this->form->addItem($ta);
290 if($ilSetting->get(
'mail_notification'))
292 $cb =
new ilCheckboxInputGUI($lng->txt(
'cron_mail_notification'),
'cronjob_notification');
293 $cb->
setInfo($lng->txt(
'mail_cronjob_notification_info'));
295 $this->form->addItem($cb);
298 $this->form->addCommandButton(
'saveMailOptions', $lng->txt(
'save'));
308 require_once
'Services/Mail/classes/class.ilMailOptions.php';
312 'linebreak' => $mailOptions->getLinebreak(),
313 'signature' => $mailOptions->getSignature(),
314 'cronjob_notification' => $mailOptions->getCronjobNotification()
317 if($ilSetting->get(
'usr_settings_hide_mail_incoming_mail') !=
'1')
322 $this->form->setValuesByArray($data);
328 public function showMailOptions()
335 global $ilTabs,
$lng, $rbacsystem;
337 include_once
'Services/Mail/classes/class.ilMailGlobalServices.php';
340 $this->ilias->raiseError($lng->txt(
'permission_denied'), $this->ilias->error_obj->MESSAGE);
343 $lng->loadLanguageModule(
'mail');
345 $this->__initSubTabs(
'showMailOptions');
346 $ilTabs->activateTab(
'mail_settings');
353 $this->tpl->setContent($this->form->getHTML());
406 function __initSubTabs($a_cmd)
413 $ilHelp->setScreenIdComponent(
"user");
415 $showPassword = ($a_cmd ==
'showPassword') ?
true :
false;
416 $showGeneralSettings = ($a_cmd ==
'showGeneralSettings') ?
true :
false;
417 $showMailOptions = ($a_cmd ==
'showMailOptions') ?
true :
false;
419 $showChatOptions = ($a_cmd ==
'showChatOptions') ?
true :
false;
424 $ilTabs->addTarget(
"general_settings", $this->ctrl->getLinkTarget($this,
"showGeneralSettings"),
425 "",
"",
"", $showGeneralSettings);
430 $ilTabs->addTarget(
"password", $this->ctrl->getLinkTarget($this,
"showPassword"),
431 "",
"",
"", $showPassword);
434 include_once
'Services/Mail/classes/class.ilMailGlobalServices.php';
437 $ilTabs->addTarget(
"mail_settings", $this->ctrl->getLinkTarget($this,
"showMailOptions"),
"",
"",
"", $showMailOptions);
440 $chatSettings =
new ilSetting(
'chatroom');
441 $notificationSettings =
new ilSetting(
'notifications');
443 $chatSettings->get(
'chat_enabled',
false) &&
444 $notificationSettings->get(
'enable_osd',
false) &&
445 $chatSettings->get(
'play_invitation_sound',
false)
448 $ilTabs->addTarget(
'chat_settings', $this->ctrl->getLinkTarget($this,
'showChatOptions'),
'',
'',
'', $showChatOptions);
451 include_once
"./Services/Administration/classes/class.ilSetting.php";
459 if((
bool)$ilSetting->get(
'user_delete_own_account') &&
460 $ilUser->getId() != SYSTEM_USER_ID)
462 $ilTabs->addTab(
"delacc", $this->lng->txt(
'user_delete_own_account'),
463 $this->ctrl->getLinkTarget($this,
"deleteOwnAccount1"));
470 private function getChatSettingsForm()
478 include_once
'Services/Form/classes/class.ilPropertyFormGUI.php';
481 $form->setFormAction($this->ctrl->getFormAction($this,
'saveChatOptions'));
482 $form->setTitle($lng->txt(
"chat_settings"));
485 $chb->setOptionTitle($this->lng->txt(
'play_invitation_sound'));
486 $form->addItem($chb);
488 $form->addCommandButton(
"saveChatOptions", $lng->txt(
"save"));
496 public function saveChatOptions()
506 $chatSettings =
new ilSetting(
'chatroom');
507 $notificationSettings =
new ilSetting(
'notifications');
509 $chatSettings->get(
'chat_enabled',
false) &&
510 $notificationSettings->get(
'enable_osd',
false) &&
511 $chatSettings->get(
'play_invitation_sound',
false)
515 $ilCtrl->redirect($this);
518 $form = $this->getChatSettingsForm();
519 if(!$form->checkInput())
521 $this->showChatOptions($form);
525 $ilUser->setPref(
'chat_play_invitation_sound', (
int)$form->getInput(
'play_invitation_sound'));
526 $ilUser->writePrefs();
529 $this->showChatOptions($form);
537 $this->tpl->setVariable(
'HEADER', $this->lng->txt(
'personal_settings'));
551 $chatSettings =
new ilSetting(
'chatroom');
552 $notificationSettings =
new ilSetting(
'notifications');
554 $chatSettings->get(
'chat_enabled',
false) &&
555 $notificationSettings->get(
'enable_osd',
false) &&
556 $chatSettings->get(
'play_invitation_sound',
false)
559 $ilCtrl->redirect($this);
562 $this->__initSubTabs(
'showChatOptions');
567 $form->setValuesByPost();
571 $form = $this->getChatSettingsForm();
572 $form->setValuesByArray(array(
573 'play_invitation_sound' => $ilUser->getPref(
'chat_play_invitation_sound')
577 $this->tpl->setContent($form->getHTML());
595 $this->__initSubTabs(
"showPersonalData");
596 $ilTabs->activateTab(
"password");
604 $this->tpl->setContent($this->form->getHTML());
617 include_once(
"Services/Form/classes/class.ilPropertyFormGUI.php");
634 $cpass->setSkipSyntaxCheck(
true);
636 if($ilUser->getPasswd())
638 $cpass->setRequired(
true);
640 $this->form->addItem($cpass);
648 if ($ilSetting->get(
"passwd_auto_generate") == 1)
650 $ipass->setPreSelection(
true);
652 $this->form->addItem($ipass);
653 $this->form->addCommandButton(
"savePassword", $lng->txt(
"save"));
654 $this->form->addCommandButton(
"showPassword", $lng->txt(
"new_list_password"));
658 $this->form->addItem($ipass);
659 $this->form->addCommandButton(
"savePassword", $lng->txt(
"save"));
662 switch ($ilUser->getAuthMode(
true))
665 $this->form->setTitle($lng->txt(
"chg_password"));
670 require_once
'Services/WebDAV/classes/class.ilDAVServer.php';
673 $this->form->setTitle($lng->txt(
"chg_ilias_and_webfolder_password"));
677 $this->form->setTitle($lng->txt(
"chg_ilias_password"));
681 $this->form->setTitle($lng->txt(
"chg_ilias_password"));
684 $this->form->setFormAction($this->ctrl->getFormAction($this));
701 if ($ilUser->getAuthMode(
true) !=
AUTH_LOCAL &&
702 ($ilUser->getAuthMode(
true) !=
AUTH_CAS || !$ilSetting->get(
"cas_allow_local")) &&
703 ($ilUser->getAuthMode(
true) !=
AUTH_SHIBBOLETH || !$ilSetting->get(
"shib_auth_allow_local")) &&
704 ($ilUser->getAuthMode(
true) !=
AUTH_SOAP || !$ilSetting->get(
"soap_auth_allow_local")) &&
711 $this->ilias->getSetting(
'usr_settings_disable_password'))
729 $ilCtrl->redirect($this,
"showPersonalData");
734 if ($this->form->checkInput())
736 $cp = $this->form->getItemByPostVar(
"current_password");
737 $np = $this->form->getItemByPostVar(
"new_password");
743 #if ($ilUser->getAuthMode(true) != AUTH_SHIBBOLETH || ! $ilSetting->get("shib_auth_allow_local"))
747 if (md5($_POST[
"current_password"]) != $ilUser->getPasswd() and
748 $ilUser->getPasswd())
751 $cp->setAlert($this->lng->txt(
"passwd_wrong"));
756 if ($this->ilias->getSetting(
"passwd_auto_generate") == 1 &&
760 $np->setAlert($this->lng->txt(
"passwd_not_selected"));
764 if ($this->ilias->getSetting(
"passwd_auto_generate") != 1 &&
768 if ($custom_error !=
'')
770 $np->setAlert($custom_error);
774 $np->setAlert($this->lng->txt(
"passwd_invalid"));
777 if ($this->ilias->getSetting(
"passwd_auto_generate") != 1 &&
778 ($ilUser->isPasswordExpired() || $ilUser->isPasswordChangeDemanded()) &&
779 ($_POST[
"current_password"] == $_POST[
"new_password"]))
782 $np->setAlert($this->lng->txt(
"new_pass_equals_old_pass"));
788 $ilUser->resetPassword($_POST[
"new_password"], $_POST[
"new_password"]);
789 if ($_POST[
"current_password"] != $_POST[
"new_password"])
791 $ilUser->setLastPasswordChangeToNow();
793 $ilCtrl->redirect($this,
"showPassword");
796 $this->form->setValuesByPost();
813 if ($this->settings[
"usr_settings_hide_".$setting] == 1)
817 if ($this->settings[
"usr_settings_disable_".$setting] == 1)
831 if (isset($this->settings[
"usr_settings_hide_".$setting]) &&
832 $this->settings[
"usr_settings_hide_".$setting] == 1)
846 if ($this->settings[
"usr_settings_disable_".$setting] == 1)
858 global $ilTabs, $ilToolbar,
$ilCtrl;
864 $this->__initSubTabs(
"showPersonalData");
865 $ilTabs->activateTab(
"general_settings");
873 $this->tpl->setContent($this->form->getHTML());
886 include_once(
"Services/Form/classes/class.ilPropertyFormGUI.php");
892 $languages = $this->lng->getInstalledLanguages();
894 foreach($languages as $lang_key)
900 $si->setOptions($options);
901 $si->setValue($ilUser->getLanguage());
902 $si->setDisabled($ilSetting->get(
"usr_settings_disable_language"));
903 $this->form->addItem(
$si);
907 include_once(
"./Services/Style/classes/class.ilObjStyleSettings.php");
910 $templates = $styleDefinition->getAllTemplates();
911 if (is_array($templates))
916 foreach($templates as $template)
920 $styleDef->startParsing();
921 $styles = $styleDef->getStyles();
923 foreach($styles as $style)
930 $options[$template[
"id"].
":".$style[
"id"]] =
931 $styleDef->getTemplateName().
" / ".$style[
"name"];
934 $si->setOptions($options);
935 $si->setValue($ilUser->skin.
":".$ilUser->prefs[
"style"]);
936 $si->setDisabled($ilSetting->get(
"usr_settings_disable_skin_style"));
937 $this->form->addItem(
$si);
944 $cb =
new ilCheckboxInputGUI($this->lng->txt(
"user_screen_reader_optimization"),
"screen_reader_optimization");
945 $cb->
setChecked($ilUser->prefs[
"screen_reader_optimization"]);
946 $cb->setDisabled($ilSetting->get(
"usr_settings_disable_screen_reader_optimization"));
947 $cb->setInfo($this->lng->txt(
"user_screen_reader_optimization_info"));
948 $this->form->addItem($cb);
956 $hits_options = array(10,15,20,30,40,50,100,9999);
959 foreach($hits_options as $hits_option)
961 $hstr = ($hits_option == 9999)
962 ? $this->lng->txt(
"no_limit")
964 $options[$hits_option] = $hstr;
966 $si->setOptions($options);
967 $si->setValue($ilUser->prefs[
"hits_per_page"]);
968 $si->setDisabled($ilSetting->get(
"usr_settings_disable_hits_per_page"));
969 $this->form->addItem(
$si);
978 "y" => $this->lng->txt(
"users_online_show_y"),
979 "associated" => $this->lng->txt(
"users_online_show_associated"),
980 "n" => $this->lng->txt(
"users_online_show_n"));
981 $si->setOptions($options);
982 $si->setValue($ilUser->prefs[
"show_users_online"]);
983 $si->setDisabled($ilSetting->get(
"usr_settings_disable_show_users_online"));
984 $this->form->addItem(
$si);
988 $lv =
new ilSelectInputGUI($this->lng->txt(
"user_store_last_visited"),
"store_last_visited");
990 0 => $this->lng->txt(
"user_lv_keep_entries"),
991 1 => $this->lng->txt(
"user_lv_keep_only_for_session"),
992 2 => $this->lng->txt(
"user_lv_do_not_store"));
994 $lv->setValue((
int) $ilUser->prefs[
"store_last_visited"]);
995 $this->form->addItem($lv);
1000 $cb =
new ilCheckboxInputGUI($this->lng->txt(
"hide_own_online_status"),
"hide_own_online_status");
1001 $cb->
setChecked($ilUser->prefs[
"hide_own_online_status"] ==
"y");
1002 $cb->setDisabled($ilSetting->get(
"usr_settings_disable_hide_own_online_status"));
1003 $this->form->addItem($cb);
1006 include_once
'Services/Authentication/classes/class.ilSessionReminder.php';
1007 if(ilSessionReminder::isGloballyActivated())
1009 $cb =
new ilCheckboxInputGUI($this->lng->txt(
'session_reminder'),
'session_reminder_enabled');
1010 $cb->
setInfo($this->lng->txt(
'session_reminder_info'));
1012 $cb->setChecked((
int)$ilUser->getPref(
'session_reminder_enabled'));
1015 $lead_time_gui =
new ilNumberInputGUI($this->lng->txt(
'session_reminder_lead_time'),
'session_reminder_lead_time');
1019 $max_value = max($min_value, ((
int)$expires / 60) - 1);
1021 $current_user_value = $ilUser->getPref(
'session_reminder_lead_time');
1022 if($current_user_value < $min_value ||
1023 $current_user_value > $max_value)
1029 $min_value, $current_user_value
1034 $lead_time_gui->setValue($value);
1035 $lead_time_gui->setSize(3);
1036 $lead_time_gui->setMinValue($min_value);
1037 $lead_time_gui->setMaxValue($max_value);
1038 $cb->addSubItem($lead_time_gui);
1040 $this->form->addItem($cb);
1046 include_once(
'Services/Calendar/classes/class.ilCalendarUserSettings.php');
1047 include_once(
'Services/Calendar/classes/class.ilCalendarUtil.php');
1048 $lng->loadLanguageModule(
"dateplaner");
1053 $select->setInfo($lng->txt(
'cal_timezone_info'));
1054 $select->setValue($user_settings->getTimeZone());
1055 $this->form->addItem($select);
1058 $select =
new ilSelectInputGUI($lng->txt(
'cal_user_date_format'),
'date_format');
1063 $select->setInfo($lng->txt(
'cal_date_format_info'));
1064 $select->setValue($user_settings->getDateFormat());
1065 $this->form->addItem($select);
1067 $select =
new ilSelectInputGUI($lng->txt(
'cal_user_time_format'),
'time_format');
1071 $select->setInfo($lng->txt(
'cal_time_format_info'));
1072 $select->setValue($user_settings->getTimeFormat());
1073 $this->form->addItem($select);
1077 include_once
"Services/User/classes/class.ilUserUtil.php";
1080 $this->lng->loadLanguageModule(
"administration");
1082 $si->setRequired(
true);
1083 $si->setInfo($this->lng->txt(
"adm_user_starting_point_info"));
1089 $this->form->addItem(
$si);
1093 $repobj_id =
new ilTextInputGUI($lng->txt(
"adm_user_starting_point_ref_id"),
"usr_start_ref_id");
1094 $repobj_id->setRequired(
true);
1095 $repobj_id->setSize(5);
1099 $repobj_id->
setValue($start_ref_id);
1105 $repobj_id->
setInfo($lng->txt(
"obj_".ilObject::_lookupType($start_obj_id)).
1110 $repobj->addSubItem($repobj_id);
1111 $si->addOption($repobj);
1115 $this->form->addCommandButton(
"saveGeneralSettings", $lng->txt(
"save"));
1116 $this->form->setTitle($lng->txt(
"general_settings"));
1117 $this->form->setFormAction($this->ctrl->getFormAction($this));
1129 if ($this->form->checkInput())
1134 if ($_POST[
"skin_style"] !=
"")
1136 $sknst = explode(
":", $_POST[
"skin_style"]);
1138 if ($ilUser->getPref(
"style") != $sknst[1] ||
1139 $ilUser->getPref(
"skin") != $sknst[0])
1141 $ilUser->setPref(
"skin", $sknst[0]);
1142 $ilUser->setPref(
"style", $sknst[1]);
1150 $ilUser->setLanguage($_POST[
"language"]);
1156 if ($_POST[
"hits_per_page"] !=
"")
1158 $ilUser->setPref(
"hits_per_page",$_POST[
"hits_per_page"]);
1165 $ilUser->setPref(
"show_users_online", $_POST[
"show_users_online"]);
1169 global $ilNavigationHistory;
1170 $ilUser->setPref(
"store_last_visited", (
int) $_POST[
"store_last_visited"]);
1171 if ((
int) $_POST[
"store_last_visited"] > 0)
1173 $ilNavigationHistory->deleteDBEntries();
1174 if ((
int) $_POST[
"store_last_visited"] == 2)
1176 $ilNavigationHistory->deleteSessionEntries();
1183 if ($_POST[
"hide_own_online_status"] == 1)
1185 $ilUser->setPref(
"hide_own_online_status",
"y");
1189 $ilUser->setPref(
"hide_own_online_status",
"n");
1196 $ilUser->setPref(
"screen_reader_optimization", $_POST[
"screen_reader_optimization"]);
1200 include_once
'Services/Authentication/classes/class.ilSessionReminder.php';
1201 if(ilSessionReminder::isGloballyActivated())
1203 $ilUser->setPref(
'session_reminder_enabled', (
int)$this->form->getInput(
'session_reminder_enabled'));
1204 $ilUser->setPref(
'session_reminder_lead_time', $this->form->getInput(
'session_reminder_lead_time'));
1208 include_once
"Services/User/classes/class.ilUserUtil.php";
1212 $this->form->getInput(
'usr_start_ref_id'));
1218 include_once(
'Services/Calendar/classes/class.ilCalendarUserSettings.php');
1220 $user_settings->setTimeZone($this->form->getInput(
"timezone"));
1221 $user_settings->setDateFormat((
int)$this->form->getInput(
"date_format"));
1222 $user_settings->setTimeFormat((
int)$this->form->getInput(
"time_format"));
1223 $user_settings->save();
1226 $ilCtrl->redirect($this,
"showGeneralSettings");
1229 $this->form->setValuesByPost();
1240 if(!(
bool)$ilSetting->get(
'user_delete_own_account') ||
1241 $ilUser->getId() == SYSTEM_USER_ID)
1243 $this->ctrl->redirect($this,
"showGeneralSettings");
1247 $ilUser->removeDeletionFlag();
1250 $this->__initSubTabs(
"deleteOwnAccount");
1251 $ilTabs->activateTab(
"delacc");
1254 $ilToolbar->addButton($this->lng->txt(
'btn_next'),
1255 $this->ctrl->getLinkTarget($this,
'deleteOwnAccount2'));
1267 if(!(
bool)$ilSetting->get(
'user_delete_own_account') ||
1268 $ilUser->getId() == SYSTEM_USER_ID)
1270 $this->ctrl->redirect($this,
"showGeneralSettings");
1274 $this->__initSubTabs(
"deleteOwnAccount");
1275 $ilTabs->activateTab(
"delacc");
1277 include_once
"Services/Utilities/classes/class.ilConfirmationGUI.php";
1279 $cgui->setHeaderText($this->lng->txt(
'user_delete_own_account_logout_confirmation'));
1280 $cgui->setFormAction($this->ctrl->getFormAction($this));
1281 $cgui->setCancel($this->lng->txt(
"cancel"),
"abortDeleteOwnAccount");
1282 $cgui->setConfirm($this->lng->txt(
"user_delete_own_account_logout_button"),
"deleteOwnAccountLogout");
1283 $this->tpl->setContent($cgui->getHTML());
1291 $ilUser->removeDeletionFlag();
1293 ilUtil::sendInfo($this->lng->txt(
"user_delete_own_account_aborted"),
true);
1294 $ilCtrl->redirect($this,
"showGeneralSettings");
1303 $ilUser->activateDeletionFlag();
1320 if(!(
bool)$ilSetting->get(
'user_delete_own_account') ||
1321 $ilUser->getId() == SYSTEM_USER_ID ||
1322 !$ilUser->hasDeletionFlag())
1324 $this->ctrl->redirect($this,
"showGeneralSettings");
1328 $this->__initSubTabs(
"deleteOwnAccount");
1329 $ilTabs->activateTab(
"delacc");
1331 include_once
"Services/Utilities/classes/class.ilConfirmationGUI.php";
1333 $cgui->setHeaderText($this->lng->txt(
'user_delete_own_account_final_confirmation'));
1334 $cgui->setFormAction($this->ctrl->getFormAction($this));
1335 $cgui->setCancel($this->lng->txt(
"cancel"),
"abortDeleteOwnAccount");
1336 $cgui->setConfirm($this->lng->txt(
"confirm"),
"deleteOwnAccount4");
1337 $this->tpl->setContent($cgui->getHTML());
1348 if(!(
bool)$ilSetting->get(
'user_delete_own_account') ||
1349 $ilUser->getId() == SYSTEM_USER_ID ||
1350 !$ilUser->hasDeletionFlag())
1352 $this->ctrl->redirect($this,
"showGeneralSettings");
1355 include_once
"Services/Mail/classes/class.ilMail.php";
1356 $mail =
new ilMail(ANONYMOUS_USER_ID);
1360 $subject = $this->lng->txt(
"user_delete_own_account_email_subject");
1361 $message = $this->lng->txt(
"user_delete_own_account_email_body");
1366 sprintf($message, $ilUser->getLogin(), ILIAS_HTTP_PATH,
1370 $message .=
"\n\n".$ilUser->getProfileAsString($this->lng);
1375 $user_email = $ilUser->getEmail();
1376 $admin_mail = $ilSetting->get(
"user_delete_own_account_email");
1381 $mail->sendMimeMail($user_email, null, $admin_mail, $subject, $message, null,
true);
1384 else if($admin_mail)
1386 $mail->sendMimeMail($admin_mail, null, null, $subject, $message, null,
true);
1389 $ilLog->write(
"Account deleted: ".$ilUser->getLogin().
" (".$ilUser->getId().
")");