function bb_check_ajax_referer($action = -1, $query_arg = false, $die = true)
 {
     $requests = array();
     if ($query_arg) {
         $requests[] = $query_arg;
     }
     $requests[] = '_ajax_nonce';
     $requests[] = '_wpnonce';
     $nonce = '';
     foreach ($requests as $request) {
         if (isset($_POST[$request]) && $_POST[$request]) {
             $nonce = $_POST[$request];
             break;
         } elseif (isset($_GET[$request]) && $_GET[$request]) {
             $nonce = $_GET[$request];
             break;
         }
     }
     $result = bb_verify_nonce($nonce, $action);
     if ($die && false == $result) {
         die('-1');
     }
     do_action('bb_check_ajax_referer', $action, $result);
     return $result;
 }
Esempio n. 2
0
$bb_admin_body_class = ' bb-admin-plugins';
bb_get_admin_header();
?>

<div class="wrap">

	<h2><?php 
_e('Manage Plugins');
?>
</h2>
	<?php 
do_action('bb_admin_notices');
?>

<?php 
if (bb_verify_nonce($_GET['_scrape_nonce'], 'scrape-plugin_' . $plugin)) {
    $scrape_src = esc_attr(bb_nonce_url(bb_get_uri('bb-admin/plugins.php', array('action' => 'scrape', 'plugin' => urlencode($plugin)), BB_URI_CONTEXT_IFRAME_SRC + BB_URI_CONTEXT_BB_ADMIN), 'scrape-plugin_' . $plugin));
    ?>

	<div class="plugin-error"><iframe src="<?php 
    echo $scrape_src;
    ?>
"></iframe></div>

<?php 
}
?>

	<div class="table-filter">
		<a<?php 
echo $plugin_nav_class['all'];
Esempio n. 3
0
function socialit_hide_show_do()
{
    if (bb_is_topic() && $_GET['socialit_hide_show'] == "1" && isset($_GET['shs_opt']) && isset($_GET['tid']) && bb_current_user_can('moderate')) {
        $topic = get_topic($_GET['tid']);
        if (bb_verify_nonce($_GET['_wpnonce'], 'socialit_hide_show_' . $topic->topic_id)) {
            if ($_GET['shs_opt'] == "2") {
                bb_update_topicmeta($topic->topic_id, 'hide_socialit', 'true');
            } else {
                bb_delete_topicmeta($topic->topic_id, 'hide_socialit');
            }
        } else {
            _e('Sorry, but that could not be done.', 'socialit');
            exit;
        }
        wp_redirect(get_topic_link($topic->topic_id));
    }
}
Esempio n. 4
0
function nospamuser_block($type, $data, $noway)
{
    $settings = bb_get_option('nospamuser-settings');
    bb_update_option('nospamuser-blocks', bb_get_option('nospamuser-blocks') + 1);
    $types = array('email' => __('email address', 'nospamuser'), 'ip' => __('IP address', 'nospamuser'), 'username' => __('username', 'nospamuser'));
    if ($noway) {
        bb_die(sprintf(__('Your %1$s (%2$s) is listed in <a href="%3$s">Stop Forum Spam</a>\'s database. You have been automatically blocked. If you are not a spammer, you may <a href="http://www.stopforumspam.com/removal">appeal this listing</a>.', 'nospamuser'), $types[$type], $data, 'http://www.stopforumspam.com/' . ($type == 'ip' ? 'ipcheck/' : 'search?q=') . $data), 'Registration forbidden', 403);
    }
    if (!isset($_COOKIE['nospamuser_override']) || !bb_verify_nonce($_COOKIE['nospamuser_override'], 'nospamuser-override-' . $_SERVER['REMOTE_ADDR'])) {
        if (!function_exists('recaptcha_check_answer')) {
            // Compatibility with anything else that uses reCAPTCHA
            require_once dirname(__FILE__) . '/recaptchalib.php';
        }
        bb_die(sprintf(__('Your %1$s (%2$s) is listed in <a href="%3$s">Stop Forum Spam</a>\'s database. You have been automatically blocked. If you are not a spammer, you may <a href="http://www.stopforumspam.com/removal">appeal this listing</a> or solve the CAPTCHA below.', 'nospamuser'), $types[$type], $data, 'http://www.stopforumspam.com/' . ($type == 'ip' ? 'ipcheck/' : 'search?q=') . $data) . '<form method="post" action="' . bb_get_plugin_uri(bb_plugin_basename(__FILE__)) . '/bb-nospamuser.php"><script type="text/javascript">var RecaptchaOptions={theme:\'clean\'}</script>' . recaptcha_get_html($settings['recaptcha_pub']) . '<br/><input type="submit" value="' . esc_attr__('Submit', 'nospamuser') . '"/></form>', 'Registration forbidden', 401);
    }
}