Ejemplo n.º 1
0
 /**
  * @group IL_Init
  */
 public function testLikeDeletion()
 {
     $set = new ilSetting("test_module3");
     $set->set("foo", "plus");
     $set->set("fooplus", "bar");
     $set->set("barplus", "foo");
     $set->deleteLike("foo%");
     $value = $set->get("foo") . "-" . $set->get("fooplus") . "-" . $set->get("barplus");
     $this->assertEquals("--foo", $value);
 }
 public function run()
 {
     global $lng, $ilDB;
     $status = ilCronJobResult::STATUS_NO_ACTION;
     $setting = new ilSetting("cron");
     $last_run = $setting->get(get_class($this));
     // #10284 - we already did send today, do nothing
     if ($last_run == date("Y-m-d")) {
         return;
     }
     // gather objects and participants with notification setting
     $objects = array();
     $set = $ilDB->query("SELECT usr_id,keyword FROM usr_pref" . " WHERE " . $ilDB->like("keyword", "text", "grpcrs_ntf_%") . " AND value = " . $ilDB->quote("1", "text"));
     while ($row = $ilDB->fetchAssoc($set)) {
         $ref_id = substr($row["keyword"], 11);
         $type = ilObject::_lookupType($ref_id, true);
         if ($type) {
             $objects[$type][$ref_id][] = $row["usr_id"];
         }
     }
     $counter = 0;
     if (sizeof($objects)) {
         $old_lng = $lng;
         include_once "Services/News/classes/class.ilNewsItem.php";
         foreach ($objects as $type => $ref_ids) {
             // type is not needed for now
             foreach ($ref_ids as $ref_id => $user_ids) {
                 // gather news per object
                 $news_item = new ilNewsItem();
                 if ($news_item->checkNewsExistsForGroupCourse($ref_id)) {
                     foreach ($user_ids as $user_id) {
                         // gather news for user
                         $user_news = $news_item->getNewsForRefId($ref_id, false, false, 1, false, false, false, false, $user_id);
                         if ($user_news) {
                             $this->sendMail($user_id, $ref_id, $user_news);
                             $counter++;
                         }
                     }
                 }
             }
         }
         $lng = $old_lng;
     }
     // save last run
     $setting->set(get_class($this), date("Y-m-d"));
     if ($counter) {
         $status = ilCronJobResult::STATUS_OK;
     }
     $result = new ilCronJobResult();
     $result->setStatus($status);
     return $result;
 }
Ejemplo n.º 3
0
 /**
  * @param string $name
  * @param array  $arguments
  * @return bool
  * @throws BadMethodCallException
  */
 public static function __callStatic($name, array $arguments = array())
 {
     if (strpos($name, 'isActiveFor') === 0 || strpos($name, 'setActiveFor') === 0) {
         $settings = new ilSetting('cptch');
         $supported_contexts = self::getSupportedContexts();
         $method_parts = explode('_', strtolower(preg_replace('/([a-z])([A-Z])/', '$1_$2', $name)));
         $requested_context = strtolower($method_parts[count($method_parts) - 1]);
         if (!isset($requested_context, self::$context_map)) {
             throw new BadMethodCallException('Method ' . $name . ' called for a non existing context.');
         }
         if ('set' == $method_parts[0]) {
             $settings->set('activate_captcha_anonym_' . $supported_contexts[$requested_context], (int) $arguments[0]);
             return;
         } else {
             return self::checkFreetype() && (bool) $settings->get('activate_captcha_anonym_' . $supported_contexts[$requested_context], false);
         }
     } else {
         throw new BadMethodCallException('Call to an undefined static method ' . $name . ' in class ' . __CLASS__ . '.');
     }
 }
 /**
  * Saves client settings fetched from $_POST
  *
  * @global ilCtrl2 $ilCtrl
  * @global ilLanguage $lng
  */
 public function saveClientSettings()
 {
     global $ilCtrl, $lng;
     require_once 'Modules/Chatroom/classes/class.ilChatroomFormFactory.php';
     $factory = new ilChatroomFormFactory();
     $form = $factory->getClientSettingsForm();
     if (!$form->checkInput()) {
         $form->setValuesByPost();
         return $this->clientsettings($form);
     }
     $settings = array('hash' => $_POST['name'], 'name' => $_POST['name'], 'url' => $_POST['url'], 'user' => $_POST['user'], 'password' => $_POST['password'], 'client' => CLIENT_ID, 'enable_osd' => (bool) $_POST['enable_osd'], 'osd_intervall' => (int) $_POST['osd_intervall'], 'chat_enabled' => (bool) $_POST['chat_enabled'] && (bool) $this->commonSettings->get('soap_user_administration'), 'enable_smilies' => (bool) $_POST['enable_smilies'], 'play_invitation_sound' => (bool) $_POST['play_invitation_sound']);
     $notificationSettings = new ilSetting('notifications');
     $notificationSettings->set('osd_polling_intervall', (int) $_POST['osd_intervall']);
     $notificationSettings->set('enable_osd', (bool) $_POST['enable_osd']);
     $chatSettings = new ilSetting('chatroom');
     $chatSettings->set('chat_enabled', $settings['chat_enabled']);
     $chatSettings->set('play_invitation_sound', (bool) $_POST['play_invitation_sound']);
     require_once 'Modules/Chatroom/classes/class.ilChatroomAdmin.php';
     $adminSettings = new ilChatroomAdmin($this->gui->object->getId());
     $adminSettings->saveClientSettings((object) $settings);
     $this->writeClientSettingsToFile($settings);
     ilUtil::sendSuccess($lng->txt('settings_has_been_saved'), true);
     $ilCtrl->redirect($this->gui, 'view-clientsettings');
 }
