/**
  * Save user account settings
  * @return 
  */
 public function saveGeneralSettingsObject()
 {
     global $ilUser, $ilSetting;
     $this->initFormGeneralSettings();
     if ($this->form->checkInput()) {
         $valid = true;
         if (!strlen($this->form->getInput('loginname_change_blocking_time'))) {
             $valid = false;
             $this->form->getItemByPostVar('loginname_change_blocking_time')->setAlert($this->lng->txt('loginname_change_blocking_time_invalidity_info'));
         }
         include_once './Services/PrivacySecurity/classes/class.ilSecuritySettings.php';
         $security = ilSecuritySettings::_getInstance();
         // account security settings
         $security->setPasswordCharsAndNumbersEnabled((bool) $_POST["password_chars_and_numbers_enabled"]);
         $security->setPasswordSpecialCharsEnabled((bool) $_POST["password_special_chars_enabled"]);
         $security->setPasswordMinLength((int) $_POST["password_min_length"]);
         $security->setPasswordMaxLength((int) $_POST["password_max_length"]);
         $security->setPasswordNumberOfUppercaseChars((int) $_POST['password_ucase_chars_num']);
         $security->setPasswordNumberOfLowercaseChars((int) $_POST['password_lowercase_chars_num']);
         $security->setPasswordMaxAge((int) $_POST["password_max_age"]);
         $security->setLoginMaxAttempts((int) $_POST["login_max_attempts"]);
         $security->setPreventionOfSimultaneousLogins((bool) $_POST['ps_prevent_simultaneous_logins']);
         $security->setPasswordChangeOnFirstLoginEnabled((bool) $_POST['password_change_on_first_login_enabled']);
         $security->setPasswordMustNotContainLoginnameStatus((int) $_POST['password_must_not_contain_loginame']);
         if (!$security->validate($this->form)) {
             $valid = false;
         }
         if ($valid) {
             $security->save();
             include_once './Services/User/classes/class.ilUserAccountSettings.php';
             ilUserAccountSettings::getInstance()->enableLocalUserAdministration($this->form->getInput('lua'));
             ilUserAccountSettings::getInstance()->restrictUserAccess($this->form->getInput('lrua'));
             ilUserAccountSettings::getInstance()->update();
             // TODO: move to user account settings
             $save_blocking_time_in_seconds = (int) $ilSetting->get('loginname_change_blocking_time') * 86400;
             $ilSetting->set('allow_change_loginname', (int) $this->form->getInput('allow_change_loginname'));
             $ilSetting->set('create_history_loginname', (int) $this->form->getInput('create_history_loginname'));
             $ilSetting->set('reuse_of_loginnames', (int) $this->form->getInput('reuse_of_loginnames'));
             $ilSetting->set('loginname_change_blocking_time', (int) $save_blocking_time_in_seconds);
             $ilSetting->set('user_adm_alpha_nav', (int) $this->form->getInput('user_adm_alpha_nav'));
             $ilSetting->set('user_reactivate_code', (int) $this->form->getInput('user_reactivate_code'));
             $ilSetting->set('user_delete_own_account', (int) $this->form->getInput('user_own_account'));
             $ilSetting->set('user_delete_own_account_email', $this->form->getInput('user_own_account_email'));
             $ilSetting->set("passwd_auto_generate", $this->form->getInput("passwd_auto_generate"));
             $ilSetting->set("password_assistance", $this->form->getInput("password_assistance"));
             // BEGIN SESSION SETTINGS
             $ilSetting->set('session_handling_type', (int) $this->form->getInput('session_handling_type'));
             if ($this->form->getInput('session_handling_type') == ilSession::SESSION_HANDLING_FIXED) {
                 $ilSetting->set('session_reminder_enabled', $this->form->getInput('session_reminder_enabled'));
             } else {
                 if ($this->form->getInput('session_handling_type') == ilSession::SESSION_HANDLING_LOAD_DEPENDENT) {
                     require_once 'Services/Authentication/classes/class.ilSessionControl.php';
                     if ($ilSetting->get('session_allow_client_maintenance', ilSessionControl::DEFAULT_ALLOW_CLIENT_MAINTENANCE)) {
                         // has to be done BEFORE updating the setting!
                         include_once "Services/Authentication/classes/class.ilSessionStatistics.php";
                         ilSessionStatistics::updateLimitLog((int) $this->form->getInput('session_max_count'));
                         $ilSetting->set('session_max_count', (int) $this->form->getInput('session_max_count'));
                         $ilSetting->set('session_min_idle', (int) $this->form->getInput('session_min_idle'));
                         $ilSetting->set('session_max_idle', (int) $this->form->getInput('session_max_idle'));
                         $ilSetting->set('session_max_idle_after_first_request', (int) $this->form->getInput('session_max_idle_after_first_request'));
                     }
                 }
             }
             // END SESSION SETTINGS
             ilUtil::sendSuccess($this->lng->txt('saved_successfully'));
         } else {
             ilUtil::sendFailure($this->lng->txt('form_input_not_valid'));
         }
     } else {
         ilUtil::sendFailure($this->lng->txt('form_input_not_valid'));
     }
     $this->form->setValuesByPost();
     $this->tpl->setContent($this->form->getHTML());
 }
 /**
  * Save basic settings form
  *
  */
 public function saveBasicSettingsObject()
 {
     global $tpl, $lng, $ilCtrl, $ilSetting, $rbacsystem;
     if (!$rbacsystem->checkAccess("write", $this->object->getRefId())) {
         $this->ilias->raiseError($this->lng->txt("permission_denied"), $this->ilias->error_obj->MESSAGE);
     }
     $this->initBasicSettingsForm();
     if ($this->form->checkInput()) {
         $ilSetting->set("short_inst_name", $_POST["short_inst_name"]);
         $ilSetting->set("pub_section", $_POST["pub_section"]);
         $ilSetting->set("open_google", $_POST["open_google"]);
         $ilSetting->set("default_repository_view", $_POST["default_rep_view"]);
         $ilSetting->set("links_dynamic", $_POST["links_dynamic"]);
         $ilSetting->set("enable_trash", $_POST["enable_trash"]);
         $ilSetting->set("password_assistance", $_POST["password_assistance"]);
         $ilSetting->set("passwd_auto_generate", $_POST["passwd_auto_generate"]);
         $ilSetting->set("locale", $_POST["locale"]);
         $ilSetting->set('preview_learner', (int) $_POST['preview_learner']);
         $ilSetting->set('comments_tagging_in_lists', (int) $_POST['comments_tagging_in_lists']);
         $ilSetting->set('activate_captcha_anonym', (int) $_POST['activate_captcha_anonym']);
         //			$ilSetting->set('rep_cache',(int) $_POST['rep_cache']);
         $ilSetting->set('item_cmd_asynch', (int) $_POST['item_cmd_asynch']);
         $ilSetting->set("repository_tree_pres", $_POST["tree_pres"]);
         if ($_POST["tree_pres"] == "") {
             $_POST["rep_tree_limit_grp_crs"] = "";
         }
         if ($_POST["rep_tree_limit_grp_crs"] && !$ilSetting->get("rep_tree_limit_grp_crs")) {
             $_POST["rep_tree_synchronize"] = true;
         } else {
             if (!$_POST["rep_tree_synchronize"] && $ilSetting->get("rep_tree_synchronize")) {
                 $_POST["rep_tree_limit_grp_crs"] = false;
             }
         }
         $ilSetting->set("rep_tree_limit_grp_crs", $_POST["rep_tree_limit_grp_crs"]);
         $ilSetting->set("rep_tree_synchronize", $_POST["rep_tree_synchronize"]);
         // BEGIN SESSION SETTINGS
         $ilSetting->set('session_handling_type', (int) $this->form->getInput('session_handling_type'));
         if ($this->form->getInput('session_handling_type') == ilSession::SESSION_HANDLING_FIXED) {
             $ilSetting->set('session_reminder_enabled', $this->form->getInput('session_reminder_enabled'));
         } else {
             if ($this->form->getInput('session_handling_type') == ilSession::SESSION_HANDLING_LOAD_DEPENDENT) {
                 require_once 'Services/Authentication/classes/class.ilSessionControl.php';
                 if ($ilSetting->get('session_allow_client_maintenance', ilSessionControl::DEFAULT_ALLOW_CLIENT_MAINTENANCE)) {
                     // has to be done BEFORE updating the setting!
                     include_once "Services/Authentication/classes/class.ilSessionStatistics.php";
                     ilSessionStatistics::updateLimitLog((int) $this->form->getInput('session_max_count'));
                     $ilSetting->set('session_max_count', (int) $this->form->getInput('session_max_count'));
                     $ilSetting->set('session_min_idle', (int) $this->form->getInput('session_min_idle'));
                     $ilSetting->set('session_max_idle', (int) $this->form->getInput('session_max_idle'));
                     $ilSetting->set('session_max_idle_after_first_request', (int) $this->form->getInput('session_max_idle_after_first_request'));
                 }
             }
         }
         // END SESSION SETTINGS
         $global_profiles = $_POST["pub_section"] ? (int) $_POST['enable_global_profiles'] : 0;
         $ilSetting->set('enable_global_profiles', $global_profiles);
         $ilSetting->set("rep_shorten_description", $this->form->getInput('rep_shorten_description'));
         $ilSetting->set("rep_shorten_description_length", (int) $this->form->getInput('rep_shorten_description_length'));
         include_once "Services/User/classes/class.ilUserUtil.php";
         ilUserUtil::setStartingPoint($this->form->getInput('usr_start'), $this->form->getInput('usr_start_ref_id'));
         ilUserUtil::togglePersonalStartingPoint($this->form->getInput('usr_start_pers'));
         ilUtil::sendSuccess($lng->txt("msg_obj_modified"), true);
         $ilCtrl->redirect($this, "showBasicSettings");
     }
     $this->setGeneralSettingsSubTabs("basic_settings");
     $this->form->setValuesByPost();
     $tpl->setContent($this->form->getHtml());
 }