function restore()
{
    global $db;
    $db->query('DELETE FROM ' . $db->prefix . 'config WHERE conf_name = \'o_welcome_mp\' LIMIT 1;') or error('Unable to alter DB structure.', __FILE__, __LINE__, $db->error());
    $db->query('DELETE FROM ' . $db->prefix . 'config WHERE conf_name = \'o_welcome_message_mp\' LIMIT 1;') or error('Unable to alter DB structure.', __FILE__, __LINE__, $db->error());
    // Regenerate the config cache
    require_once PUN_ROOT . 'include/cache.php';
    generate_config_cache();
}
function install()
{
    global $db, $db_type, $pun_config;
    //include PUN_ROOT.'include/attach/attach_incl.php';
    //first look if we have attachment mod 2.0
    if ($pun_config['attach_cur_version'] != '2.0') {
        error('You must have the attachment mod 2.0 installed before updating from it.');
    }
    // ok, update the rules so that no rule is larger than what is max allowed...
    $db->query('UPDATE ' . $db->prefix . 'attach_2_rules SET size = \'' . $pun_config['attach_max_size'] . '\' WHERE size > \'' . $pun_config['attach_max_size'] . '\'') or error('Unable to update the maxsize in existing rules to the maxsize for the whole forum');
    // and then update the cache ...
    $db->query('UPDATE ' . $db->prefix . 'config SET conf_value = \'' . $db->escape('2.0.1') . '\' WHERE conf_name = \'attach_cur_version\'') or error('Unable to edit row "attach_cur_version" in config table', __FILE__, __LINE__, $db->error());
    // and now, update the cache...
    require_once PUN_ROOT . 'include/cache.php';
    generate_config_cache();
}
function install($basepath = '')
{
    global $db, $db_type, $pun_config;
    //include PUN_ROOT.'include/attach/attach_incl.php';
    //first check so that the path seems reasonable
    if (!((substr($basepath, 0, 1) == '/' || substr($basepath, 1, 1) == ':') && substr($basepath, -1) == '/')) {
        error('The pathname specified doesn\'t comply with the rules set. Go back and make sure that it\'s the complete path, and that it ends with a slash and that it either start with a slash (example: "/home/username/attachments/", on *nix servers (unix, linux, bsd, solaris etc.)) or a driveletter (example: "C:/webpages/attachments/" on windows servers)');
    }
    // create the neccessary tables
    // create the files table
    $db->query("CREATE TABLE IF NOT EXISTS `" . $db->prefix . "attach_2_files` (\r\n\t\t`id` int(10) unsigned NOT NULL auto_increment,\r\n\t\t`owner` int(10) unsigned NOT NULL default '0',\r\n  \t\t`post_id` int(10) unsigned NOT NULL default '0',\r\n  \t\t`filename` varchar(255) NOT NULL default 'error.file',\r\n  \t\t`extension` varchar(64) NOT NULL default 'error.file',\r\n  \t\t`mime` varchar(64) NOT NULL default '',\r\n  \t\t`location` text NOT NULL,\r\n  \t\t`size` int(10) unsigned NOT NULL default '0',\r\n  \t\t`downloads` int(10) unsigned NOT NULL default '0',\r\n  \t\tUNIQUE KEY `id` (`id`)) ENGINE=MyISAM;") or error('Unable to add table "attach_2_files" to database', __FILE__, __LINE__, $db->error());
    // create the rules table
    $db->query("CREATE TABLE IF NOT EXISTS `" . $db->prefix . "attach_2_rules` (\r\n  \t\t`id` int(10) unsigned NOT NULL auto_increment,\r\n  \t\t`forum_id` int(10) unsigned NOT NULL default '0',\r\n  \t\t`group_id` int(10) unsigned NOT NULL default '0',\r\n  \t\t`rules` int(10) unsigned NOT NULL default '0',\r\n  \t\t`size` int(10) unsigned NOT NULL default '0',\r\n  \t\t`per_post` tinyint(4) NOT NULL default '1',\r\n  \t\t`file_ext` text NOT NULL,\r\n  \t\tUNIQUE KEY `id` (`id`)) ENGINE=MyISAM;") or error('Unable to add table "attach_2_rules" to database', __FILE__, __LINE__, $db->error());
    //ok path could be correct, try to make a subfolder :D
    $newname = attach_generate_pathname($basepath);
    if (!attach_create_subfolder($newname, $basepath)) {
        error('Unable to create new subfolder with name "' . $newname . '", make sure php has write access to that folder!', __FILE__, __LINE__);
    }
    // ok, add the stuff needed in the config cache
    $attach_config = array('attach_always_deny' => 'html"htm"php"php3"php4"exe"com"bat', 'attach_basefolder' => $basepath, 'attach_create_orphans' => '1', 'attach_cur_version' => '2.0.1', 'attach_icon_folder' => 'img/attach/', 'attach_icon_extension' => 'txt"doc"pdf"wav"mp3"ogg"avi"mpg"mpeg"png"jpg"jpeg"gif', 'attach_icon_name' => 'text.png"doc.png"doc.png"audio.png"audio.png"audio.png"video.png"video.png"video.png"image.png"image.png"image.png"image.png', 'attach_max_size' => '2000', 'attach_subfolder' => $newname, 'attach_use_icon' => '1');
    foreach ($attach_config as $key => $value) {
        $db->query("INSERT INTO " . $db->prefix . "config (conf_name, conf_value) VALUES ('{$key}', '" . $db->escape($value) . "')") or error('Unable to add column "' . $key . '" to config table', __FILE__, __LINE__, $db->error());
    }
    // and now, update the cache...
    require_once PUN_ROOT . 'include/cache.php';
    generate_config_cache();
    /*
    	DO MOD INSTALLATION HERE
    
    	Here's an example showing how to run different queries depending on $db_type.
    	NOTE: This is just an example! Replace it with whatever queries your mod needs to run.
    
    	switch ($db_type)
    	{
    		case 'mysql':
    		case 'mysqli':
    			$db->query("ALTER TABLE ".$db->prefix."some_table ADD some_column TINYINT(1) NOT NULL DEFAULT 1") or error('Unable to add column "some_column" to table "some_table"', __FILE__, __LINE__, $db->error());
    			break;
    
    		default:
    			$db->query('ALTER TABLE ".$db->prefix."some_table ADD some_column INT(10) NOT NULL DEFAULT 1') or error('Unable to add column "some_column" to table "some_table"', __FILE__, __LINE__, $db->error());
    			break;
    	}
    */
}
Example #4
0
 public function update_permissions()
 {
     global $lang_admin_permissions;
     $form = array_map('intval', $this->request->post('form'));
     foreach ($form as $key => $input) {
         // Make sure the input is never a negative value
         if ($input < 0) {
             $input = 0;
         }
         // Only update values that have changed
         if (array_key_exists('p_' . $key, $this->config) && $this->config['p_' . $key] != $input) {
             DB::for_table('config')->where('conf_name', 'p_' . $key)->update_many('conf_value', $input);
         }
     }
     // Regenerate the config cache
     if (!defined('FORUM_CACHE_FUNCTIONS_LOADED')) {
         require FEATHER_ROOT . 'include/cache.php';
     }
     generate_config_cache();
     redirect(get_link('admin/permissions/'), $lang_admin_permissions['Perms updated redirect']);
 }
