Advertisement:

Author Topic: [New Plugin] IP Blocker  (Read 12119 times)

Jesse

  • Hero Member
  • *****
  • Posts: 631
  • Out of my mind, back in 5 minutes
[New Plugin] IP Blocker
« on: February 17, 2012, 01:48:58 pm »
Hi all,

Here is yet another new plugin (my 5th on in a week! ok, yes, I'm an overachiever  ;D)... called IP Blocker. This one will allow the admin to block specific IP addresses from the site. If a blocked user visits the site, they will be redirected to a page, blocked.php, which is a file located within this plugin folder. Feel free to customize this page all you want. Right now it simply displays the text, "Your IP has been blocked".

To test this plugin, enter in your own IP. This plugin will only block you from the front-end, NOT from oc-admin, so you can feel safe that you wont be blocked from your own site.  ;)
« Last Edit: February 17, 2012, 03:30:24 pm by Jesse »

ingo

  • Full Member
  • ***
  • Posts: 216
Re: [New Plugin] IP Blocker
« Reply #1 on: February 17, 2012, 03:30:06 pm »
I said a hip hop, ...Hippie to the hippie, ...The hip, hip a hop, and you don't stop, a rock it..
PERFECT - THX ;D 

Jesse

  • Hero Member
  • *****
  • Posts: 631
  • Out of my mind, back in 5 minutes
Re: [New Plugin] IP Blocker
« Reply #2 on: February 17, 2012, 03:31:03 pm »
Glad you liked it! I figured you'd be the first to test this bad boy!  ;)

romantica

  • Premium
  • Hero Member
  • *****
  • Posts: 1092
  • salut tout le monde
Re: [New Plugin] IP Blocker
« Reply #3 on: February 17, 2012, 05:57:34 pm »
Hi jesse thank  perfect ;D

freeeadz

  • Newbie
  • *
  • Posts: 42
  • E-Adz
Re: [New Plugin] IP Blocker
« Reply #4 on: February 17, 2012, 07:40:15 pm »
Jesse ,

Again I am having problem for this plugin too.

It is blocking the IP but when it is going to show the page blocked.php following error occured.

Error 310 (net::ERR_TOO_MANY_REDIRECTS): There were too many redirects.

trains58554

  • Osclass contributor
  • Hero Member
  • *****
  • Posts: 3642
  • osCanyon, the class of Osclass
Re: [New Plugin] IP Blocker
« Reply #5 on: February 17, 2012, 09:03:00 pm »
Hi Jesse,

You produced another great plugin. Good job!! :)

I have one small feature request could you add the option where we could block a range of IPs?

Thanks

Jay

ingo

  • Full Member
  • ***
  • Posts: 216
Re: [New Plugin] IP Blocker
« Reply #6 on: February 17, 2012, 10:14:50 pm »
Hi,


my contribution to jesse's plugin,
members, feel free to use it


regards
« Last Edit: February 17, 2012, 10:52:41 pm by ingo »

adurls

  • Newbie
  • *
  • Posts: 18
Re: [New Plugin] IP Blocker
« Reply #7 on: February 17, 2012, 10:58:01 pm »
You are the man great job.

Jesse

  • Hero Member
  • *****
  • Posts: 631
  • Out of my mind, back in 5 minutes
Re: [New Plugin] IP Blocker
« Reply #8 on: February 18, 2012, 05:26:56 am »
Thanks guys!

Jay: I figured someone would ask about IP range blocks! Haha... I guess now I actually have to figure out how to do it.  ;)


Freeadz: I did a bit of searching regarding the redirect error you're receiving. It's very odd. I don't get it myself, but obviously some people are. That error tends to happen when an "infinite" loop is initiated. However, I don't understand why that would be the case here. The redirect code is only run once. Once you're on the page blocked.php, no code is run. Did you try with a different browser to see if you still get the same error? I'd be curious to find out.

freeeadz

  • Newbie
  • *
  • Posts: 42
  • E-Adz
Re: [New Plugin] IP Blocker
« Reply #9 on: February 20, 2012, 08:15:28 am »
Jesse,

I tried it now in Mozila but the problem is still there. Following error is shown in the browser:


"The page isn't redirecting properly
Firefox has detected that the server is redirecting the request for this address in a way that will never complete."

Jesse

  • Hero Member
  • *****
  • Posts: 631
  • Out of my mind, back in 5 minutes
Re: [New Plugin] IP Blocker
« Reply #10 on: February 20, 2012, 10:33:58 am »
Hi Freeadz,

Thanks for testing it. Firefox is what I use myself, so I know it isn't the browser itself as I don't get errors like that myself. The redirect itself is formatted exactly the same as every other one in OSClass. But for some reason, it may be getting called more than once, which could possibly trigger the errors you're getting. I've been on a few day hiatus from doing any development with OSClass, so I can't work on that right now. I've got some work to do on this plugin and also my "Print Ad" plugin, both of which I'll get to in the coming days hopefully.

zombie

  • Sr. Member
  • ****
  • Posts: 375
Re: [New Plugin] IP Blocker
« Reply #11 on: August 05, 2012, 04:12:29 pm »
OK. But how to find what ip was used to post an ad?!

Emmanuel

  • Hero Member
  • *****
  • Posts: 645
  • .: ♥ Quality Swiss Details ♥ :. .: Swiss Made :.
Re: [New Plugin] IP Blocker
« Reply #12 on: August 05, 2012, 05:18:55 pm »
"The page isn't redirecting properly
Firefox has detected that the server is redirecting the request for this address in a way that will never complete."

the server don't find a page
hence
redirect to 404

the server don't find the 404 page
hence.....
redirecting to 404

infinite loop

check your .htaccess
add the following line:
Code: [Select]
ErrorDocument 404 /a_landing_page_for_404.html
and not 
ErrorDocument 404 http://www.your_domain.tld/bad_example404.html 

williecity

  • Newbie
  • *
  • Posts: 4
Re: [New Plugin] IP Blocker
« Reply #13 on: October 13, 2012, 01:38:32 am »
Jesse ,

Again I am having problem for this plugin too.

It is blocking the IP but when it is going to show the page blocked.php following error occured.

Error 310 (net::ERR_TOO_MANY_REDIRECTS): There were too many redirects.

I came here with the same problem but i found the solution after translating this page to English
http://forums.osclass.org/ayuda/error-310-demasiados-redireccionamientos-bucle-redireccion/


the solution: the error is in the config.php file line 20: / ** Database Table prefix * / define ('DB_TABLE_PREFIX', 'os_') ; define ('REL_WEB_URL', '/'); here gets the directory where the site is hosted ... if only you put the root '/' define ('WEB_PATH', ' http://tusitio.com/ ') I am trying and working.

shree

  • Full Member
  • ***
  • Posts: 209
Re: [New Plugin] IP Blocker
« Reply #14 on: October 13, 2012, 07:27:30 am »
Useful plugin, thanks!