public function save() { requirePermission("toggleMessage"); $fusionConfig = new ConfigEditor("application/config/message.php"); $fusionConfig->set('message_enabled', $this->input->post('message_enabled')); $fusionConfig->set('message_headline', $this->input->post('message_headline')); $fusionConfig->set('message_headline_size', $this->input->post('message_headline_size')); $fusionConfig->set('message_text', $this->input->post('message_text')); $fusionConfig->save(); die("The announcement has been saved!"); }
public function save() { requirePermission("toggleMessage"); $fusionConfig = new ConfigEditor("application/config/message.php"); $fusionConfig->set('message_enabled', $this->input->post('message_enabled')); $fusionConfig->set('message_headline', $this->input->post('message_headline')); $fusionConfig->set('message_headline_size', $this->input->post('message_headline_size')); $fusionConfig->set('message_text', $this->input->post('message_text')); $fusionConfig->save(); die("اطلاعیه با موفقیت ذخیره شد"); }
public function set($theme = false) { if (!$theme || !file_exists("application/themes/" . $theme)) { die('Invalid theme'); } $fusionConfig = new ConfigEditor("application/config/fusion.php"); $fusionConfig->set('theme', $theme); $fusionConfig->save(); $this->cache->delete('*.cache'); $this->cache->delete('messages/*.cache'); $this->cache->delete('search/*.cache'); die('yes'); }
public function set() { $language = $this->input->post('language'); requirePermission("changeDefaultLanguage"); require_once 'application/libraries/configeditor.php'; if (!$language || !is_dir("application/language/" . $language)) { die("Invalid language"); } $fusionConfig = new ConfigEditor("application/config/default_language.php"); $fusionConfig->set("language", $language); $fusionConfig->save(); die('success'); }
public function set($theme = false) { if (!$theme || !file_exists("application/themes/" . $theme)) { die('قالب نا معتبر است'); } $fusionConfig = new ConfigEditor("application/config/fusion.php"); $fusionConfig->set('theme', $theme); $fusionConfig->save(); $this->cache->delete('*.cache'); $this->cache->delete('messages/*.cache'); $this->cache->delete('search/*.cache'); die('قالب با موفقیت تغییر یافت'); }
public function saveHeader() { requirePermission("changeThemeHeader"); $header_url = $this->input->post('header_url'); require_once 'application/libraries/configeditor.php'; $fusionConfig = new ConfigEditor("application/config/fusion.php"); $fusionConfig->set('header_url', $header_url); $fusionConfig->save(); }
public function saveSettings() { requirePermission("editSlider"); require_once 'application/libraries/configeditor.php'; $slider = $this->input->post("show_slider"); if (!is_numeric($this->input->post("slider_interval")) || !$this->input->post("slider_interval")) { $slider_interval = 3000; } else { $slider_interval = (int) $this->input->post("slider_interval") * 1000; } $slider_style = $this->input->post("slider_style"); if ($slider == "always") { $slider = true; $slider_home = false; } elseif ($slider == "home") { $slider = true; $slider_home = true; } else { $slider = false; $slider_home = false; } $fusionConfig = new ConfigEditor("application/config/fusion.php"); $fusionConfig->set('slider', $slider); $fusionConfig->set('slider_interval', $slider_interval); $fusionConfig->set('slider_home', $slider_home); $fusionConfig->set('slider_style', $slider_style); $fusionConfig->save(); die("UI.alert('Settings have been saved!')"); }
public function save($module = false, $name = false) { if (!$name || !$module || !$this->configExists($module, $name)) { die("Invalid module or config name"); } else { if ($this->input->post()) { $fusionConfig = new ConfigEditor("application/modules/" . $module . "/config/" . $name . ".php"); foreach ($this->input->post() as $key => $value) { $fusionConfig->set($key, $value); } $fusionConfig->save(); die("The settings have been saved!"); } else { die("No data to set"); } } }
public function saveSmtp() { $fusionConfig = new ConfigEditor("application/config/smtp.php"); $fusionConfig->set('use_own_smtp_settings', $this->input->post('use_own_smtp_settings')); $fusionConfig->set('smtp_host', $this->input->post('smtp_host')); $fusionConfig->set('smtp_user', $this->input->post('smtp_user')); $fusionConfig->set('smtp_pass', $this->input->post('smtp_pass')); $fusionConfig->set('smtp_port', $this->input->post('smtp_port')); $fusionConfig->save(); die('بله'); }
private function config() { $owner = fopen("../application/config/owner.php", "w"); fwrite($owner, '<?php $config["owner"] = "' . addslashes($_POST['superadmin']) . '";'); fclose($owner); require_once '../application/libraries/configeditor.php'; $distConfig = '../application/config/fusion.php.dist'; $config = '../application/config/fusion.php'; if (file_exists($distConfig)) { copy($distConfig, $config); } // preserve the original in-case they mess up the new one $config = new ConfigEditor($config); $data['title'] = $_POST['title']; $data['server_name'] = $_POST['server_name']; $data['realmlist'] = $_POST['realmlist']; $data['keywords'] = $_POST['keywords']; $data['description'] = $_POST['description']; $data['analytics'] = $_POST['analytics'] ? $_POST['analytics'] : false; $data['cdn'] = $_POST['cdn'] == "yes" ? true : false; $data['security_code'] = $_POST['security_code']; foreach ($data as $key => $value) { $config->set($key, $value); } if (in_array($_POST['emulator'], array('arcemu', 'summitemu'))) { switch ($_POST['expansion']) { case "wotlk": $config->set('disabled_expansions', array(32)); break; case "tbc": $config->set('disabled_expansions', array(24, 32)); break; case "vanilla": $config->set('disabled_expansions', array(8, 24, 32)); break; } } else { switch ($_POST['expansion']) { case "wotlk": $config->set('disabled_expansions', array(3)); break; case "tbc": $config->set('disabled_expansions', array(2, 3)); break; case "vanilla": $config->set('disabled_expansions', array(1, 2, 3)); break; default: $config->set('disabled_expansions', array()); break; } } $config->save(); $db = fopen("../application/config/database.php", "w"); $raw = '<?php $active_group = "cms"; $active_record = TRUE; $db["cms"]["hostname"] = "' . $_POST['cms_hostname'] . '"; $db["cms"]["username"] = "******"; $db["cms"]["password"] = "******"; $db["cms"]["database"] = "' . $_POST['cms_database'] . '"; $db["cms"]["port"] = ' . (is_numeric($_POST['cms_port']) ? $_POST['cms_port'] : self::MYSQL_DEFAULT_PORT) . '; $db["cms"]["dbdriver"] = "mysqli"; $db["cms"]["dbprefix"] = ""; $db["cms"]["pconnect"] = TRUE; $db["cms"]["db_debug"] = TRUE; $db["cms"]["cache_on"] = FALSE; $db["cms"]["cachedir"] = ""; $db["cms"]["char_set"] = "utf8"; $db["cms"]["dbcollat"] = "utf8_general_ci"; $db["cms"]["swap_pre"] = ""; $db["cms"]["autoinit"] = TRUE; $db["cms"]["stricton"] = FALSE; $db["account"]["hostname"] = "' . $_POST['realmd_hostname'] . '"; $db["account"]["username"] = "******"; $db["account"]["password"] = "******"; $db["account"]["database"] = "' . $_POST['realmd_database'] . '"; $db["account"]["port"] = ' . (is_numeric($_POST['realmd_port']) ? $_POST['realmd_port'] : self::MYSQL_DEFAULT_PORT) . '; $db["account"]["dbdriver"] = "mysqli"; $db["account"]["dbprefix"] = ""; $db["account"]["pconnect"] = TRUE; $db["account"]["db_debug"] = TRUE; $db["account"]["cache_on"] = FALSE; $db["account"]["cachedir"] = ""; $db["account"]["char_set"] = "utf8"; $db["account"]["dbcollat"] = "utf8_general_ci"; $db["account"]["swap_pre"] = ""; $db["account"]["autoinit"] = FALSE; $db["account"]["stricton"] = FALSE;'; fwrite($db, $raw); fclose($db); die('1'); }
public function save($module = false, $name = false) { if (!$name || !$module || !$this->configExists($module, $name)) { die("ماژول نامعتبر است یا نام آن نامعتبر است"); } else { if ($this->input->post()) { $fusionConfig = new ConfigEditor("application/modules/" . $module . "/config/" . $name . ".php"); foreach ($this->input->post() as $key => $value) { $fusionConfig->set($key, $value); } $fusionConfig->save(); die("تنظیمات با موفقیت ذخیره شد"); } else { die("داده ای وارد نشده"); } } }