The MU forums have moved to WordPress.org

Ban Country from singup (12 posts)

  1. MazZziKa
    Member
    Posted 15 years ago #

    most of spam and splog i receive is come from isreal ?!!
    is any way to block registeration and comments from specific country

  2. Ovidiu
    Member
    Posted 15 years ago #

    yes there is a plugin similar to what you like, http://wpmudevorg.wordpress.com/project/Limit-Country-Signups

  3. MazZziKa
    Member
    Posted 15 years ago #

    this will limit only one country to singup i need to prevent only one country .. singup and comment

  4. MrBrian
    Member
    Posted 15 years ago #

    Modify it then.

  5. Ovidiu
    Member
    Posted 15 years ago #

    :-)
    thats why I gave you the link, I mean come on, if the plugin checks if you are coming from a certain country and then if you are coming from the right country, allows you to sign up, you just negate that check and its done :-)
    meaning all countries except the one are allowed to sign up...

    doesn't strike me as too hard to manage...

  6. andrea_r
    Moderator
    Posted 15 years ago #

    or ban them from the server level.

  7. lunabyte
    Member
    Posted 15 years ago #

    apf -d

    Yummy. Love it. :D

  8. MazZziKa
    Member
    Posted 15 years ago #

    i edit it ...
    now i wanna to create option page under wpmu admin menu .. where to begin

  9. andrea_r
    Moderator
    Posted 15 years ago #

  10. MazZziKa
    Member
    Posted 15 years ago #

    <?php
    /*
    Plugin Name: ban Country Signups
    Plugin URI: http://mychatoo.com
    Description: Allows the site admin to ban signups to a specific country.
    Version: 0.1
    Author: Dr.Mazika .. i got code from Stuart Limit-Country-Signups and edit it
    Author URI: http://mychatoo.com
    */

    /* Copyright 2008 Dr.Mazika (email : admin.mazika@hotmail.com)

    This program is free software; you can redistribute it and/or modify
    it under the terms of the GNU General Public License as published by
    the Free Software Foundation; either version 2 of the License, or
    (at your option) any later version.

    This program is distributed in the hope that it will be useful,
    but WITHOUT ANY WARRANTY; without even the implied warranty of
    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
    GNU General Public License for more details.

    You should have received a copy of the GNU General Public License
    along with this program; if not, write to the Free Software
    Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
    */

    /**
    * Country lookup code
    */

    function zika_ban_country_signups() {
    $ip = $_SERVER['REMOTE_ADDR'];
    $url = 'http://api.hostip.info/country.php?ip='.$ip;
    $lines_array = file($url);
    $country = $lines_array[0];
    $err_msg = 'Sorry, your country is banned from register . You appear to be coming from the following country code: ' . $country;
    if($country == 'NZ') {
    wp_die( $err_msg );
    }
    }
    add_filter('signup_header', 'zika_ban_country_signups');

    /*
    ToDo
    1.Option Page
    - Limit/Ban[dropdown] .. Country[dropdown]
    - Registeration / Comment / View

    */

    ?>

  11. azrin
    Member
    Posted 15 years ago #

    I just load up a deny at the htaccess level. simpler.

  12. tdjcbe
    Member
    Posted 15 years ago #

    We do ours at the firewall. The traffic never gets to the webservers. Decreases load on the boxes which is a plus.

    What's with all of the sig links all of the sudden?

    http://wordpress.org/support/topic/39501

About this Topic