newtsys
02-13-2005, 08:37 PM
I have a cript I use that goes into global.php that redirects proxy users, with the exception of aol users. However, to add safe proxy ip addresses one has to have access to root ftp to edit the global.php
I was wondering if there is a possibility to create a template mod and phrase add in that would allow this to be performed in the admincp and add the ip's to global.php($safe_proxies = array) so that a forum admin doesnt need root ftp access?
Below is a c-n-p of said code, any insight would be greatly appreciated.
//this is the site they proxies users will be sent to.
$redirect = "http://www.google.com";
//Custom Function to redirect users
Function redirect_js($url_redirect) {
global $PHP_SELF;
echo "<script language=\"JavaScript\">\n";
echo "<!--\n";
echo "parent.location=\"$url_redirect\";\n";
echo "// -->\n";
echo "</script>\n";
}
// Add the safe proxies in this array
$safe_proxies = array('127.0.0.1','127.0.0.2','192.168.0.1','192.1 68.2.1'); // Safe Proxies
if (( isset($_SERVER['HTTP_FORWARDED']) || isset($_SERVER['HTTP_X_FORWARDED_FOR']) || isset($_SERVER['HTTP_VIA'])) && !in_array($_SERVER['REMOTE_ADDR'],$safe_proxies) )
{ die(redirect_js($redirect)); }
// identify where we are
define('VB_AREA', 'Forum');
oh and to vbteam, I goofed this should be a request for vb3 section, I apologize
I was wondering if there is a possibility to create a template mod and phrase add in that would allow this to be performed in the admincp and add the ip's to global.php($safe_proxies = array) so that a forum admin doesnt need root ftp access?
Below is a c-n-p of said code, any insight would be greatly appreciated.
//this is the site they proxies users will be sent to.
$redirect = "http://www.google.com";
//Custom Function to redirect users
Function redirect_js($url_redirect) {
global $PHP_SELF;
echo "<script language=\"JavaScript\">\n";
echo "<!--\n";
echo "parent.location=\"$url_redirect\";\n";
echo "// -->\n";
echo "</script>\n";
}
// Add the safe proxies in this array
$safe_proxies = array('127.0.0.1','127.0.0.2','192.168.0.1','192.1 68.2.1'); // Safe Proxies
if (( isset($_SERVER['HTTP_FORWARDED']) || isset($_SERVER['HTTP_X_FORWARDED_FOR']) || isset($_SERVER['HTTP_VIA'])) && !in_array($_SERVER['REMOTE_ADDR'],$safe_proxies) )
{ die(redirect_js($redirect)); }
// identify where we are
define('VB_AREA', 'Forum');
oh and to vbteam, I goofed this should be a request for vb3 section, I apologize