Ejemplo n.º 5
0
if ($ilDB->tableColumnExists('svy_qst_sc', 'other_answer_label')) {
    $ilDB->dropTableColumn('svy_qst_sc', 'other_answer_label');
}
?>
<#2946>
<?php 
$ilDB->addIndex('svy_category', array('other'), 'i2');
?>
<#2947>
<?php 
$feed_set = new ilSetting('feed');
$pxy_host = $feed_set->get('proxy');
$pxy_port = $feed_set->get('proxy_port');
$setting = new ilSetting();
if (strlen($pxy_host) && strlen($pxy_port)) {
    $setting->set('proxy_host', $pxy_host);
    $setting->set('proxy_port', $pxy_port);
    $setting->set('proxy_status', 1);
} else {
    $setting->set('proxy_host', '');
    $setting->set('proxy_port', '');
    $setting->set('proxy_status', 0);
}
$feed_set->delete('proxy');
$feed_set->delete('proxy_port');
?>
<#2948>
<?php 
// FILE ENDS HERE, DO NOT ADD ANY ADDITIONAL STEPS
//
//         USE dbupdate_03.php INSTEAD
Ejemplo n.º 6
0
 /**
  * Clear running status
  */
 function clearRunningStatus()
 {
     include_once './Services/Administration/classes/class.ilSetting.php';
     $set = new ilSetting("common", true);
     $set->set("db_update_running", 0);
     $this->db_update_running = 0;
 }
 function saveGeneralSettingsObject()
 {
     require_once 'Services/Notifications/classes/class.ilNotificationAdminSettingsForm.php';
     #require_once 'Services/Administration/classes/class.ilSetting.php';
     $settings = new ilSetting('notifications');
     $form = ilNotificationAdminSettingsForm::getGeneralSettingsForm();
     $form->setValuesByPost();
     if (!$form->checkInput()) {
         $this->showGeneralSettingsObject($form);
     } else {
         /**
          * @todo dirty...
          * 
          * push all notifiation settings to the form to enable custom
          * settings per channel
          */
         $values = $form->store_values;
         //array('enable_osd', 'osd_polling_intervall', 'enable_mail');
         // handle custom channel settings
         foreach ($values as $v) {
             $settings->set($v, $_POST[$v]);
         }
         foreach ($_REQUEST['notifications'] as $type => $value) {
             ilNotificationDatabaseHandler::setConfigTypeForChannel($type, $value);
         }
         $this->showGeneralSettingsObject();
     }
 }
 /**
  * write object data into db
  * @param	boolean
  */
 private function write()
 {
     global $ilClientIniFile;
     // Clear any old error messages
     $ilClientIniFile->error(null);
     if (!$ilClientIniFile->groupExists('file_access')) {
         $ilClientIniFile->addGroup('file_access');
     }
     $ilClientIniFile->setVariable('file_access', 'webdav_enabled', $this->webdavEnabled ? '1' : '0');
     $ilClientIniFile->setVariable('file_access', 'webdav_actions_visible', $this->webdavActionsVisible ? '1' : '0');
     $ilClientIniFile->setVariable('file_access', 'download_with_uploaded_filename', $this->downloadWithUploadedFilename ? '1' : '0');
     $ilClientIniFile->write();
     if ($ilClientIniFile->getError()) {
         global $ilErr;
         $ilErr->raiseError($ilClientIniFile->getError(), $ilErr->WARNING);
     }
     require_once 'Services/Administration/classes/class.ilSetting.php';
     $settings = new ilSetting('file_access');
     $settings->set('inline_file_extensions', $this->inlineFileExtensions);
     $settings->set('custom_webfolder_instructions_enabled', $this->customWebfolderInstructionsEnabled ? '1' : '0');
     $settings->set('custom_webfolder_instructions', $this->customWebfolderInstructions);
 }
 /**
  * Save settings
  */
 public function saveSettings()
 {
     global $ilCtrl;
     $this->checkPermission("write");
     $form = $this->initFormSettings();
     if ($form->checkInput()) {
         $banner = (bool) $form->getInput("banner");
         $blga_set = new ilSetting("blga");
         $blga_set->set("banner", $banner);
         $blga_set->set("banner_width", (int) $form->getInput("width"));
         $blga_set->set("banner_height", (int) $form->getInput("height"));
         $blga_set->set("mask", (bool) $form->getInput("mask"));
         ilUtil::sendSuccess($this->lng->txt("settings_saved"), true);
         $ilCtrl->redirect($this, "editSettings");
     }
     $form->setValuesByPost();
     $this->editSettings($form);
 }
 /**
  * Save personal desktop settings
  */
 public function saveSettings()
 {
     global $ilCtrl, $ilSetting;
     $pd_set = new ilSetting("pd");
     ilCalendarSettings::_getInstance()->setEnabled($_POST["enable_calendar"]);
     ilCalendarSettings::_getInstance()->save();
     #$ilSetting->set("enable_calendar", $_POST["enable_calendar"]);
     $ilSetting->set("disable_bookmarks", (int) ($_POST["enable_bookmarks"] ? 0 : 1));
     $ilSetting->set("disable_contacts", (int) ($_POST["enable_contacts"] ? 0 : 1));
     $ilSetting->set("disable_contacts_require_mail", (int) ($_POST["enable_contacts_require_mail"] ? 0 : 1));
     $ilSetting->set("disable_notes", (int) ($_POST["enable_notes"] ? 0 : 1));
     $ilSetting->set("disable_comments", (int) ($_POST["enable_comments"] ? 0 : 1));
     $ilSetting->set("comments_del_user", (int) ($_POST["comm_del_user"] ? 1 : 0));
     $ilSetting->set("comments_del_tutor", (int) ($_POST["comm_del_tutor"] ? 1 : 0));
     $ilSetting->set("block_activated_chatviewer", (int) $_POST["block_activated_chatviewer"]);
     $ilSetting->set("block_activated_pdusers", $_POST["block_activated_pdusers"]);
     $pd_set->set("enable_block_moving", $_POST["enable_block_moving"]);
     $pd_set->set("user_activity_time", (int) $_POST["time_removal"]);
     $pd_set->set("osi_host", $_POST["osi_host"]);
     // Validate personal desktop view
     if (!(int) $_POST['enable_my_offers'] && !(int) $_POST['enable_my_memberships']) {
         ilUtil::sendFailure($this->lng->txt('pd_view_select_at_least_one'), true);
         $ilCtrl->redirect($this, 'view');
     }
     // Enable 'My Offers' (default personal items)
     $ilSetting->set('disable_my_offers', (int) ($_POST['enable_my_offers'] ? 0 : 1));
     // Enable 'My Memberships'
     $ilSetting->set('disable_my_memberships', (int) ($_POST['enable_my_memberships'] ? 0 : 1));
     if ((int) $_POST['enable_my_offers'] && !(int) $_POST['enable_my_memberships']) {
         $_POST['personal_items_default_view'] = 0;
     } else {
         if (!(int) $_POST['enable_my_offers'] && (int) $_POST['enable_my_memberships']) {
             $_POST['personal_items_default_view'] = 1;
         } else {
             if (!isset($_POST['personal_items_default_view'])) {
                 $_POST['personal_items_default_view'] = $ilSetting->get('personal_items_default_view');
             }
         }
     }
     // Default view of personal items
     $ilSetting->set('personal_items_default_view', (int) $_POST['personal_items_default_view']);
     ilUtil::sendSuccess($this->lng->txt("settings_saved"), true);
     $ilCtrl->redirect($this, "view");
 }
 /**
  * Set the manual scoring settings
  *
  * @param array $type_ids An array containing the database ids of the question types which could be scored manually
  */
 function _setManualScoring($type_ids)
 {
     $setting = new ilSetting("assessment");
     if (!is_array($type_ids) || count($type_ids) == 0) {
         $setting->delete("assessment_manual_scoring");
     } else {
         $setting->set("assessment_manual_scoring", implode($type_ids, ","));
     }
 }
 /**
  * Save settings
  */
 public function saveSettings()
 {
     global $ilCtrl, $ilSetting;
     $this->checkPermission("write");
     $frma_set = new ilSetting("frma");
     $frma_set->set("forum_overview", ilUtil::stripSlashes($_POST["forum_overview"]));
     if (isset($_POST['anonymous_fora'])) {
         $ilSetting->set('enable_anonymous_fora', 1);
     } else {
         $ilSetting->set('enable_anonymous_fora', 0);
     }
     if (isset($_POST['fora_statistics'])) {
         $ilSetting->set('enable_fora_statistics', 1);
     } else {
         $ilSetting->set('enable_fora_statistics', 0);
     }
     $ilSetting->set('forum_notification', ilUtil::stripSlashes($_POST["forum_notification"]));
     ilUtil::sendSuccess($this->lng->txt("settings_saved"), true);
     $ilCtrl->redirect($this, "view");
 }
