// get language options $lang_list = ''; for ($i = 0; $i < count($core_config['plugins']['list']['language']); $i++) { $language = $core_config['plugins']['list']['language'][$i]; $c_language_title = $plugin_config[$language]['title']; if ($c_language_title) { $lang_list[$c_language_title] = $language; } } if (is_array($lang_list)) { $options['language_module'] = _options($lang_list, $site_config['language_module']); } $tpl = array('name' => 'site', 'vars' => array('ACTION_URL' => _u('index.php?app=main&inc=core_site&op=site_config_save'), 'HINT_ENABLE_LOGO' => _hint(_('Logo by default will be displayed at login, register and forgot password page')), 'HINT_DOMAIN' => _hint('Put your domain name here and then set your domain DNS A record to this server IP address'), 'DIALOG_DISPLAY' => _dialog(), 'Manage site' => _('Manage site'), 'Site configuration' => _('Site configuration'), 'Configuration' => _('Configuration'), 'Information page' => _('Information page'), 'Buy credit page' => _('Buy credit page'), 'Page title' => _('Page title'), 'Page content' => _('Page content'), 'Domain' => _('Domain'), 'Website title' => _('Website title'), 'Email service' => _('Email service'), 'Email footer' => _('Email footer'), 'Main website name' => _('Main website name'), 'Main website URL' => _('Main website URL'), 'Enable logo' => _('Enable logo'), 'Logo URL' => _('Logo URL'), 'Replace website title with logo' => _('Replace website title with logo'), 'Enable public registration' => _('Enable public registration'), 'Enable forgot password' => _('Enable forgot password'), 'Active themes' => _('Active themes'), 'Default language' => _('Default language'), 'Default credit upon registration' => _('Default credit upon registration'), 'Layout footer' => _('Layout footer'), 'Save' => _('Save')), 'injects' => array('core_config', 'site_config', 'options')); _p(tpl_apply($tpl)); break; case "site_config_save": foreach ($_POST['up'] as $key => $val) { $up[$key] = $val; } $site = site_config_getbydomain($up['domain']); if ($up['domain'] && $site[0]['uid'] && $site[0]['uid'] != $user_config['uid']) { $_SESSION['dialog']['info'][] = _('The domain is already configured by other user') . ' (' . _('domain') . ':' . $up['domain'] . ')'; } else { site_config_set($up); $_SESSION['dialog']['info'][] = _('Site configuration has been saved'); } _log('site configuration saved. uid:' . $user_config['uid'] . ' domain:' . $up['domain'], 3, 'site'); header('Location:' . _u('index.php?app=main&inc=core_site&op=site_config')); exit; break; }
// save login session information user_session_set(); } // special setting to credit unicode SMS the same as normal SMS length // for example: 2 unicode SMS (140 chars length) will be deducted as 1 credit just like a normal SMS (160 chars length) $result = registry_search($user_config['uid'], 'core', 'user_config', 'enable_credit_unicode'); $user_config['opt']['enable_credit_unicode'] = (int) $result['core']['user_config']['enable_credit_unicode']; if (!$user_config['opt']['enable_credit_unicode']) { // global config overriden by user config $user_config['opt']['enable_credit_unicode'] = (int) $core_config['main']['enable_credit_unicode']; } } // override main config with site config for branding purposes distinguished by domain name $site_config = array(); if (!$core_config['daemon_process'] && $_SERVER['HTTP_HOST']) { $s = site_config_getbydomain($_SERVER['HTTP_HOST']); if ((int) $s[0]['uid']) { $c_site_config = site_config_get((int) $s[0]['uid']); if (strtolower($c_site_config['domain']) == strtoloweR($_SERVER['HTTP_HOST'])) { $site_config = array_merge($c_site_config, $s[0]); } } } if (!$core_config['daemon_process'] && trim($_SERVER['HTTP_HOST']) && trim($site_config['domain']) && strtolower(trim($_SERVER['HTTP_HOST'])) == strtolower(trim($site_config['domain']))) { $core_config['main'] = array_merge($core_config['main'], $site_config); } // verify selected themes_module exists $fn1 = _APPS_PATH_PLUG_ . '/themes/' . core_themes_get() . '/config.php'; $fn2 = _APPS_PATH_PLUG_ . '/themes/' . core_themes_get() . '/fn.php'; if (!(file_exists($fn1) && file_exists($fn2))) { logger_print('Fail to load themes ' . core_themes_get(), 1, 'init');