function install()
{
    global $db, $db_type, $pun_config;
    $sql1 = 'CREATE TABLE ' . $db->prefix . "chatbox_msg (\r\n    id int(10) NOT NULL AUTO_INCREMENT,\r\n    poster VARCHAR(200) default NULL,\r\n    poster_id INT(10) NOT NULL DEFAULT '1',\r\n    poster_ip VARCHAR(15) default NULL,\r\n    poster_email VARCHAR(50) default NULL,\r\n    message TEXT,\r\n    posted INT(10) NOT NULL default '0',\r\n    PRIMARY KEY  (id)\r\n    ) TYPE=MyISAM;";
    $db->query($sql1) or error('Unable to create table ' . $db->prefix . 'chatbox_msg.', __FILE__, __LINE__, $db->error());
    $sql2 = 'ALTER TABLE ' . $db->prefix . "groups\r\n    ADD g_read_chatbox TINYINT(1) default '1' NOT NULL ,\r\n    ADD g_post_chatbox TINYINT(1) default '1' NOT NULL ,\r\n    ADD g_title_chatbox TEXT default NULL,\r\n    ADD g_post_flood_chatbox SMALLINT(6) default '5' NOT NULL";
    $db->query($sql2) or error('Unable to add column to groups table.', __FILE__, __LINE__, $db->error());
    $sql3 = 'ALTER TABLE ' . $db->prefix . "users\r\n    ADD num_posts_chatbox INT(10) NOT NULL default '0',\r\n    ADD last_post_chatbox INT(10) default NULL";
    $db->query($sql3) or error('Unable to add column to users table.', __FILE__, __LINE__, $db->error());
    $chatbox_config = array('cb_height' => '500', 'cb_msg_maxlength' => '300', 'cb_max_msg' => '50', 'cb_disposition' => '<strong><pun_username></strong> - <pun_date> - [ <pun_nbpost><pun_nbpost_txt> ] <pun_admin><br /><pun_message><br /><br />', 'cb_pbb_version' => '1.0');
    foreach ($chatbox_config as $key => $value) {
        $db->query("INSERT INTO " . $db->prefix . "config (conf_name, conf_value) VALUES ('{$key}', '" . $db->escape($value) . "')") or error('Unable to add column "' . $key . '" to config table', __FILE__, __LINE__, $db->error());
    }
    $db->query('UPDATE ' . $db->prefix . 'groups SET g_title_chatbox=\'<strong>[Admin]</strong>&nbsp;-&nbsp;\', g_read_chatbox=1, g_post_chatbox=1, g_post_flood_chatbox=0 WHERE g_id=1') or error('Unable to update group', __FILE__, __LINE__, $db->error());
    $db->query('UPDATE ' . $db->prefix . 'groups SET g_title_chatbox=\'<strong>[Modo]</strong>&nbsp;-&nbsp;\', g_read_chatbox=1, g_post_chatbox=1, g_post_flood_chatbox=0 WHERE g_id=2') or error('Unable to update group', __FILE__, __LINE__, $db->error());
    $db->query('UPDATE ' . $db->prefix . 'groups SET g_read_chatbox=1, g_post_chatbox=0, g_post_flood_chatbox=10 WHERE g_id=3') or error('Unable to update group', __FILE__, __LINE__, $db->error());
    $db->query('UPDATE ' . $db->prefix . 'groups SET g_read_chatbox=1, g_post_chatbox=1, g_post_flood_chatbox=5 WHERE g_id=4') or error('Unable to update group', __FILE__, __LINE__, $db->error());
    // and now, update the cache...
    require_once PUN_ROOT . 'include/cache.php';
    generate_config_cache();
    /*
    	DO MOD INSTALLATION HERE
    
    	Here's an example showing how to run different queries depending on $db_type.
    	NOTE: This is just an example! Replace it with whatever queries your mod needs to run.
    
    	switch ($db_type)
    	{
    		case 'mysql':
    		case 'mysqli':
    			$db->query("ALTER TABLE ".$db->prefix."some_table ADD some_column TINYINT(1) NOT NULL DEFAULT 1") or error('Unable to add column "some_column" to table "some_table"', __FILE__, __LINE__, $db->error());
    			break;
    
    		default:
    			$db->query('ALTER TABLE ".$db->prefix."some_table ADD some_column INT(10) NOT NULL DEFAULT 1') or error('Unable to add column "some_column" to table "some_table"', __FILE__, __LINE__, $db->error());
    			break;
    	}
    */
}
Example #6
0
define('FORUM_MOD', 2);
define('FORUM_GUEST', 3);
define('FORUM_MEMBER', 4);
// Load DB abstraction layer and connect
require FORUM_ROOT . 'include/dblayer/common_db.php';
// Start a transaction
$db->start_transaction();
// Load cached config
if (file_exists(FORUM_CACHE_DIR . 'cache_config.php')) {
    include FORUM_CACHE_DIR . 'cache_config.php';
}
if (!defined('FORUM_CONFIG_LOADED')) {
    if (!defined('FORUM_CACHE_FUNCTIONS_LOADED')) {
        require FORUM_ROOT . 'include/cache.php';
    }
    generate_config_cache();
    require FORUM_CACHE_DIR . 'cache_config.php';
}
// Let's guess a base_url
if (!isset($base_url)) {
    $base_url_take = (isset($_SERVER['HTTPS']) && $_SERVER['HTTPS'] == 'on' ? 'https://' : 'http://') . preg_replace('/:80$/', '', $_SERVER['HTTP_HOST']) . str_replace('\\', '/', dirname($_SERVER['SCRIPT_NAME']));
    if (substr($base_url_take, -1) == '/') {
        $base_url_take = substr($base_url_take, 0, -1);
    }
    if (substr($base_url_take, -10) == '/backstage') {
        $base_url_take = substr($base_url_take, 0, -10);
    }
    $base_url = $base_url_take;
}
// Verify that we are running the proper database schema revision
if (!array_key_exists('o_core_version', $luna_config) || version_compare($luna_config['o_core_version'], Version::FORUM_CORE_VERSION, '<')) {
Example #7
0
 public function update_options()
 {
     global $lang_admin_options, $lang_common;
     $form = array('board_title' => feather_trim($this->request->post('form_board_title')), 'board_desc' => feather_trim($this->request->post('form_board_desc')), 'base_url' => feather_trim($this->request->post('form_base_url')), 'default_timezone' => floatval($this->request->post('form_default_timezone')), 'default_dst' => $this->request->post('form_default_dst') != '1' ? '0' : '1', 'default_lang' => feather_trim($this->request->post('form_default_lang')), 'default_style' => feather_trim($this->request->post('form_default_style')), 'time_format' => feather_trim($this->request->post('form_time_format')), 'date_format' => feather_trim($this->request->post('form_date_format')), 'timeout_visit' => intval($this->request->post('form_timeout_visit')) > 0 ? intval($this->request->post('form_timeout_visit')) : 1, 'timeout_online' => intval($this->request->post('form_timeout_online')) > 0 ? intval($this->request->post('form_timeout_online')) : 1, 'redirect_delay' => intval($this->request->post('form_redirect_delay')) >= 0 ? intval($this->request->post('form_redirect_delay')) : 0, 'show_version' => $this->request->post('form_show_version') != '1' ? '0' : '1', 'show_user_info' => $this->request->post('form_show_user_info') != '1' ? '0' : '1', 'show_post_count' => $this->request->post('form_show_post_count') != '1' ? '0' : '1', 'smilies' => $this->request->post('form_smilies') != '1' ? '0' : '1', 'smilies_sig' => $this->request->post('form_smilies_sig') != '1' ? '0' : '1', 'make_links' => $this->request->post('form_make_links') != '1' ? '0' : '1', 'topic_review' => intval($this->request->post('form_topic_review')) >= 0 ? intval($this->request->post('form_topic_review')) : 0, 'disp_topics_default' => intval($this->request->post('form_disp_topics_default')), 'disp_posts_default' => intval($this->request->post('form_disp_posts_default')), 'indent_num_spaces' => intval($this->request->post('form_indent_num_spaces')) >= 0 ? intval($this->request->post('form_indent_num_spaces')) : 0, 'quote_depth' => intval($this->request->post('form_quote_depth')) > 0 ? intval($this->request->post('form_quote_depth')) : 1, 'quickpost' => $this->request->post('form_quickpost') != '1' ? '0' : '1', 'users_online' => $this->request->post('form_users_online') != '1' ? '0' : '1', 'censoring' => $this->request->post('form_censoring') != '1' ? '0' : '1', 'signatures' => $this->request->post('form_signatures') != '1' ? '0' : '1', 'show_dot' => $this->request->post('form_show_dot') != '1' ? '0' : '1', 'topic_views' => $this->request->post('form_topic_views') != '1' ? '0' : '1', 'quickjump' => $this->request->post('form_quickjump') != '1' ? '0' : '1', 'gzip' => $this->request->post('form_gzip') != '1' ? '0' : '1', 'search_all_forums' => $this->request->post('form_search_all_forums') != '1' ? '0' : '1', 'additional_navlinks' => feather_trim($this->request->post('form_additional_navlinks')), 'feed_type' => intval($this->request->post('form_feed_type')), 'feed_ttl' => intval($this->request->post('form_feed_ttl')), 'report_method' => intval($this->request->post('form_report_method')), 'mailing_list' => feather_trim($this->request->post('form_mailing_list')), 'avatars' => $this->request->post('form_avatars') != '1' ? '0' : '1', 'avatars_dir' => feather_trim($this->request->post('form_avatars_dir')), 'avatars_width' => intval($this->request->post('form_avatars_width')) > 0 ? intval($this->request->post('form_avatars_width')) : 1, 'avatars_height' => intval($this->request->post('form_avatars_height')) > 0 ? intval($this->request->post('form_avatars_height')) : 1, 'avatars_size' => intval($this->request->post('form_avatars_size')) > 0 ? intval($this->request->post('form_avatars_size')) : 1, 'admin_email' => strtolower(feather_trim($this->request->post('form_admin_email'))), 'webmaster_email' => strtolower(feather_trim($this->request->post('form_webmaster_email'))), 'forum_subscriptions' => $this->request->post('form_forum_subscriptions') != '1' ? '0' : '1', 'topic_subscriptions' => $this->request->post('form_topic_subscriptions') != '1' ? '0' : '1', 'smtp_host' => feather_trim($this->request->post('form_smtp_host')), 'smtp_user' => feather_trim($this->request->post('form_smtp_user')), 'smtp_ssl' => $this->request->post('form_smtp_ssl') != '1' ? '0' : '1', 'regs_allow' => $this->request->post('form_regs_allow') != '1' ? '0' : '1', 'regs_verify' => $this->request->post('form_regs_verify') != '1' ? '0' : '1', 'regs_report' => $this->request->post('form_regs_report') != '1' ? '0' : '1', 'rules' => $this->request->post('form_rules') != '1' ? '0' : '1', 'rules_message' => feather_trim($this->request->post('form_rules_message')), 'default_email_setting' => intval($this->request->post('form_default_email_setting')), 'announcement' => $this->request->post('form_announcement') != '1' ? '0' : '1', 'announcement_message' => feather_trim($this->request->post('form_announcement_message')), 'maintenance' => $this->request->post('form_maintenance') != '1' ? '0' : '1', 'maintenance_message' => feather_trim($this->request->post('form_maintenance_message')));
     if ($form['board_title'] == '') {
         message($lang_admin_options['Must enter title message']);
     }
     // Make sure base_url doesn't end with a slash
     if (substr($form['base_url'], -1) == '/') {
         $form['base_url'] = substr($form['base_url'], 0, -1);
     }
     // Convert IDN to Punycode if needed
     if (preg_match('/[^\\x00-\\x7F]/', $form['base_url'])) {
         if (!function_exists('idn_to_ascii')) {
             message($lang_admin_options['Base URL problem']);
         } else {
             $form['base_url'] = idn_to_ascii($form['base_url']);
         }
     }
     $languages = forum_list_langs();
     if (!in_array($form['default_lang'], $languages)) {
         message($lang_common['Bad request'], '404');
     }
     $styles = forum_list_styles();
     if (!in_array($form['default_style'], $styles)) {
         message($lang_common['Bad request'], '404');
     }
     if ($form['time_format'] == '') {
         $form['time_format'] = 'H:i:s';
     }
     if ($form['date_format'] == '') {
         $form['date_format'] = 'Y-m-d';
     }
     require FEATHER_ROOT . 'include/email.php';
     if (!is_valid_email($form['admin_email'])) {
         message($lang_admin_options['Invalid e-mail message']);
     }
     if (!is_valid_email($form['webmaster_email'])) {
         message($lang_admin_options['Invalid webmaster e-mail message']);
     }
     if ($form['mailing_list'] != '') {
         $form['mailing_list'] = strtolower(preg_replace('%\\s%S', '', $form['mailing_list']));
     }
     // Make sure avatars_dir doesn't end with a slash
     if (substr($form['avatars_dir'], -1) == '/') {
         $form['avatars_dir'] = substr($form['avatars_dir'], 0, -1);
     }
     if ($form['additional_navlinks'] != '') {
         $form['additional_navlinks'] = feather_trim(feather_linebreaks($form['additional_navlinks']));
     }
     // Change or enter a SMTP password
     if ($this->request->post('form_smtp_change_pass')) {
         $smtp_pass1 = $this->request->post('form_smtp_pass1') ? feather_trim($this->request->post('form_smtp_pass1')) : '';
         $smtp_pass2 = $this->request->post('form_smtp_pass2') ? feather_trim($this->request->post('form_smtp_pass2')) : '';
         if ($smtp_pass1 == $smtp_pass2) {
             $form['smtp_pass'] = $smtp_pass1;
         } else {
             message($lang_admin_options['SMTP passwords did not match']);
         }
     }
     if ($form['announcement_message'] != '') {
         $form['announcement_message'] = feather_linebreaks($form['announcement_message']);
     } else {
         $form['announcement_message'] = $lang_admin_options['Enter announcement here'];
         $form['announcement'] = '0';
     }
     if ($form['rules_message'] != '') {
         $form['rules_message'] = feather_linebreaks($form['rules_message']);
     } else {
         $form['rules_message'] = $lang_admin_options['Enter rules here'];
         $form['rules'] = '0';
     }
     if ($form['maintenance_message'] != '') {
         $form['maintenance_message'] = feather_linebreaks($form['maintenance_message']);
     } else {
         $form['maintenance_message'] = $lang_admin_options['Default maintenance message'];
         $form['maintenance'] = '0';
     }
     // Make sure the number of displayed topics and posts is between 3 and 75
     if ($form['disp_topics_default'] < 3) {
         $form['disp_topics_default'] = 3;
     } elseif ($form['disp_topics_default'] > 75) {
         $form['disp_topics_default'] = 75;
     }
     if ($form['disp_posts_default'] < 3) {
         $form['disp_posts_default'] = 3;
     } elseif ($form['disp_posts_default'] > 75) {
         $form['disp_posts_default'] = 75;
     }
     if ($form['feed_type'] < 0 || $form['feed_type'] > 2) {
         message($lang_common['Bad request'], '404');
     }
     if ($form['feed_ttl'] < 0) {
         message($lang_common['Bad request'], '404');
     }
     if ($form['report_method'] < 0 || $form['report_method'] > 2) {
         message($lang_common['Bad request'], '404');
     }
     if ($form['default_email_setting'] < 0 || $form['default_email_setting'] > 2) {
         message($lang_common['Bad request'], '404');
     }
     if ($form['timeout_online'] >= $form['timeout_visit']) {
         message($lang_admin_options['Timeout error message']);
     }
     foreach ($form as $key => $input) {
         // Only update values that have changed
         if (array_key_exists('o_' . $key, $this->config) && $this->config['o_' . $key] != $input) {
             if ($input != '' || is_int($input)) {
                 DB::for_table('config')->where('conf_name', 'o_' . $key)->update_many('conf_value', $input);
             } else {
                 DB::for_table('config')->where('conf_name', 'o_' . $key)->update_many_expr('conf_value', 'NULL');
             }
         }
     }
     // Regenerate the config cache
     if (!defined('FORUM_CACHE_FUNCTIONS_LOADED')) {
         require FEATHER_ROOT . 'include/cache.php';
     }
     generate_config_cache();
     clear_feed_cache();
     redirect(get_link('admin/options/'), $lang_admin_options['Options updated redirect']);
 }
Example #8
0
 /**
  * Regenerate FluxBB cache after conversion
  */
 function generate_cache()
 {
     // Load the cache script
     require_once PUN_ROOT . 'include/cache.php';
     // Generate cache
     generate_config_cache();
     generate_bans_cache();
     generate_quickjump_cache();
     generate_censoring_cache();
     generate_users_info_cache();
     clear_feed_cache();
 }
function bb2_write_settings($settings, $install = false)
{
    global $db;
    while (list($key, $input) = @each($settings)) {
        if ($key == 'log_table') {
            continue;
        }
        $input = intval($input);
        if ($install) {
            $db->query('INSERT INTO ' . $db->prefix . 'config (conf_name, conf_value) VALUES (\'o_badbehavior_' . $db->escape($key) . '\', ' . $input . ')') or error('Unable to update board config', __FILE__, __LINE__, $db->error());
        } else {
            $db->query('UPDATE ' . $db->prefix . 'config SET conf_value=' . $input . ' WHERE conf_name=\'o_badbehavior_' . $db->escape($key) . '\'') or error('Unable to update board config', __FILE__, __LINE__, $db->error());
        }
    }
    // Regenerate the config cache
    require_once PUN_ROOT . 'include/cache.php';
    generate_config_cache();
}
Example #10
0
 public function set_default_group($groups)
 {
     global $lang_admin_groups, $lang_common;
     $group_id = intval($this->request->post('default_group'));
     // Make sure it's not the admin or guest groups
     if ($group_id == FEATHER_ADMIN || $group_id == FEATHER_GUEST) {
         message($lang_common['Bad request'], '404');
     }
     // Make sure it's not a moderator group
     if ($groups[$group_id]['g_moderator'] != 0) {
         message($lang_common['Bad request'], '404');
     }
     DB::for_table('config')->where('conf_name', 'o_default_user_group')->update_many('conf_value', $group_id);
     // Regenerate the config cache
     if (!defined('FORUM_CACHE_FUNCTIONS_LOADED')) {
         require FEATHER_ROOT . 'include/cache.php';
     }
     generate_config_cache();
     redirect(get_link('admin/groups/'), $lang_admin_groups['Default group redirect']);
 }