vb.org Archive

vb.org Archive (https://vborg.vbsupport.ru/index.php)
-   Modification Requests/Questions (Unpaid) (https://vborg.vbsupport.ru/forumdisplay.php?f=112)
-   -   admincp add-in for proxy redirect (https://vborg.vbsupport.ru/showthread.php?t=76272)

newtsys 02-13-2005 08:37 PM

admincp add-in for proxy redirect
 
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.

Code:

//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.168.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

Marco van Herwaarden 02-14-2005 03:21 AM

You could use a Setting instead.

newtsys 02-14-2005 06:33 PM

ok, I am no coder, and my php skills are limited to basics, any idea how one would make the setting?

Marco van Herwaarden 02-15-2005 09:17 AM

Have a look at the thread about manually install HIS hacks by traffix. The basics you can find in there.

newtsys 02-17-2005 12:33 AM

thank you very much for your help!


All times are GMT. The time now is 07:33 AM.

Powered by vBulletin® Version 3.8.12 by vBS
Copyright ©2000 - 2025, vBulletin Solutions Inc.

X vBulletin 3.8.12 by vBS Debug Information
  • Page Generation 0.01181 seconds
  • Memory Usage 1,716KB
  • Queries Executed 10 (?)
More Information
Template Usage:
  • (1)ad_footer_end
  • (1)ad_footer_start
  • (1)ad_header_end
  • (1)ad_header_logo
  • (1)ad_navbar_below
  • (1)bbcode_code_printable
  • (1)footer
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (6)option
  • (1)post_thanks_navbar_search
  • (1)printthread
  • (5)printthreadbit
  • (1)spacer_close
  • (1)spacer_open 

Phrase Groups Available:
  • global
  • postbit
  • showthread
Included Files:
  • ./printthread.php
  • ./global.php
  • ./includes/init.php
  • ./includes/class_core.php
  • ./includes/config.php
  • ./includes/functions.php
  • ./includes/class_hook.php
  • ./includes/modsystem_functions.php
  • ./includes/class_bbcode_alt.php
  • ./includes/class_bbcode.php
  • ./includes/functions_bigthree.php 

Hooks Called:
  • init_startup
  • init_startup_session_setup_start
  • init_startup_session_setup_complete
  • cache_permissions
  • fetch_threadinfo_query
  • fetch_threadinfo
  • fetch_foruminfo
  • style_fetch
  • cache_templates
  • global_start
  • parse_templates
  • global_setup_complete
  • printthread_start
  • bbcode_fetch_tags
  • bbcode_create
  • bbcode_parse_start
  • bbcode_parse_complete_precache
  • bbcode_parse_complete
  • printthread_post
  • printthread_complete