function output_onpost_table_areas() { global $db, $main; $ret = TRUE; foreach ((array) $_POST['id'] as $key => $value) { $ret = $ret && $db->del("areas", "id = '" . $value . "'"); } if ($ret) { log_admin_action(get('area'), "areas#" . get('id'), "delete_success"); #@# $main->message->set_fromlang('info', 'delete_success', makelink("", TRUE)); } else { $main->message->set_fromlang('error', 'generic'); } }
function output_onpost_form_area() { global $construct, $main, $db; $form_area = $this->form_area(); $area = get('area'); $ret = TRUE; $_POST['areas__ip_start'] = ip2long($_POST['areas__ip_start']); $_POST['areas__ip_end'] = ip2long($_POST['areas__ip_end']); $ret = $form_area->db_set(array(), "areas", "id", get('area')); if ($ret) { #$#ip_ranges log_admin_action(get('area'), "areas#" . get('id'), "insert_success"); #$# $main->message->set_fromlang('info', 'insert_success', makelink(array("page" => "admin", "subpage" => "areas"))); } else { $main->message->set_fromlang('error', 'generic'); } }
function output_onpost_form_nodesettingschanges() { global $construct, $main, $db; $form_nodesettingschanges = $this->form_nodesettingschanges(); #$nameserver = get('nameserver'); #if (get('nameserver') == 'add') { # $_POST['dns_nameservers__ip'] = ip2long($_POST['dns_nameservers__ip']); #} $f['node_id'] = intval(get('node')); $ret = TRUE; $ret = $form_nodesettingschanges->db_set(array(), "nodesettingschanges", "entryid", $nodesettingschanges); #$ret = $form_nameserver->db_set($f, # "dns_nameservers", "id", $nameserver); if ($ret) { $main->message->set_fromlang('info', 'insert_success', makelink(array("page" => "mynodes", "node" => get('node')))); log_admin_action($nodes, "#nodesetttingschange#" . get('node'), get('entryid'), "nodesetttingschanges", "insert_success"); #@# } else { $main->message->set_fromlang('error', 'generic'); } }
$new_tool['type'] = 'p'; $new_tool['threadoptions'] = $db->escape_string(serialize($thread_options)); $new_tool['postoptions'] = $db->escape_string(serialize($post_options)); $new_tool['name'] = $db->escape_string($mybb->input['title']); $new_tool['description'] = $db->escape_string($mybb->input['description']); $new_tool['forums'] = ''; if (is_array($mybb->input['forum_1_forums'])) { foreach ($mybb->input['forum_1_forums'] as $fid) { $checked[] = intval($fid); } $new_tool['forums'] = implode(',', $checked); } $tid = $db->insert_query("modtools", $new_tool); $plugins->run_hooks("admin_config_mod_tools_add_post_tool_commit"); // Log admin action log_admin_action($tid, $mybb->input['title']); $cache->update_forumsdisplay(); flash_message($lang->success_mod_tool_created, 'success'); admin_redirect("index.php?module=config-mod_tools&action=post_tools"); } } $page->add_breadcrumb_item($lang->add_new_post_tool); $page->output_header($lang->mod_tools . " - " . $lang->add_new_post_tool); $sub_tabs['thread_tools'] = array('title' => $lang->thread_tools, 'link' => "index.php?module=config-mod_tools"); $sub_tabs['add_thread_tool'] = array('title' => $lang->add_new_thread_tool, 'link' => "index.php?module=config-mod_tools&action=add_thread_tool"); $sub_tabs['post_tools'] = array('title' => $lang->post_tools, 'link' => "index.php?module=config-mod_tools&action=post_tools"); $sub_tabs['add_post_tool'] = array('title' => $lang->add_new_post_tool, 'link' => "index.php?module=config-mod_tools&action=add_post_tool", 'description' => $lang->add_post_tool_desc); $page->output_nav_tabs($sub_tabs, 'add_post_tool'); $form = new Form("index.php?module=config-mod_tools&action=add_post_tool", 'post'); if ($errors) { $page->output_inline_error($errors);
} if ($mybb->request_method == 'post') { $where = 'dateline < ' . (TIME_NOW - intval($mybb->input['older_than']) * 86400); // Searching for entries by a particular user if ($mybb->input['uid']) { $where .= " AND uid='" . intval($mybb->input['uid']) . "'"; } // Searching for entries in a specific module if ($mybb->input['filter_module']) { $where .= " AND module='" . $db->escape_string($mybb->input['filter_module']) . "'"; } $query = $db->delete_query("adminlog", $where); $num_deleted = $db->affected_rows(); $plugins->run_hooks("admin_tools_adminlog_prune_commit"); // Log admin action log_admin_action($mybb->input['older_than'], $mybb->input['uid'], $mybb->input['filter_module'], $num_deleted); flash_message($lang->success_pruned_admin_logs, 'success'); admin_redirect("index.php?module=tools-adminlog"); } $page->add_breadcrumb_item($lang->prune_admin_logs, "index.php?module=tools-adminlog&action=prune"); $page->output_header($lang->prune_admin_logs); $page->output_nav_tabs($sub_tabs, 'prune_admin_logs'); // Fetch filter options $sortbysel[$mybb->input['sortby']] = 'selected="selected"'; $ordersel[$mybb->input['order']] = 'selected="selected"'; $user_options[''] = $lang->all_administrators; $user_options['0'] = '----------'; $query = $db->query("\n\t\tSELECT DISTINCT l.uid, u.username\n\t\tFROM " . TABLE_PREFIX . "adminlog l\n\t\tLEFT JOIN " . TABLE_PREFIX . "users u ON (l.uid=u.uid)\n\t\tORDER BY u.username ASC\n\t"); while ($user = $db->fetch_array($query)) { $user_options[$user['uid']] = $user['username']; }
require_once(DIR . '/includes/functions_misc.php'); // ######################## CHECK ADMIN PERMISSIONS ####################### if (!can_administer('canadminforums')) { print_cp_no_permission(); } $vbulletin->input->clean_array_gpc('r', array( 'userid' => TYPE_INT, 'usergroupid' => TYPE_INT, 'forumid' => TYPE_INT, )); // ############################# LOG ACTION ############################### log_admin_action(iif($vbulletin->GPC['userid'], "user id = " . $vbulletin->GPC['userid'], iif($vbulletin->GPC['usergroupid'], "usergroup id = " . $vbulletin->GPC['usergroupid'], iif($vbulletin->GPC['forumid'], "forum id = " . $vbulletin->GPC['forumid'])))); // ######################################################################## // ######################### START MAIN SCRIPT ############################ // ######################################################################## print_cp_header($vbphrase['view_permissions']); $perm_phrase = array( 'canview' => $vbphrase['can_view_forum'], 'canviewthreads' => $vbphrase['can_view_threads'], 'canviewothers' => $vbphrase['can_view_others_threads'], 'cansearch' => $vbphrase['can_search_forum'], 'canemail' => $vbphrase['can_use_email_to_friend'], 'canpostnew' => $vbphrase['can_post_threads'], 'canreplyown' => $vbphrase['can_reply_to_own_threads'],
$db->delete_query("smilies", "sid = '{$sid}'", 1); } else { $smilie = array("name" => $db->escape_string($mybb->input['name'][$sid]), "find" => $db->escape_string($mybb->input['find'][$sid]), "showclickable" => $db->escape_string($mybb->input['showclickable'][$sid])); // $test contains all disporders except the actual one so we can check whether we have multiple disporders $test = $mybb->input['disporder']; unset($test[$sid]); if (!in_array($disporder, $test)) { $smilie['disporder'] = $disporder; } $db->update_query("smilies", $smilie, "sid = '{$sid}'"); } } $cache->update_smilies(); $plugins->run_hooks("admin_config_smilies_mass_edit_commit"); // Log admin action log_admin_action(); flash_message($lang->success_multiple_smilies_updated, 'success'); admin_redirect("index.php?module=config-smilies"); } $page->add_breadcrumb_item($lang->mass_edit); $page->output_header($lang->smilies . " - " . $lang->mass_edit); $sub_tabs['manage_smilies'] = array('title' => $lang->manage_smilies, 'link' => "index.php?module=config-smilies"); $sub_tabs['add_smilie'] = array('title' => $lang->add_smilie, 'link' => "index.php?module=config-smilies&action=add"); $sub_tabs['add_multiple_smilies'] = array('title' => $lang->add_multiple_smilies, 'link' => "index.php?module=config-smilies&action=add_multiple"); $sub_tabs['mass_edit'] = array('title' => $lang->mass_edit, 'link' => "index.php?module=config-smilies&action=mass_edit", 'description' => $lang->mass_edit_desc); $page->output_nav_tabs($sub_tabs, 'mass_edit'); $form = new Form("index.php?module=config-smilies&action=mass_edit", "post", "mass_edit"); if ($errors) { $page->output_inline_error($errors); } else { $mybb->input['path'] = 'images/smilies/';
|| # ---------------- VBULLETIN IS NOT FREE SOFTWARE ---------------- # || || # http://www.vbulletin.com | http://www.vbulletin.com/license.html # || || #################################################################### || \*======================================================================*/ // ######################## SET PHP ENVIRONMENT ########################### error_reporting(E_ALL & ~E_NOTICE); // ##################### DEFINE IMPORTANT CONSTANTS ####################### define('CVS_REVISION', '$RCSfile$ - $Revision: 37230 $'); // #################### PRE-CACHE TEMPLATES AND DATA ###################### $phrasegroups = array('sql', 'user', 'cpuser'); $specialtemplates = array(); // ########################## REQUIRE BACK-END ############################ require_once './global.php'; $vbulletin->input->clean_array_gpc('r', array('query' => TYPE_STR)); // ############################# LOG ACTION ############################### log_admin_action(!empty($vbulletin->GPC['query']) ? "query = '" . htmlspecialchars_uni($vbulletin->GPC['query']) . "'" : ''); // ######################################################################## // ######################### START MAIN SCRIPT ############################ // ######################################################################## print_cp_header($vbphrase['execute_sql_query']); if (!$vbulletin->debug) { $userids = explode(',', str_replace(' ', '', $vbulletin->config['SpecialUsers']['canrunqueries'])); if (!in_array($vbulletin->userinfo['userid'], $userids)) { print_stop_message('no_permission_queries'); } } if (empty($_REQUEST['do'])) { $_REQUEST['do'] = 'modify'; } // define auto queries $queryoptions = array('-1' => '', $vbphrase['all_users'] => array('10' => $vbphrase['yes'] . ' - ' . $vbphrase['invisible_mode'], '80' => $vbphrase['no'] . ' - ' . $vbphrase['invisible_mode'], '20' => $vbphrase['yes'] . ' - ' . $vbphrase['allow_vcard_download'], '90' => $vbphrase['no'] . ' - ' . $vbphrase['allow_vcard_download'], '30' => $vbphrase['yes'] . ' - ' . $vbphrase['receive_admin_emails'], '100' => $vbphrase['no'] . ' - ' . $vbphrase['receive_admin_emails'], '40' => $vbphrase['yes'] . ' - ' . $vbphrase['display_email'], '110' => $vbphrase['no'] . ' - ' . $vbphrase['display_email'], '50' => $vbphrase['yes'] . ' - ' . $vbphrase['receive_private_messages'], '120' => $vbphrase['no'] . ' - ' . $vbphrase['receive_private_messages'], '60' => $vbphrase['yes'] . ' - ' . $vbphrase['send_notification_email_when_a_private_message_is_received'], '130' => $vbphrase['no'] . ' - ' . $vbphrase['send_notification_email_when_a_private_message_is_received'], '70' => $vbphrase['yes'] . ' - ' . $vbphrase['pop_up_notification_box_when_a_private_message_is_received'], '140' => $vbphrase['no'] . ' - ' . $vbphrase['pop_up_notification_box_when_a_private_message_is_received'], '150' => $vbphrase['on'] . ' - ' . $vbphrase['display_signatures'], '180' => $vbphrase['off'] . ' - ' . $vbphrase['display_signatures'], '160' => $vbphrase['on'] . ' - ' . $vbphrase['display_avatars'], '190' => $vbphrase['off'] . ' - ' . $vbphrase['display_avatars'], '170' => $vbphrase['on'] . ' - ' . $vbphrase['display_images'], '200' => $vbphrase['off'] . ' - ' . $vbphrase['display_images'], '175' => $vbphrase['on'] . ' - ' . $vbphrase['display_reputation'], '205' => $vbphrase['off'] . ' - ' . $vbphrase['display_reputation'], '176' => $vbphrase['on'] . ' - ' . $vbphrase['enahnced_attachment_uploading'], '206' => $vbphrase['off'] . ' - ' . $vbphrase['enahnced_attachment_uploading'], 'blank1' => '', '210' => $vbphrase['subscribe_choice_none'], '220' => $vbphrase['subscribe_choice_0'], '230' => $vbphrase['subscribe_choice_1'], '240' => $vbphrase['subscribe_choice_2'], '250' => $vbphrase['subscribe_choice_3'], 'blank2' => '', '270' => $vbphrase['thread_display_mode'] . ' - ' . $vbphrase['linear'], '280' => $vbphrase['thread_display_mode'] . ' - ' . $vbphrase['threaded'], '290' => $vbphrase['thread_display_mode'] . ' - ' . $vbphrase['hybrid'], 'blank3' => '', '260' => $vbphrase['posts'] . ' - ' . $vbphrase['oldest_first'], '265' => $vbphrase['posts'] . ' - ' . $vbphrase['newest_first'], 'blank4' => '', '300' => $vbphrase['do_not_show_editor_toolbar'], '310' => $vbphrase['show_standard_editor_toolbar'], '320' => $vbphrase['show_enhanced_editor_toolbar']), $vbphrase['all_forums'] => array('400' => $vbphrase['show_threads_from_last_day'], '405' => $vbphrase['show_threads_from_last_week'], '410' => $vbphrase['show_threads_from_last_month'], '415' => $vbphrase['show_threads_from_last_year'], '420' => $vbphrase['show_all_threads']));
DELETE FROM " . TABLE_PREFIX . "userban WHERE userid = $user[userid] "); } else { $userdm->set('usergroupid', 2); $user['usergroupid'] = 2; $userdm->set('displaygroupid', 0); $user['displaygroupid'] = 0; } $userdm->save(); unset($userdm); log_admin_action(!empty($user['username']) ? 'username = '******'username'] : '******' . $vbulletin->GPC['userid']); define('CP_REDIRECT', 'banning.php'); print_stop_message('lifted_ban_on_user_x_successfully', "<b>$user[username]</b>"); } // ############################################################################# // ban a user if ($_POST['do'] == 'dobanuser') { $vbulletin->input->clean_array_gpc('p', array( 'usergroupid' => TYPE_INT, 'period' => TYPE_STR, 'reason' => TYPE_NOHTML ));
} print_stop_message('saved_moderator_x_successfully', implode('; ', $successnames)); } // ###################### Start Remove moderator ####################### if ($_REQUEST['do'] == 'remove') { $vbulletin->input->clean_array_gpc('r', array('redir' => TYPE_STR)); $hidden = array('redir' => $vbulletin->GPC['redir']); print_delete_confirmation('moderator', $vbulletin->GPC['moderatorid'], 'moderator', 'kill', 'moderator', $hidden); } // ###################### Start Kill moderator ####################### if ($_POST['do'] == 'kill') { $mod = $db->query_first("\n\t\tSELECT moderator.*, user.username\n\t\tFROM " . TABLE_PREFIX . "moderator AS moderator\n\t\tLEFT JOIN " . TABLE_PREFIX . "user AS user USING (userid)\n\t\tWHERE moderatorid = " . $vbulletin->GPC['moderatorid']); if (!$mod) { print_stop_message('invalid_moderator_specified'); } log_admin_action('username = '******'username'] . ', userid = ' . $mod['userid']); $moddata =& datamanager_init('Moderator', $vbulletin, ERRTYPE_CP); $moddata->set_existing($mod); $moddata->delete(true); $vbulletin->input->clean_array_gpc('p', array('redir' => TYPE_STR)); if ($vbulletin->GPC['redir'] == 'modlist') { define('CP_REDIRECT', 'moderator.php?do=showlist'); } else { if ($vbulletin->GPC['redir'] == 'showmods') { define('CP_REDIRECT', 'moderator.php?do=showmods&f=' . $mod['forumid']); } else { define('CP_REDIRECT', 'forum.php'); } } print_stop_message('deleted_moderator_successfully'); }
// Searching for entries by a particular user if ($mybb->input['uid']) { $where .= " AND uid='" . intval($mybb->input['uid']) . "'"; } // Searching for entries in a specific module if ($mybb->input['fid'] > 0) { $where .= " AND fid='" . $db->escape_string($mybb->input['fid']) . "'"; } $db->delete_query("moderatorlog", $where); $num_deleted = $db->affected_rows(); $plugins->run_hooks("admin_tools_modlog_prune_commit"); if (!is_array($forum_cache)) { $forum_cache = cache_forums(); } // Log admin action log_admin_action($mybb->input['older_than'], $mybb->input['uid'], $mybb->input['fid'], $num_deleted, $forum_cache[$mybb->input['fid']]['name']); flash_message($lang->success_pruned_mod_logs, 'success'); admin_redirect("index.php?module=tools/modlog"); } $page->add_breadcrumb_item($lang->prune_mod_logs, "index.php?module=tools/modlog&action=prune"); $page->output_header($lang->prune_mod_logs); $page->output_nav_tabs($sub_tabs, 'prune_mod_logs'); // Fetch filter options $sortbysel[$mybb->input['sortby']] = 'selected="selected"'; $ordersel[$mybb->input['order']] = 'selected="selected"'; $user_options[''] = $lang->all_moderators; $user_options['0'] = '----------'; $query = $db->query("\n\t\tSELECT DISTINCT l.uid, u.username\n\t\tFROM " . TABLE_PREFIX . "moderatorlog l\n\t\tLEFT JOIN " . TABLE_PREFIX . "users u ON (l.uid=u.uid)\n\t\tORDER BY u.username ASC\n\t"); while ($user = $db->fetch_array($query)) { $user_options[$user['uid']] = $user['username']; }
if (vB_Bitfield_Builder::build(false) !== false) { $myobj =& vB_Bitfield_Builder::init(); } else { echo "<strong>error</strong>\n"; print_r(vB_Bitfield_Builder::fetch_errors()); } foreach ($myobj->data['ugp']['adminpermissions'] as $title => $values) { // don't show settings that have a group for the usergroup page if (empty($values['group'])) { $ADMINPERMISSIONS["{$title}"] = $values['value']; $permsphrase["{$title}"] = $vbphrase["{$values['phrase']}"]; } } $vbulletin->input->clean_array_gpc('p', array('oldpermissions' => TYPE_INT, 'adminpermissions' => TYPE_ARRAY_INT)); require_once DIR . '/includes/functions_misc.php'; log_admin_action(iif($user, "user id = {$user['userid']} ({$user['username']})" . iif($_POST['do'] == 'update', " (" . $vbulletin->GPC['oldpermissions'] . " » " . convert_array_to_bits($vbulletin->GPC['adminpermissions'], $ADMINPERMISSIONS) . ")"))); // ############################################################################# if (empty($_REQUEST['do'])) { $_REQUEST['do'] = 'modify'; } // ############################################################################# if ($_POST['do'] == 'update') { $vbulletin->input->clean_array_gpc('p', array('cssprefs' => TYPE_STR, 'dismissednews' => TYPE_STR)); foreach ($vbulletin->GPC['adminpermissions'] as $key => $value) { $admindm->set_bitfield('adminpermissions', $key, $value); } ($hook = vBulletinHook::fetch_hook('admin_permissions_process')) ? eval($hook) : false; $admindm->set('cssprefs', $vbulletin->GPC['cssprefs']); $admindm->set('dismissednews', $vbulletin->GPC['dismissednews']); $admindm->save(); define('CP_REDIRECT', "adminpermissions.php?" . $vbulletin->session->vars['sessionurl'] . "#user{$user['userid']}");
// double output buffering does some weird things, so turn it off in these three cases DEFINE('NOZIP', 1); } // #################### PRE-CACHE TEMPLATES AND DATA ###################### $phrasegroups = array('style'); $specialtemplates = array(); // ########################## REQUIRE BACK-END ############################ require_once './global.php'; require_once DIR . '/includes/adminfunctions_template.php'; // ######################## CHECK ADMIN PERMISSIONS ####################### if (!can_administer('canadminstyles')) { print_cp_no_permission(); } $vbulletin->input->clean_array_gpc('r', array('templateid' => TYPE_INT, 'dostyleid' => TYPE_INT)); // ############################# LOG ACTION ############################### log_admin_action(!empty($vbulletin->GPC['templateid']) ? 'template id = ' . $vbulletin->GPC['templateid'] : !empty($vbulletin->GPC['dostyleid']) ? 'style id = ' . $vbulletin->GPC['dostyleid'] : ''); // ######################################################################## // ######################### START MAIN SCRIPT ############################ // ######################################################################## if (empty($_REQUEST['do'])) { $_REQUEST['do'] = 'modify'; } else { $nozipDos = array('inserttemplate', 'rebuild', 'kill', 'insertstyle', 'killstyle', 'updatestyle'); if (in_array($_REQUEST['do'], $nozipDos)) { $vbulletin->nozip = true; } } $full_product_info = fetch_product_list(true); if ($_REQUEST['do'] != 'download') { print_cp_header($vbphrase['style_manager'], iif($_REQUEST['do'] == 'files', 'js_fetch_style_title()')); ?>
\*======================================================================*/ // ######################## SET PHP ENVIRONMENT ########################### error_reporting(E_ALL & ~E_NOTICE); // ##################### DEFINE IMPORTANT CONSTANTS ####################### define('CVS_REVISION', '$RCSfile$ - $Revision: 35402 $'); // #################### PRE-CACHE TEMPLATES AND DATA ###################### $phrasegroups = array('advertising', 'notice'); $specialtemplates = array(); // ########################## REQUIRE BACK-END ############################ require_once './global.php'; // ############################# LOG ACTION ############################### if (!can_administer('canadminads')) { print_cp_no_permission(); } $vbulletin->input->clean_array_gpc('r', array('adid' => TYPE_UINT)); log_admin_action($vbulletin->GPC['adid'] != 0 ? "ad id = " . $vbulletin->GPC['adid'] : ''); // ######################################################################## // ######################### START MAIN SCRIPT ############################ // ######################################################################## print_cp_header($vbphrase['advertising']); if (!in_array($_REQUEST['do'], array('add', 'edit', 'update', 'delete', 'remove', 'locate', 'flipcoin'))) { if (!empty($_REQUEST['adid'])) { $_REQUEST['do'] = 'edit'; } else { $_REQUEST['do'] = 'modify'; } } // initialize some data storage $ad_locations = array(); // $ad_locations[group_displayorder][group_key][location_displayorder][location_key][option(IE: cp_width, cp_height, etc.)] = value; $ad_cache = array();
} $plugins->run_hooks("newpoints_admin_maintenance_reset_start"); } elseif ($mybb->input['action'] == 'reconstruct') { $plugins->run_hooks("newpoints_admin_maintenance_reconstruct_start"); if ($mybb->input['no']) { admin_redirect("index.php?module=newpoints-maintenance"); } if ($mybb->request_method == "post") { if (!isset($mybb->input['my_post_key']) || $mybb->post_code != $mybb->input['my_post_key']) { $mybb->request_method = "get"; flash_message($lang->newpoints_error, 'error'); admin_redirect("index.php?module=newpoints-maintenance"); } newpoints_undo_template_edits(); newpoints_do_template_edits(); log_admin_action($lang->newpoints_reconstruct_done); flash_message($lang->newpoints_reconstructed, 'success'); admin_redirect('index.php?module=newpoints-maintenance'); } else { $mybb->input['per_page'] = intval($mybb->input['per_page']); $form = new Form("index.php?module=newpoints-maintenance&action=reconstruct&my_post_key={$mybb->post_code}", 'post'); echo "<div class=\"confirm_action\">\n"; echo "<p>{$lang->newpoints_reconstructconfirm}</p>\n"; echo "<br />\n"; echo "<p class=\"buttons\">\n"; echo $form->generate_submit_button($lang->yes, array('class' => 'button_yes')); echo $form->generate_submit_button($lang->no, array("name" => "no", 'class' => 'button_no')); echo "</p>\n"; echo "</div>\n"; $form->end(); }
if ($mybb->input['type'] == "Basic") { $type = "basic"; } elseif ($mybb->input['type'] == "Aggressive") { $type = "agg"; } elseif ($mybb->input['type'] == "Simplified") { $type = "iqs"; } else { $type = "basic"; } $request = cloudflare_request("cache_lvl", $mybb->settings['cloudflare_domain'], $mybb->settings['cloudflare_email'], $mybb->settings['cloudflare_api'], $type); if ($request == "success") { $page->output_success("<p><em>CloudFlare cache level has sucessfully been changed to " . $mybb->input['type'] . ".</em></p>"); log_admin_action('Changed the cache level to ' . $mybb->input['type'] . ' on ' . $mybb->settings['cloudflare_domain']); } elseif ($request == "error") { flash_message("CloudFlare cache level could not be changed to " . $mybb->input['type'] . ".", "error"); log_admin_action('Failed to change the cache level to ' . $mybb->input['type'] . ' on ' . $mybb->settings['cloudflare_domain']); } $table = new Table(); if (cloudflare_cache_lvl_setting() == 'basic') { $basic = 'selected=selected'; $simplified = ''; $agg = ''; } elseif (cloudflare_cache_lvl_setting() == 'iqs') { $basic = ''; $simplified = 'selected=selected'; $agg = ''; } elseif (cloudflare_cache_lvl_setting() == 'agg') { $basic = ''; $simplified = ''; $agg = 'selected=selected'; }
error_reporting(E_ALL & ~E_NOTICE); // ##################### DEFINE IMPORTANT CONSTANTS ####################### define('CVS_REVISION', '$RCSfile$ - $Revision: 40911 $'); // #################### PRE-CACHE TEMPLATES AND DATA ###################### $phrasegroups = array('reputation', 'user', 'reputationlevel'); $specialtemplates = array(); // ########################## REQUIRE BACK-END ############################ require_once './global.php'; require_once DIR . '/includes/adminfunctions_reputation.php'; // ######################## CHECK ADMIN PERMISSIONS ####################### if (!can_administer('canadminusers')) { print_cp_no_permission(); } $vbulletin->input->clean_array_gpc('r', array('reputationlevelid' => TYPE_INT, 'minimumreputation' => TYPE_INT)); // ############################# LOG ACTION ############################### log_admin_action(iif($vbulletin->GPC['reputationlevelid'] != 0, " reputationlevel id = " . $vbulletin->GPC['reputationlevelid'], iif($vbulletin->GPC['minimumreputation'] != 0, "minimum reputation = " . $vbulletin->GPC['minimumreputation'], ''))); // ######################################################################## // ######################### START MAIN SCRIPT ############################ // ######################################################################## print_cp_header($vbphrase['user_reputation_manager']); // ************************************************************************************************* if (empty($_REQUEST['do'])) { $_REQUEST['do'] = 'modify'; } // ************************************************************************************************* if ($_REQUEST['do'] == 'add' or $_REQUEST['do'] == 'edit') { $vbulletin->input->clean_array_gpc('r', array('reputationlevelid' => TYPE_INT)); print_form_header('adminreputation', 'update'); if ($vbulletin->GPC['reputationlevelid']) { $reputationlevel = $db->query_first("\n\t\t\t\tSELECT *\n\t\t\t\tFROM " . TABLE_PREFIX . "reputationlevel\n\t\t\t\tWHERE reputationlevelid = " . $vbulletin->GPC['reputationlevelid']); $level = 'reputation' . $reputationlevel['reputationlevelid'];
require_once './global.php'; require_once DIR . '/includes/adminfunctions_prefix.php'; require_once DIR . '/includes/functions_prefix.php'; // ######################## CHECK ADMIN PERMISSIONS ####################### if (!can_administer('canadminforums')) { print_cp_no_permission(); } // ############################# LOG ACTION ############################### $log_vars = array(); if (!empty($_REQUEST['prefixsetid'])) { $log_vars[] = 'prefixsetid = ' . htmlspecialchars_uni($_REQUEST['prefixsetid']); } if (!empty($_REQUEST['prefixid'])) { $log_vars[] = 'prefixid = ' . htmlspecialchars_uni($_REQUEST['prefixid']); } log_admin_action(implode(', ', $log_vars)); // ######################################################################## // ######################### START MAIN SCRIPT ############################ // ######################################################################## print_cp_header($vbphrase['thread_prefix_manager']); if (empty($_REQUEST['do'])) { $_REQUEST['do'] = 'list'; } // notes on phrases: // prefixset_ID_title (prefixes), prefix_ID_title_plain (global), prefix_ID_title_rich (global) // ######################################################################## if ($_REQUEST['do'] == 'duplicate') { $prefixes = array(); $prefixes_result = $vbulletin->db->query_read("\r\n\t\tSELECT prefix.prefixid, prefixset.prefixsetid\r\n\t\tFROM " . TABLE_PREFIX . "prefix AS prefix\r\n\t\tINNER JOIN " . TABLE_PREFIX . "prefixset AS prefixset ON (prefix.prefixsetid = prefixset.prefixsetid)\r\n\t\tORDER BY prefixset.displayorder ASC, prefix.displayorder ASC\r\n\t"); while ($prefix = $vbulletin->db->fetch_array($prefixes_result)) { $prefixsetphrase = htmlspecialchars_uni($vbphrase["prefixset_{$prefix[prefixsetid]}_title"]);
} if (count($banned_groups) == 1) { $group = array_keys($banned_groups); $mybb->input['usergroup'] = $group[0]; } $insert_array = array('uid' => $user['uid'], 'gid' => intval($mybb->input['usergroup']), 'oldgroup' => $user['usergroup'], 'oldadditionalgroups' => $user['additionalgroups'], 'olddisplaygroup' => $user['displaygroup'], 'admin' => intval($mybb->user['uid']), 'dateline' => TIME_NOW, 'bantime' => $db->escape_string($mybb->input['bantime']), 'lifted' => $db->escape_string($lifted), 'reason' => $db->escape_string($mybb->input['reason'])); $db->insert_query('banned', $insert_array); // Move the user to the banned group $update_array = array('usergroup' => intval($mybb->input['usergroup']), 'displaygroup' => 0, 'additionalgroups' => ''); $db->update_query('users', $update_array, "uid = '{$user['uid']}'"); $db->delete_query("forumsubscriptions", "uid = '{$user['uid']}'"); $db->delete_query("threadsubscriptions", "uid = '{$user['uid']}'"); $cache->update_banned(); $plugins->run_hooks("admin_user_banning_start_commit"); // Log admin action log_admin_action($user['uid'], $user['username'], $lifted); flash_message($lang->success_banned, 'success'); admin_redirect("index.php?module=user-banning"); } } $page->output_header($lang->banned_accounts); $page->output_nav_tabs($sub_tabs, "bans"); $query = $db->simple_select("banned", "COUNT(*) AS ban_count"); $ban_count = $db->fetch_field($query, "ban_count"); $per_page = 20; if ($mybb->input['page'] > 0) { $current_page = intval($mybb->input['page']); $start = ($current_page - 1) * $per_page; $pages = $ban_count / $per_page; $pages = ceil($pages); if ($current_page > $pages) {
require_once './global.php'; require_once DIR . '/includes/class_hook.php'; require_once DIR . '/includes/class_block.php'; require_once DIR . '/includes/adminfunctions_plugin.php'; require_once DIR . '/includes/adminfunctions_template.php'; //inits classloader -- required to make vB_Cache work require_once DIR . '/includes/class_bootstrap_framework.php'; vB_Bootstrap_Framework::init(); // ######################## CHECK ADMIN PERMISSIONS ####################### // don't allow demo version or admin with no permission to administer plugins if (is_demo_mode() or !can_administer('canadminplugins')) { print_cp_no_permission(); } $vbulletin->input->clean_array_gpc('r', array('pluginid' => TYPE_UINT)); // ############################# LOG ACTION ############################### log_admin_action(iif($vbulletin->GPC['pluginid'] != 0, 'plugin id = ' . $vbulletin->GPC['pluginid'])); // ############################################################################# // ########################### START MAIN SCRIPT ############################### // ############################################################################# if ($_REQUEST['do'] != 'download' and $_REQUEST['do'] != 'productexport') { print_cp_header($vbphrase['plugin_products_system']); } if (empty($_REQUEST['do'])) { $_REQUEST['do'] = 'modify'; } if (in_array($_REQUEST['do'], array('modify', 'files', 'edit', 'add', 'product', 'productadd', 'productedit'))) { if (!$vbulletin->options['enablehooks'] or defined('DISABLE_HOOKS')) { print_table_start(); if (!$vbulletin->options['enablehooks']) { print_description_row($vbphrase['plugins_disabled_options']); } else {
// Have we attempted too many times? if ($loginattempts['loginattempts'] > 0) { // Have we set an expiry yet? if ($loginattempts['loginlockoutexpiry'] == 0) { $db->update_query("adminoptions", array("loginlockoutexpiry" => TIME_NOW + (int) $mybb->settings['loginattemptstimeout'] * 60), "uid='{$mybb->user['uid']}'"); } // Did we hit lockout for the first time? Send the unlock email to the administrator if ($loginattempts['loginattempts'] == $mybb->settings['maxloginattempts']) { $db->delete_query("awaitingactivation", "uid='{$mybb->user['uid']}' AND type='l'"); $lockout_array = array("uid" => $mybb->user['uid'], "dateline" => TIME_NOW, "code" => random_str(), "type" => "l"); $db->insert_query("awaitingactivation", $lockout_array); $subject = $lang->sprintf($lang->locked_out_subject, $mybb->settings['bbname']); $message = $lang->sprintf($lang->locked_out_message, htmlspecialchars_uni($mybb->user['username']), $mybb->settings['bbname'], $mybb->settings['maxloginattempts'], $mybb->settings['bburl'], $mybb->config['admin_dir'], $lockout_array['code'], $lockout_array['uid']); my_mail($mybb->user['email'], $subject, $message); } log_admin_action(array('type' => 'admin_locked_out', 'uid' => $mybb->user['uid'], 'username' => $mybb->user['username'])); $page->show_lockedout(); } // Still here? Show a custom login page $page->show_login($lang->my2fa_failed, "error"); } } // Show our 2FA page if (!empty($admin_options['authsecret']) && $admin_session['authenticated'] != 1) { $page->show_2fa(); } $page->add_breadcrumb_item($lang->home, "index.php"); // Begin dealing with the modules $modules_dir = MYBB_ADMIN_DIR . "modules"; $dir = opendir($modules_dir); while (($module = readdir($dir)) !== false) {
|| # http://www.vbulletin.com | http://www.vbulletin.com/license.html # || || #################################################################### || \*======================================================================*/ // ######################## SET PHP ENVIRONMENT ########################### error_reporting(E_ALL & ~E_NOTICE); // ##################### DEFINE IMPORTANT CONSTANTS ####################### define('CVS_REVISION', '$RCSfile$ - $Revision: 13945 $'); // #################### PRE-CACHE TEMPLATES AND DATA ###################### $phrasegroups = array('help_faq'); $specialtemplates = array(); // ########################## REQUIRE BACK-END ############################ require_once './global.php'; require_once DIR . '/includes/adminfunctions_help.php'; // ############################# LOG ACTION ############################### $vbulletin->input->clean_array_gpc('r', array('adminhelpid' => TYPE_INT)); log_admin_action(iif($vbulletin->GPC['adminhelpid'] != 0, "help id = " . $vbulletin->GPC['adminhelpid'])); // ######################################################################## // ######################### START MAIN SCRIPT ############################ // ######################################################################## if (empty($_REQUEST['do'])) { $_REQUEST['do'] = 'answer'; } print_cp_header("{$vbphrase['admin_help']}"); // ############################### start listing answers ############## if ($_REQUEST['do'] == 'answer') { $vbulletin->input->clean_array_gpc('r', array('page' => TYPE_STR, 'pageaction' => TYPE_STR, 'option' => TYPE_STR)); if (empty($vbulletin->GPC['page'])) { $fullpage = REFERRER; } else { $fullpage = $vbulletin->GPC['page']; }
$query = $db->simple_select("mycode", "*", "cid='" . intval($mybb->input['cid']) . "'"); $mycode = $db->fetch_array($query); if (!$mycode['cid']) { flash_message($lang->error_invalid_mycode, 'error'); admin_redirect("index.php?module=config/mycode"); } // User clicked no if ($mybb->input['no']) { admin_redirect("index.php?module=config/mycode"); } if ($mybb->request_method == "post") { $db->delete_query("mycode", "cid='{$mycode['cid']}'"); $cache->update_mycode(); $plugins->run_hooks("admin_config_mycode_delete_commit"); // Log admin action log_admin_action($mycode['cid'], $mycode['title']); flash_message($lang->success_deleted_mycode, 'success'); admin_redirect("index.php?module=config/mycode"); } else { $page->output_confirm_action("index.php?module=config/mycode&action=delete&cid={$mycode['cid']}", $lang->confirm_mycode_deletion); } } if (!$mybb->input['action']) { $plugins->run_hooks("admin_config_mycode_start"); $page->output_header($lang->custom_mycode); $sub_tabs['mycode'] = array('title' => $lang->mycode, 'link' => "index.php?module=config/mycode", 'description' => $lang->mycode_desc); $sub_tabs['add_new_mycode'] = array('title' => $lang->add_new_mycode, 'link' => "index.php?module=config/mycode&action=add"); $page->output_nav_tabs($sub_tabs, 'mycode'); $table = new Table(); $table->construct_header($lang->title); $table->construct_header($lang->controls, array('class' => 'align_center', 'width' => 150));
// ######################## SET PHP ENVIRONMENT ########################### error_reporting(E_ALL & ~E_NOTICE & ~8192); // ##################### DEFINE IMPORTANT CONSTANTS ####################### define('CVS_REVISION', '$RCSfile$ - $Revision: 39862 $'); // #################### PRE-CACHE TEMPLATES AND DATA ###################### $phrasegroups = array('user', 'cpuser', 'infraction', 'infractionlevel', 'banning'); $specialtemplates = array(); // ########################## REQUIRE BACK-END ############################ require_once './global.php'; // ######################## CHECK ADMIN PERMISSIONS ####################### if (!can_administer('canadminusers')) { print_cp_no_permission(); } // ############################# LOG ACTION ############################### $vbulletin->input->clean_array_gpc('r', array('infractionlevelid' => TYPE_INT, 'infractiongroupid' => TYPE_UINT, 'infractionbanid' => TYPE_UINT)); log_admin_action(!empty($vbulletin->GPC['infractionlevelid']) ? 'infractionlevel id = ' . $vbulletin->GPC['infractionlevelid'] : ''); // ######################################################################## // ######################### START MAIN SCRIPT ############################ // ######################################################################## print_cp_header($vbphrase['user_infraction_manager']); if (empty($_REQUEST['do'])) { $_REQUEST['do'] = 'modify'; } // ###################### Start add ####################### if ($_REQUEST['do'] == 'editlevel') { print_form_header('admininfraction', 'updatelevel'); if (!empty($vbulletin->GPC['infractionlevelid'])) { $infraction = $db->query_first("SELECT * FROM " . TABLE_PREFIX . "infractionlevel WHERE infractionlevelid = " . $vbulletin->GPC['infractionlevelid']); $title = 'infractionlevel' . $infraction['infractionlevelid'] . '_title'; if ($phrase = $db->query_first("\n\t\t\tSELECT text\n\t\t\tFROM " . TABLE_PREFIX . "phrase\n\t\t\tWHERE languageid = 0 AND\n\t\t\t\tfieldname = 'infractionlevel' AND\n\t\t\t\tvarname = '{$title}'\n\t\t")) { $infraction['title'] = $phrase['text'];
$update_array = array("usergroup" => intval($mybb->input['usergroup']), "additionalgroups" => $additionalgroups, "displaygroup" => intval($mybb->input['displaygroup'])); // Do the usergroup update for all those selected // If the a selected user is a super admin, don't update that user foreach ($selected as $user) { if (!is_super_admin($user)) { $users_to_update[] = $user; } } $to_update_count = count($users_to_update); if ($to_update_count > 0 && is_array($users_to_update)) { // Update the users in the database $sql = implode(",", $users_to_update); $db->update_query("users", $update_array, "uid IN (" . $sql . ")"); // Redirect the admin... $mybb->input['action'] = "inline_usergroup"; log_admin_action($to_update_count); my_unsetcookie("inlinemod_useracp"); flash_message($lang->success_mass_usergroups, 'success'); admin_redirect("index.php?module=user-users" . $vid_url); } else { // They tried to edit super admins! Uh-oh! $errors[] = $lang->no_usergroup_changed; } } $page->output_header($lang->manage_users); $page->output_nav_tabs($sub_tabs, 'manage_users'); // Display a table warning $table = new Table(); $lang->usergroup_info = $lang->sprintf($lang->usergroup_info, count($selected)); $table->construct_cell($lang->usergroup_info); $table->construct_row();
$query = $db->simple_select("icons", "*", "iid='" . intval($mybb->input['iid']) . "'"); $icon = $db->fetch_array($query); if (!$icon['iid']) { flash_message($lang->error_invalid_post_icon, 'error'); admin_redirect("index.php?module=config/post_icons"); } // User clicked no if ($mybb->input['no']) { admin_redirect("index.php?module=config/post_icons"); } if ($mybb->request_method == "post") { $db->delete_query("icons", "iid='{$icon['iid']}'"); $cache->update_posticons(); $plugins->run_hooks("admin_config_post_icons_delete_commit"); // Log admin action log_admin_action($icon['iid'], $icon['name']); flash_message($lang->success_post_icon_deleted, 'success'); admin_redirect("index.php?module=config/post_icons"); } else { $page->output_confirm_action("index.php?module=config/post_icons&action=delete&iid={$icon['iid']}", $lang->confirm_post_icon_deletion); } } if (!$mybb->input['action']) { $plugins->run_hooks("admin_config_post_icons_start"); $page->output_header($lang->post_icons); $sub_tabs['manage_icons'] = array('title' => $lang->manage_post_icons, 'link' => "index.php?module=config/post_icons", 'description' => $lang->manage_post_icons_desc); $sub_tabs['add_icon'] = array('title' => $lang->add_post_icon, 'link' => "index.php?module=config/post_icons&action=add"); $sub_tabs['add_multiple'] = array('title' => $lang->add_multiple_post_icons, 'link' => "index.php?module=config/post_icons&action=add_multiple"); $page->output_nav_tabs($sub_tabs, 'manage_icons'); $pagenum = intval($mybb->input['page']); if ($pagenum) {
function akismet_admin() { global $mybb, $db, $page, $lang; if ($page->active_action != "akismet") { return; } $page->add_breadcrumb_item($lang->akismet); if ($mybb->input['delete_all'] && $mybb->request_method == "post") { // User clicked no if ($mybb->input['no']) { admin_redirect("index.php?module=forum-akismet"); } if ($mybb->request_method == "post") { // Delete the template $db->delete_query("posts", "visible = '-4'"); // Log admin action log_admin_action(); flash_message($lang->success_deleted_spam, 'success'); admin_redirect("index.php?module=forum-akismet"); } else { $page->output_confirm_action("index.php?module=forum-akismet&delete_all=1", $lang->confirm_spam_deletion); } } if ($mybb->input['unmark'] && $mybb->request_method == "post") { $unmark = $mybb->input['akismet']; if (empty($unmark)) { flash_message($lang->error_unmark, 'error'); admin_redirect("index.php?module=forum-akismet"); } $posts_in = ''; $comma = ''; foreach ($unmark as $key => $val) { $posts_in .= $comma . intval($key); $comma = ','; } $query = $db->simple_select("posts", "pid, tid", "pid IN ({$posts_in}) AND replyto = '0'"); while ($post = $db->fetch_array($query)) { $threadp[] = $post['tid']; } if (!is_array($threadp)) { $threadp = array(); } $thread_list = implode(',', $threadp); $query = $db->query("\r\n\t\t\tSELECT p.tid, f.usepostcounts, p.uid, p.fid, p.dateline, p.replyto, t.lastpost, t.lastposter, t.lastposteruid, t.subject\r\n\t\t\tFROM " . TABLE_PREFIX . "posts p\r\n\t\t\tLEFT JOIN " . TABLE_PREFIX . "threads t ON (t.tid=p.tid)\r\n\t\t\tLEFT JOIN " . TABLE_PREFIX . "forums f ON (f.fid=p.fid)\r\n\t\t\tWHERE p.pid IN ({$posts_in}) AND p.visible = '-4'\r\n\t\t"); while ($post = $db->fetch_array($query)) { // Fetch the last post for this forum $query2 = $db->query("\r\n\t\t\t\tSELECT tid, lastpost, lastposter, lastposteruid, subject\r\n\t\t\t\tFROM " . TABLE_PREFIX . "threads\r\n\t\t\t\tWHERE fid='{$post['fid']}' AND visible='1' AND closed NOT LIKE 'moved|%'\r\n\t\t\t\tORDER BY lastpost DESC\r\n\t\t\t\tLIMIT 0, 1\r\n\t\t\t"); $lastpost = $db->fetch_array($query2); if ($post['lastpost'] > $lastpost['lastpost']) { $lastpost['lastpost'] = $post['lastpost']; $lastpost['lastposter'] = $post['lastposter']; $lastpost['lastposteruid'] = $post['lastposteruid']; $lastpost['subject'] = $post['subject']; $lastpost['tid'] = $post['tid']; } $update_count = array("lastpost" => intval($lastpost['lastpost']), "lastposter" => $db->escape_string($lastpost['lastposter']), "lastposteruid" => intval($lastpost['lastposteruid']), "lastposttid" => intval($lastpost['tid']), "lastpostsubject" => $db->escape_string($lastpost['subject'])); $db->update_query("forums", $update_count, "fid='{$post['fid']}'"); $query2 = $db->query("\r\n\t\t\t\tSELECT u.uid, u.username, p.username AS postusername, p.dateline\r\n\t\t\t\tFROM " . TABLE_PREFIX . "posts p\r\n\t\t\t\tLEFT JOIN " . TABLE_PREFIX . "users u ON (u.uid=p.uid)\r\n\t\t\t\tWHERE p.tid='{$post['tid']}' AND p.visible='1' OR p.pid = '{$post['pid']}'\r\n\t\t\t\tORDER BY p.dateline DESC\r\n\t\t\t\tLIMIT 1"); $lastpost = $db->fetch_array($query2); $query2 = $db->query("\r\n\t\t\t\tSELECT u.uid, u.username, p.username AS postusername, p.dateline\r\n\t\t\t\tFROM " . TABLE_PREFIX . "posts p\r\n\t\t\t\tLEFT JOIN " . TABLE_PREFIX . "users u ON (u.uid=p.uid)\r\n\t\t\t\tWHERE p.tid='{$post['tid']}'\r\n\t\t\t\tORDER BY p.dateline ASC\r\n\t\t\t\tLIMIT 0,1\r\n\t\t\t"); $firstpost = $db->fetch_array($query2); if (!$firstpost['username']) { $firstpost['username'] = $firstpost['postusername']; } if (!$lastpost['username']) { $lastpost['username'] = $lastpost['postusername']; } if (!$lastpost['dateline']) { $lastpost['username'] = $firstpost['username']; $lastpost['uid'] = $firstpost['uid']; $lastpost['dateline'] = $firstpost['dateline']; } $lastpost['username'] = $db->escape_string($lastpost['username']); $firstpost['username'] = $db->escape_string($firstpost['username']); $query2 = $db->simple_select("users", "akismetstopped", "uid='{$post['uid']}'"); $akismetstopped = $db->fetch_field($query2, "akismetstopped") - 1; if ($akismetstopped < 0) { $akismetstopped = 0; } $db->update_query("users", array('akismetstopped' => $akismetstopped), "uid='{$post['uid']}'"); $update_array = array('username' => $firstpost['username'], 'uid' => intval($firstpost['uid']), 'lastpost' => intval($lastpost['dateline']), 'lastposter' => $lastpost['username'], 'lastposteruid' => intval($lastpost['uid'])); $db->update_query("threads", $update_array, "tid='{$post['tid']}'"); if ($post['usepostcounts'] != 0) { $db->write_query("UPDATE " . TABLE_PREFIX . "users SET postnum=postnum+1 WHERE uid = '{$post['uid']}'"); } $newthreads = $newreplies = 0; if ($post['replyto'] == 0) { ++$newthreads; } else { ++$newreplies; } update_thread_counters($post['tid'], array('replies' => '+' . $newreplies)); update_forum_counters($post['fid'], array('threads' => '+' . $newthreads, 'posts' => '+1')); } $approve = array("visible" => 1); if ($thread_list) { $db->update_query("threads", $approve, "tid IN ({$thread_list})"); } $db->update_query("posts", $approve, "pid IN ({$posts_in})"); // Log admin action log_admin_action(); flash_message($lang->success_unmarked, 'success'); admin_redirect("index.php?module=forum-akismet"); } if ($mybb->input['delete'] && $mybb->request_method == "post") { $deletepost = $mybb->input['akismet']; if (empty($deletepost)) { flash_message($lang->error_deletepost, 'error'); admin_redirect("index.php?module=forum-akismet"); } $posts_in = ''; $comma = ''; foreach ($deletepost as $key => $val) { $posts_in .= $comma . intval($key); $comma = ','; } $query = $db->simple_select("posts", "pid, tid", "pid IN ({$posts_in}) AND replyto = '0'"); while ($post = $db->fetch_array($query)) { $threadp[$post['pid']] = $post['tid']; } if (!is_array($threadp)) { $threadp = array(); } require_once MYBB_ROOT . "inc/functions_upload.php"; foreach ($deletepost as $pid => $val) { if (array_key_exists($pid, $threadp)) { $db->delete_query("posts", "pid IN ({$posts_in})"); $db->delete_query("attachments", "pid IN ({$posts_in})"); // Get thread info $query = $db->simple_select("threads", "poll", "tid='" . $threadp[$pid] . "'"); $poll = $db->fetch_field($query, 'poll'); // Delete threads, redirects, favorites, polls, and poll votes $db->delete_query("threads", "tid='" . $threadp[$pid] . "'"); $db->delete_query("threads", "closed='moved|" . $threadp[$pid] . "'"); $db->delete_query("threadsubscriptions", "tid='" . $threadp[$pid] . "'"); $db->delete_query("polls", "tid='" . $threadp[$pid] . "'"); $db->delete_query("pollvotes", "pid='{$poll}'"); } // Remove attachments remove_attachments($pid); // Delete the post $db->delete_query("posts", "pid='{$pid}'"); } // Log admin action log_admin_action(); flash_message($lang->success_spam_deleted, 'success'); admin_redirect("index.php?module=forum-akismet"); } if (!$mybb->input['action']) { require MYBB_ROOT . "inc/class_parser.php"; $parser = new postParser(); $page->output_header($lang->akismet); $form = new Form("index.php?module=forum-akismet", "post"); $table = new Table(); $table->construct_header($form->generate_check_box("checkall", 1, '', array('class' => 'checkall')), array('width' => '5%')); $table->construct_header("Title / Username / Post", array('class' => 'align_center')); $mybb->input['page'] = intval($mybb->input['page']); if ($mybb->input['page'] > 0) { $start = $mybb->input['page'] * 20; } else { $start = 0; } $query = $db->simple_select("posts", "COUNT(pid) as spam", "visible = '-4'"); $total_rows = $db->fetch_field($query, 'spam'); if ($start > $total_rows) { $start = $total_rows - 20; } if ($start < 0) { $start = 0; } $query = $db->simple_select("posts", "*", "visible = '-4'", array('limit_start' => $start, 'limit' => '20', 'order_by' => 'dateline', 'order_dir' => 'desc')); while ($post = $db->fetch_array($query)) { if ($post['uid'] != 0) { $username = "******"../" . str_replace("{uid}", $post['uid'], PROFILE_URL) . "\" target=\"_blank\">" . format_name($post['username'], $post['usergroup'], $post['displaygroup']) . "</a>"; } else { $username = $post['username']; } $table->construct_cell($form->generate_check_box("akismet[{$post['pid']}]", 1, '')); $table->construct_cell("<span style=\"float: right;\">{$lang->username} {$username}</span> <span style=\"float: left;\">{$lang->title}: " . htmlspecialchars_uni($post['subject']) . " <strong>(" . my_date($mybb->settings['dateformat'], $post['dateline']) . ", " . my_date($mybb->settings['timeformat'], $post['dateline']) . ")</strong></span>"); $table->construct_row(); $parser_options = array("allow_html" => 0, "allow_mycode" => 0, "allow_smilies" => 0, "allow_imgcode" => 0, "me_username" => $post['username'], "filter_badwords" => 1); $post['message'] = $parser->parse_message($post['message'], $parser_options); $table->construct_cell($post['message'], array("colspan" => 2)); $table->construct_row(); } $num_rows = $table->num_rows(); if ($num_rows == 0) { $table->construct_cell($lang->no_spam_found, array("class" => "align_center", "colspan" => 2)); $table->construct_row(); } $table->output($lang->detected_spam_messages); echo "<br />" . draw_admin_pagination($mybb->input['page'], 20, $total_rows, "index.php?module=forum-akismet&page={page}"); $buttons[] = $form->generate_submit_button($lang->unmark_selected, array('name' => 'unmark')); $buttons[] = $form->generate_submit_button($lang->deleted_selected, array('name' => 'delete')); if ($num_rows > 0) { $buttons[] = $form->generate_submit_button($lang->delete_all, array('name' => 'delete_all', 'onclick' => "return confirm('{$lang->confirm_spam_deletion}');")); } $form->output_submit_wrapper($buttons); $form->end(); $page->output_footer(); } exit; }
$announcement = $db->fetch_array($query); // Does the announcement not exist? if (!$announcement['aid']) { flash_message($lang->error_invalid_announcement, 'error'); admin_redirect("index.php?module=forum-announcements"); } // User clicked no if ($mybb->input['no']) { admin_redirect("index.php?module=forum-announcements"); } $plugins->run_hooks("admin_forum_announcements_delete"); if ($mybb->request_method == "post") { $db->delete_query("announcements", "aid='{$announcement['aid']}'"); $plugins->run_hooks("admin_forum_announcements_delete_commit"); // Log admin action log_admin_action($announcement['aid'], $announcement['subject']); $cache->update_forumsdisplay(); flash_message($lang->success_announcement_deleted, 'success'); admin_redirect("index.php?module=forum-announcements"); } else { $page->output_confirm_action("index.php?module=forum-announcements&action=delete&aid={$announcement['aid']}", $lang->confirm_announcement_deletion); } } if (!$mybb->input['action']) { $plugins->run_hooks("admin_forum_announcements_start"); $page->output_header($lang->forum_announcements); $page->output_nav_tabs($sub_tabs, "forum_announcements"); // Fetch announcements into their proper arrays $global_announcements = $announcements = array(); $query = $db->simple_select("announcements", "aid, fid, subject, enddate"); while ($announcement = $db->fetch_array($query)) {
|| # http://www.vbulletin.com | http://www.vbulletin.com/license.html # || || #################################################################### || \*======================================================================*/ // ######################## SET PHP ENVIRONMENT ########################### error_reporting(E_ALL & ~E_NOTICE & ~8192); // ##################### DEFINE IMPORTANT CONSTANTS ####################### define('CVS_REVISION', '$RCSfile$ - $Revision: 39862 $'); // #################### PRE-CACHE TEMPLATES AND DATA ###################### $phrasegroups = array(); $specialtemplates = array('bookmarksitecache'); // ########################## REQUIRE BACK-END ############################ require_once './global.php'; require_once DIR . '/includes/adminfunctions_bookmarksite.php'; // ############################# LOG ACTION ############################### $vbulletin->input->clean_array_gpc('r', array('bookmarksiteid' => TYPE_INT)); log_admin_action($vbulletin->GPC['bookmarksiteid'] != 0 ? "bookmark site id = " . $vbulletin->GPC['bookmarksiteid'] : ''); // ######################## CHECK ADMIN PERMISSIONS ####################### if (!can_administer('canadminsettings')) { print_cp_no_permission(); } // ######################################################################## // ######################### START MAIN SCRIPT ############################ // ######################################################################## print_cp_header($vbphrase['social_bookmarking_manager']); // default action if (empty($_REQUEST['do'])) { $_REQUEST['do'] = 'modify'; } // ######################################################################## // when we want to add a new site from the site list page we need change the action before the main 'socialbookmarks_setpost' handler // we came here if somebody press the add button in the sitelist edit/save form
// ##################### DEFINE IMPORTANT CONSTANTS ####################### define('CVS_REVISION', '$RCSfile$ - $Revision: 83432 $'); // #################### PRE-CACHE TEMPLATES AND DATA ###################### global $phrasegroups, $specialtemplates, $vbphrase; $phrasegroups = array('user', 'cpuser'); $specialtemplates = array(); // ########################## REQUIRE BACK-END ############################ require_once dirname(__FILE__) . '/global.php'; $assertor = vB::getDbAssertor(); // ######################## CHECK ADMIN PERMISSIONS ####################### if (!can_administer('canadminusers')) { print_cp_no_permission(); } // ############################# LOG ACTION ############################### $vbulletin->input->clean_array_gpc('r', array('usertitleid' => vB_Cleaner::TYPE_INT)); log_admin_action(!empty($vbulletin->GPC['usertitleid']) ? 'usertitle id = ' . $vbulletin->GPC['usertitleid'] : ''); // ######################################################################## // ######################### START MAIN SCRIPT ############################ // ######################################################################## print_cp_header($vbphrase['user_title_manager_gcpuser']); if (empty($_REQUEST['do'])) { $_REQUEST['do'] = 'modify'; } // ###################### Start add ####################### if ($_REQUEST['do'] == 'add') { print_form_header('usertitle', 'insert'); print_table_header($vbphrase['add_new_user_title_gcpuser']); print_input_row($vbphrase['title'], 'title'); print_input_row($vbphrase['minimum_posts'], 'minposts'); print_submit_row($vbphrase['save']); }