Zubrag.com
December 10, 2018, 05:53:32 AM *
Welcome, Guest. Please login or register.
Did you miss your activation email?

Login with username, password and session length
 
   Home   Help Search Login Register  
Pages: [1]
  Print  
Author Topic: Able to add a filter based on IP to the password protect script?  (Read 7738 times)
philwojo
Newbie
*
Posts: 5


« on: June 04, 2007, 06:26:22 AM »

I am trying to run a java basked auto backup program for my SMF forum, but it needs to login to my page.  But it can't handle the password script that I have on there, it doesn't use cookies.

Is there any way to add to your script that if a certain IP address is seen it bypasses the login page and goes directly to the main page?

thanks,
Phil

Logged
zubrag
Administrator
Hero Member
*****
Posts: 788


WWW
« Reply #1 on: June 04, 2007, 07:48:54 AM »

In order to check IP first, find this code

// user provided password
if (isset($_POST['access_password'])) {

and insert following code before it

if ($_SERVER['REMOTE_ADDR'] == '123.123.123.123') {
} else


Alternatively you could pass login/password as post/get parameters from the backup script (if your auto backup program can handle this):
How to access protected page without login form
Logged
philwojo
Newbie
*
Posts: 5


« Reply #2 on: June 04, 2007, 08:22:39 AM »

Thanks for the quick reply.  I added in the code you posted and that did the trick.

thanks again,
Phil
Logged
Pages: [1]
  Print  
 
Jump to:  

Powered by SMF 1.1.11 | SMF © 2006-2009, Simple Machines LLC