Ejemplo n.º 13
0
 function setScormDebug($a_key, $a_val)
 {
     global $ilDB;
     if ($a_val != "1") {
         $ilDB->query("UPDATE sahs_lm SET debug = 'n'");
     }
     $setreturn = ilSetting::set($a_key, $a_val);
     return $setreturn;
 }
 public function save()
 {
     $form_settings = new ilSetting("certificate");
     $form_settings->set("pageformat", $_POST["pageformat"]);
     $form_settings->set("active", $_POST["active"]);
     ilUtil::sendSuccess($this->lng->txt("settings_saved"));
     $this->settings();
 }
 /**
  * Save news and external webfeeds settings
  */
 public function saveSettings()
 {
     global $ilCtrl, $ilSetting;
     $pd_set = new ilSetting("pd");
     ilCalendarSettings::_getInstance()->setEnabled($_POST["enable_calendar"]);
     ilCalendarSettings::_getInstance()->save();
     #$ilSetting->set("enable_calendar", $_POST["enable_calendar"]);
     $ilSetting->set("disable_bookmarks", (int) ($_POST["enable_bookmarks"] ? 0 : 1));
     $ilSetting->set("disable_contacts", (int) ($_POST["enable_contacts"] ? 0 : 1));
     $ilSetting->set("disable_contacts_require_mail", (int) ($_POST["enable_contacts_require_mail"] ? 0 : 1));
     $ilSetting->set("disable_notes", (int) ($_POST["enable_notes"] ? 0 : 1));
     $ilSetting->set("disable_comments", (int) ($_POST["enable_comments"] ? 0 : 1));
     $ilSetting->set("block_activated_chatviewer", (int) $_POST["block_activated_chatviewer"]);
     $ilSetting->set("block_activated_pdusers", $_POST["block_activated_pdusers"]);
     $pd_set->set("enable_block_moving", $_POST["enable_block_moving"]);
     $pd_set->set("user_activity_time", (int) $_POST["time_removal"]);
     $pd_set->set("osi_host", $_POST["osi_host"]);
     // Validate personal desktop view
     if (!(int) $_POST['enable_my_offers'] && !(int) $_POST['enable_my_memberships']) {
         ilUtil::sendFailure($this->lng->txt('pd_view_select_at_least_one'), true);
         $ilCtrl->redirect($this, 'view');
     }
     // Enable 'My Offers' (default personal items)
     $ilSetting->set('disable_my_offers', (int) ($_POST['enable_my_offers'] ? 0 : 1));
     // Enable 'My Memberships'
     $ilSetting->set('disable_my_memberships', (int) ($_POST['enable_my_memberships'] ? 0 : 1));
     if ((int) $_POST['enable_my_offers'] && !(int) $_POST['enable_my_memberships']) {
         $_POST['personal_items_default_view'] = 0;
     } else {
         if (!(int) $_POST['enable_my_offers'] && (int) $_POST['enable_my_memberships']) {
             $_POST['personal_items_default_view'] = 1;
         } else {
             if (!isset($_POST['personal_items_default_view'])) {
                 $_POST['personal_items_default_view'] = $ilSetting->get('personal_items_default_view');
             }
         }
     }
     // Default view of personal items
     $ilSetting->set('personal_items_default_view', (int) $_POST['personal_items_default_view']);
     // without personal workspace we have to disable to sub-items
     if (!$_POST["wsp"]) {
         $_POST["blog"] = 0;
         $_POST["file"] = 0;
         $_POST["cert"] = 0;
         $_POST["link"] = 0;
     }
     $ilSetting->set('disable_personal_workspace', (int) ($_POST['wsp'] ? 0 : 1));
     $ilSetting->set('disable_wsp_blogs', (int) ($_POST['blog'] ? 0 : 1));
     $ilSetting->set('disable_wsp_files', (int) ($_POST['file'] ? 0 : 1));
     $ilSetting->set('disable_wsp_certificates', (int) ($_POST['cert'] ? 0 : 1));
     $ilSetting->set('disable_wsp_links', (int) ($_POST['link'] ? 0 : 1));
     $ilSetting->set('user_portfolios', (int) ($_POST['prtf'] ? 1 : 0));
     ilUtil::sendSuccess($this->lng->txt("settings_saved"), true);
     $ilCtrl->redirect($this, "view");
 }
