vb.org Archive

vb.org Archive (https://vborg.vbsupport.ru/index.php)
-   Member Archives (https://vborg.vbsupport.ru/forumdisplay.php?f=202)
-   -   Proxy Session (Squid) Hack (https://vborg.vbsupport.ru/showthread.php?t=44645)

stilger 10-15-2002 02:33 PM

Proxy Session (Squid) Hack
 
Has anyone come up with a hack to make Vbull work properly when you are using squid for cacheing? I was thinking of trying to do something like this:

From original admin/session.php
PHP Code:

// ###################### Start sessions #######################
// get session info
unset($bbuserinfo);
unset(
$session);

// get first 50 chars
$HTTP_USER_AGENT=substr($HTTP_USER_AGENT,0,50);
$REMOTE_ADDR=substr($REMOTE_ADDR,0,50); 

I was thinking of changing to something like this:
PHP Code:

// ###################### Start sessions #######################
// get session info
unset($bbuserinfo);
unset(
$session);

// get first 50 chars
$HTTP_USER_AGENT=substr($HTTP_USER_AGENT,0,50);
if 
$REMOTE_ADDR='127.0.0.1' {
     
$REMOTE_ADDR=substr($HTTP_SERVER_VARS['HTTP_X_FORWARDED_FOR'],0,50);
} else {
     
$REMOTE_ADDR=substr($REMOTE_ADDR,0,50); 

Any help with my syntax and idea would be great.
Squid always reports 127.0.0.1 for the REMOTE_ADDR. There are times when we bypass squid so that I would not want to change it to a permanent setting. Making these changes in the functions.php or global.php would be ok by me also but I could not find what I thought was the correct spot..

Thanks for any help.

Mystikal 10-15-2002 05:03 PM

Code:

if (getenv(HTTP_X_FORWARDED_FOR)){
$ip=getenv(HTTP_X_FORWARDED_FOR);
}
else {
$ip=getenv(REMOTE_ADDR);
}


stilger 10-15-2002 06:04 PM

Thats the code you would use to verify if the HTTP_X_FORWARD_FOR is there and useable? Could I just suplement that code into the session code and then use $IP or whatever i call it when i do the $REMOTE_ADDR=substr($REMOTE_ADDR,0,50); part of the code or are you recommending this be put in the global or functions php files?

Thanks

spazeman 11-21-2002 01:44 AM

yea I want to know too!! ???

Scott MacVicar 11-21-2002 11:52 AM

PHP Code:

if (isset($HTTP_X_FORWARDED_FOR))
{
    
$REMOTE_ADDR $HTTP_X_FORWARDED_FOR;
} elseif (isset(
$HTTP_PROXY_USER))
{
    
$REMOTE_ADDR $HTTP_PROXY_USER;
}
$REMOTE_ADDR preg_replace('#^(\d{1,3})\.(\d{1,3})\.(\d{1,3})\.(\d{1,3})#s''\\1.\\2.\\3.\\4'$REMOTE_ADDR); 

this may be appearing in the 2.2.9 final depending what testing returns for the AOL issues that have been appearing.

stilger 11-27-2002 06:38 PM

Vbulletin 2.2.9 is released and I do not see any mention of this in the changed files. Has this been included and if it has not what files do I need to make this change in to make this work? We are getting killed with users login in as some one else because of our forced use of squid to help with the load.

Thanks..

Quote:

Originally posted by PPN
PHP Code:

if (isset($HTTP_X_FORWARDED_FOR))
{
    
$REMOTE_ADDR $HTTP_X_FORWARDED_FOR;
} elseif (isset(
$HTTP_PROXY_USER))
{
    
$REMOTE_ADDR $HTTP_PROXY_USER;
}
$REMOTE_ADDR preg_replace('#^(\d{1,3})\.(\d{1,3})\.(\d{1,3})\.(\d{1,3})#s''\\1.\\2.\\3.\\4'$REMOTE_ADDR); 

this may be appearing in the 2.2.9 final depending what testing returns for the AOL issues that have been appearing.


stilger 11-30-2002 08:39 AM

Anyone have any ideas regarding my question on where exactly to add this?


All times are GMT. The time now is 03:07 PM.

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.01000 seconds
  • Memory Usage 1,740KB
  • 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
  • (4)bbcode_php_printable
  • (1)bbcode_quote_printable
  • (1)footer
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (6)option
  • (1)post_thanks_navbar_search
  • (1)printthread
  • (7)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