Ejemplo n.º 16
0
$ilDB->manipulate('delete from ecs_course_assignments');
?>
<#4420>
<?php 
$ilCtrlStructureReader->getStructure();
?>
<#4421>
<?php 
$ilCtrlStructureReader->getStructure();
?>
<#4422>
<?php 
$settings = new ilSetting('assessment');
if (!(int) $settings->get('quest_process_lock_mode_autoinit', 0)) {
    if ($settings->get('quest_process_lock_mode', 'none') == 'none') {
        $settings->set('quest_process_lock_mode', 'db');
    }
    $settings->set('quest_process_lock_mode_autoinit_done', 1);
}
?>
<#4423>
<?php 
if ($ilDB->tableColumnExists("usr_portfolio", "comments")) {
    // #14661 - centralized public comments setting
    include_once "Services/Notes/classes/class.ilNote.php";
    $data = array();
    $set = $ilDB->query("SELECT prtf.id,prtf.comments,od.type" . " FROM usr_portfolio prtf" . " JOIN object_data od ON (prtf.id = od.obj_id)");
    while ($row = $ilDB->fetchAssoc($set)) {
        $row["comments"] = (bool) $row["comments"];
        $data[] = $row;
    }
Ejemplo n.º 17
0
 /**
  * Save news and external webfeeds settings
  */
 public function saveSettings()
 {
     global $ilCtrl, $ilSetting;
     // empty news cache
     include_once "./Services/News/classes/class.ilNewsCache.php";
     $this->acache = new ilNewsCache();
     $this->acache->deleteAllEntries();
     $news_set = new ilSetting("news");
     $feed_set = new ilSetting("feed");
     $ilSetting->set("block_activated_news", $_POST["enable_internal_news"]);
     $ilSetting->set("block_activated_pdnews", $_POST["enable_internal_news"]);
     $news_set->set("enable_rss_for_internal", $_POST["enable_internal_rss"]);
     $news_set->set("max_items", $_POST["news_max_items"]);
     $news_set->set("acc_cache_mins", $_POST["news_acc_cache_mins"]);
     $news_set->set("pd_period", $_POST["news_pd_period"]);
     $news_set->set("default_visibility", $_POST["news_default_visibility"]);
     $news_set->set("allow_shorter_periods", $_POST["allow_shorter_periods"]);
     $news_set->set("allow_longer_periods", $_POST["allow_longer_periods"]);
     $news_set->set("rss_period", $_POST["news_rss_period"]);
     $news_set->set("rss_title_format", $_POST["rss_title_format"]);
     $feed_set->set("disable_rep_feeds", $_POST["disable_repository_feeds"]);
     $ilSetting->set("block_limit_pdfeed", $_POST["nr_pd_feeds"]);
     if ($_POST["nr_pd_feeds"] > 0) {
         $ilSetting->set("block_activated_pdfeed", 1);
     } else {
         $ilSetting->set("block_activated_pdfeed", 0);
     }
     if ($_POST["enable_internal_rss"] != 0) {
         $news_set->set("enable_private_feed", $_POST["enable_private_feed"]);
     } else {
         $news_set->set("enable_private_feed", 0);
     }
     ilUtil::sendSuccess($this->lng->txt("settings_saved"), true);
     $ilCtrl->redirect($this, "view");
 }
 /**
  * write object data into db
  * @param	boolean
  */
 private function write()
 {
     $settings = new ilSetting('disk_quota');
     $settings->set('enabled', $this->diskQuotaEnabled);
     $settings->set('reminder_mail_enabled', $this->diskQuotaReminderMailEnabled);
     $settings->set('summary_mail_enabled', $this->isDiskQuotaSummaryMailEnabled() ? 1 : 0);
     $settings->set('summary_rcpt', $this->getSummaryRecipients());
 }
 /**
  * Save survey settings
  */
 function saveSettingsObject()
 {
     global $ilCtrl, $ilAccess;
     if (!$ilAccess->checkAccess("write", "", $this->object->getRefId())) {
         $ilCtrl->redirect($this, "settings");
     }
     $surveySetting = new ilSetting("survey");
     $surveySetting->set("unlimited_invitation", $_POST["unlimited_invitation"] ? "1" : "0");
     $surveySetting->set("use_anonymous_id", $_POST["use_anonymous_id"] ? "1" : "0");
     ilUtil::sendSuccess($this->lng->txt("msg_obj_modified"), true);
     $ilCtrl->redirect($this, "settings");
 }
 public static function createDefaultPublicRoom($force = false)
 {
     /**
      * @var $ilDB ilDB
      */
     global $ilDB;
     if ($force) {
         $query = 'DELETE FROM chatroom_settings WHERE room_type = ' . $ilDB->quote('default', 'text');
         $ilDB->manipulate($query);
         $create = true;
     } else {
         $query = 'SELECT * FROM chatroom_settings WHERE room_type = ' . $ilDB->quote('default', 'text');
         $rset = $ilDB->query($query);
         $create = !$ilDB->fetchAssoc($rset);
     }
     if ($create) {
         require_once 'Modules/Chatroom/classes/class.ilObjChatroom.php';
         $newObj = new ilObjChatroom();
         $newObj->setType('chtr');
         $newObj->setTitle('Public Chat');
         $newObj->setDescription('');
         $newObj->create();
         // true for upload
         $newObj->createReference();
         $newObj->putInTree(1);
         $newObj->setPermissions(1);
         $obj_id = $newObj->getId();
         $ref_id = $newObj->getRefId();
         $id = $ilDB->nextId('chatroom_settings');
         $ilDB->insert('chatroom_settings', array('room_id' => array('integer', $id), 'object_id' => array('integer', $obj_id), 'room_type' => array('text', 'default'), 'allow_anonymous' => array('integer', 0), 'allow_custom_usernames' => array('integer', 0), 'enable_history' => array('integer', 0), 'restrict_history' => array('integer', 0), 'autogen_usernames' => array('text', 'Anonymous #'), 'allow_private_rooms' => array('integer', 1)));
         $settings = new ilSetting('chatroom');
         $settings->set('public_room_ref', $ref_id);
     }
 }
 /**
  * Save settings
  */
 public function saveSettings()
 {
     /**
      * @var $ilSetting ilSetting
      */
     global $ilSetting;
     $this->checkPermission("write");
     $form = $this->getSettingsForm();
     if (!$form->checkInput()) {
         $form->setValuesByPost();
         $this->editSettings($form);
         return;
     }
     $frma_set = new ilSetting('frma');
     $frma_set->set('forum_overview', $form->getInput('forum_overview'));
     $ilSetting->set('enable_fora_statistics', (int) $form->getInput('fora_statistics'));
     $ilSetting->set('enable_anonymous_fora', (int) $form->getInput('anonymous_fora'));
     require_once 'Services/Cron/classes/class.ilCronManager.php';
     if (!ilCronManager::isJobActive('frm_notification')) {
         $ilSetting->set('forum_notification', (int) $form->getInput('forum_notification'));
     }
     require_once 'Services/Captcha/classes/class.ilCaptchaUtil.php';
     ilCaptchaUtil::setActiveForForum((bool) $form->getInput('activate_captcha_anonym'));
     ilUtil::sendSuccess($this->lng->txt('settings_saved'));
     $form->setValuesByPost();
     $this->editSettings($form);
 }
 /**
  * Save MathJax Setttings
  */
 function saveMathJaxObject()
 {
     global $ilCtrl, $lng, $ilAccess;
     if ($ilAccess->checkAccess("write", "", $this->object->getRefId())) {
         $path_to_mathjax = ilUtil::stripSlashes($_POST["path_to_mathjax"]);
         $mathJaxSetting = new ilSetting("MathJax");
         if ($_POST["enable"]) {
             $mathJaxSetting->set("path_to_mathjax", $path_to_mathjax);
             $mathJaxSetting->set("limiter", (int) $_POST["limiter"]);
         }
         $mathJaxSetting->set("enable", ilUtil::stripSlashes($_POST["enable"]));
         ilUtil::sendInfo($lng->txt("msg_obj_modified"));
     }
     $ilCtrl->redirect($this, "editMathJax");
 }
Ejemplo n.º 23
0
 public function saveApacheSettingsObject()
 {
     global $ilCtrl;
     $form = $this->getApacheAuthSettingsForm();
     $form->setValuesByPost();
     /*$items = $form->getItems();
     		foreach($items as $item)
     			$item->validate();*/
     if ($form->checkInput()) {
         $settings = new ilSetting('apache_auth');
         $fields = array('apache_auth_indicator_name', 'apache_auth_indicator_value', 'apache_enable_auth', 'apache_enable_local', 'apache_local_autocreate', 'apache_enable_ldap', 'apache_auth_username_config_type', 'apache_auth_username_direct_mapping_fieldname', 'apache_default_role', 'apache_auth_target_override_login_page', 'apache_auth_enable_override_login_page', 'apache_auth_authenticate_on_login_page');
         foreach ($fields as $field) {
             $settings->set($field, $form->getInput($field));
         }
         if ($form->getInput('apache_enable_auth')) {
             $this->ilias->setSetting('apache_active', true);
         } else {
             $this->ilias->setSetting('apache_active', false);
             global $ilSetting;
             if ($ilSetting->get("auth_mode") == AUTH_APACHE) {
                 $ilSetting->set("auth_mode", AUTH_LOCAL);
             }
         }
         $allowedDomains = $this->validateApacheAuthAllowedDomains($form->getInput('apache_auth_domains'));
         file_put_contents(ILIAS_DATA_DIR . '/' . CLIENT_ID . '/apache_auth_allowed_domains.txt', $allowedDomains);
         ilUtil::sendSuccess($this->lng->txt('apache_settings_changed_success'), true);
         $this->ctrl->redirect($this, 'apacheAuthSettings');
     } else {
         $this->apacheAuthSettingsObject($form);
     }
 }
 /**
  * Save forbidden tags
  */
 public function saveForbiddenTags()
 {
     global $tpl, $lng, $ilCtrl;
     $this->initForbiddenTagsForm();
     $this->form->checkInput();
     $this->checkPermission("write");
     $tags = str_replace(",", " ", $_POST["forbidden_tags"]);
     $tags = explode(" ", $tags);
     $tags_array = array();
     foreach ($tags as $t) {
         $t = strtolower(trim($t));
         if ($t != "") {
             $tags_array[$t] = $t;
         }
     }
     asort($tags_array);
     $tags_set = new ilSetting("tags");
     $tags_set->set("forbidden_tags", serialize($tags_array));
     ilUtil::sendSuccess($lng->txt("msg_obj_modified"), true);
     $ilCtrl->redirect($this, "editForbiddenTags");
 }
 /**
  * Init next task execution
  * @global <type> $ilDB
  * @global <type> $ilSetting
  */
 protected function initTaskScheduler()
 {
     global $ilDB, $ilSetting;
     #$ilDB->lockTables(array('name' => 'settings', 'type' => ilDB::LOCK_WRITE));
     $setting = new ilSetting('ecs');
     $setting->set('next_execution_' . $this->settings->getServerId(), time() + (int) $this->settings->getPollingTime());
 }
 /**
  * Save Google Maps Setttings
  */
 function saveGoogleMapsObject()
 {
     global $ilCtrl;
     $gm_set = new ilSetting("google_maps");
     $gm_set->set("enable", ilUtil::stripSlashes($_POST["enable"]));
     $gm_set->set("std_latitude", ilUtil::stripSlashes($_POST["std_location"]["latitude"]));
     $gm_set->set("std_longitude", ilUtil::stripSlashes($_POST["std_location"]["longitude"]));
     $gm_set->set("std_zoom", ilUtil::stripSlashes($_POST["std_location"]["zoom"]));
     $ilCtrl->redirect($this, "editGoogleMaps");
 }
Ejemplo n.º 27
0
 /**
  * write one value to settings table
  * @access	public
  * @param	string		keyword
  * @param	string		value
  * @return	boolean		true on success
  */
 function setSetting($a_key, $a_val)
 {
     include_once './Services/Administration/classes/class.ilSetting.php';
     $set = new ilSetting("common", true);
     $set->set($a_key, $a_val);
 }
 /**
  * Save Assessment settings
  */
 public function saveSettingsObject()
 {
     global $ilAccess;
     if (!$ilAccess->checkAccess("write", "", $this->object->getRefId())) {
         $this->ctrl->redirect($this, 'settings');
     }
     $form = $this->buildSettingsForm();
     if (!$form->checkInput()) {
         $form->setValuesByPost();
         return $this->settingsObject($form);
     }
     $this->object->_setManualScoring($_POST["chb_manual_scoring"]);
     include_once "./Modules/TestQuestionPool/classes/class.ilObjQuestionPool.php";
     $questiontypes =& ilObjQuestionPool::_getQuestionTypes(TRUE);
     $forbidden_types = array();
     foreach ($questiontypes as $name => $row) {
         if (!in_array($row["question_type_id"], $_POST["chb_allowed_questiontypes"])) {
             array_push($forbidden_types, $row["question_type_id"]);
         }
     }
     $this->object->_setForbiddenQuestionTypes($forbidden_types);
     $this->object->setScoringAdjustmentEnabled($_POST['chb_scoring_adjust']);
     $scoring_types = array();
     foreach ($questiontypes as $name => $row) {
         if (in_array($row["question_type_id"], (array) $_POST["chb_scoring_adjustment"])) {
             array_push($scoring_types, $row["question_type_id"]);
         }
     }
     $this->object->setScoringAdjustableQuestions($scoring_types);
     if (!$_POST['ass_process_lock']) {
         $this->object->setAssessmentProcessLockMode(ilObjAssessmentFolder::ASS_PROC_LOCK_MODE_NONE);
     } elseif (in_array($_POST['ass_process_lock_mode'], ilObjAssessmentFolder::getValidAssessmentProcessLockModes())) {
         $this->object->setAssessmentProcessLockMode($_POST['ass_process_lock_mode']);
     }
     $assessmentSetting = new ilSetting('assessment');
     $assessmentSetting->set('use_javascript', '1');
     if (strlen($_POST['imap_line_color']) == 6) {
         $assessmentSetting->set('imap_line_color', ilUtil::stripSlashes($_POST['imap_line_color']));
     }
     $assessmentSetting->set('user_criteria', ilUtil::stripSlashes($_POST['user_criteria']));
     ilUtil::sendSuccess($this->lng->txt("msg_obj_modified"), true);
     $this->ctrl->redirect($this, 'settings');
 }
 /**
  * Writes an array with allowed HTML tags to the ILIAS settings
  *
  * Writes an array with allowed HTML tags to the ILIAS settings
  *
  * @param array $a_html_tags An array containing the allowed HTML tags
  * @param string $a_module The name of the module or object which uses the tags
  * @throws ilAdvancedEditingRequiredTagsException
  * 
  */
 function _setUsedHTMLTags($a_html_tags, $a_module)
 {
     global $lng;
     if (strlen($a_module)) {
         $auto_added_tags = array();
         // frm_posts need blockquote and div urgently
         if ($a_module == 'frm_post') {
             if (!in_array('div', $a_html_tags)) {
                 $auto_added_tags[] = 'div';
             }
             if (!in_array('blockquote', $a_html_tags)) {
                 $auto_added_tags[] = 'blockquote';
             }
         }
         include_once "./Services/Administration/classes/class.ilSetting.php";
         $setting = new ilSetting("advanced_editing");
         $setting->set("advanced_editing_used_html_tags_" . $a_module, serialize(array_merge((array) $a_html_tags, $auto_added_tags)));
         if (count($auto_added_tags)) {
             require_once 'Services/AdvancedEditing/exceptions/class.ilAdvancedEditingRequiredTagsException.php';
             throw new ilAdvancedEditingRequiredTagsException(sprintf($lng->txt('advanced_editing_required_tags'), implode(', ', $auto_added_tags)));
         }
     }
 }
Ejemplo n.º 30
0
 public function switchTree()
 {
     $set = new ilSetting('common');
     $type = $set->get('main_tree_impl', 'ns') == 'ns' ? 'ns' : 'mp';
     if ($type == 'ns' and $_POST['tree_impl_type'] == 'mp') {
         // To mp
         include_once './Services/Tree/classes/class.ilMaterializedPathTree.php';
         ilMaterializedPathTree::createFromParentReleation();
         $set->set('main_tree_impl', 'mp');
     } elseif ($type == 'mp' and $_POST['tree_impl_type'] == 'ns') {
         include_once './Services/Tree/classes/class.ilTree.php';
         $GLOBALS['ilSetting'] = $set;
         $tree = new ilTree(1);
         $tree->renumber(1);
         $set->set('main_tree_impl', 'ns');
     }
     ilUtil::sendInfo($this->lng->txt("tree_implementation_switched"), true);
     $this->displayTools();
 }