Go Back   vb.org Archive > vBulletin Modifications > Archive > vB.org Archives > General > Member Archives
FAQ Community Calendar Today's Posts Search

Reply
 
Thread Tools
Proxy Session (Squid) Hack Details »»
Proxy Session (Squid) Hack
Version: , by stilger stilger is offline
Developer Last Online: Jun 2003 Show Printable Version Email this Page

Version: Unknown Rating:
Released: 10-15-2002 Last Update: Never Installs: 0
 
No support by the author.

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.

Show Your Support

  • This modification may not be copied, reproduced or published elsewhere without author's permission.

Comments
  #2  
Old 10-15-2002, 05:03 PM
Mystikal Mystikal is offline
 
Join Date: Apr 2002
Posts: 46
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Code:
if (getenv(HTTP_X_FORWARDED_FOR)){ 
$ip=getenv(HTTP_X_FORWARDED_FOR); 
} 
else { 
$ip=getenv(REMOTE_ADDR); 
}
Reply With Quote
  #3  
Old 10-15-2002, 06:04 PM
stilger stilger is offline
 
Join Date: Dec 2001
Posts: 10
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

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
Reply With Quote
  #4  
Old 11-21-2002, 01:44 AM
spazeman's Avatar
spazeman spazeman is offline
 
Join Date: Dec 2001
Location: Vancouver Island, Canada
Posts: 17
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

yea I want to know too!! ???
Reply With Quote
  #5  
Old 11-21-2002, 11:52 AM
Scott MacVicar Scott MacVicar is offline
 
Join Date: Oct 2001
Location: Glasgow, Scotland
Posts: 1,199
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

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.
Reply With Quote
  #6  
Old 11-27-2002, 06:38 PM
stilger stilger is offline
 
Join Date: Dec 2001
Posts: 10
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

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.
Reply With Quote
  #7  
Old 11-30-2002, 08:39 AM
stilger stilger is offline
 
Join Date: Dec 2001
Posts: 10
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

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


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT. The time now is 10:41 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.04120 seconds
  • Memory Usage 2,271KB
  • Queries Executed 20 (?)
More Information
Template Usage:
  • (1)SHOWTHREAD
  • (1)ad_footer_end
  • (1)ad_footer_start
  • (1)ad_header_end
  • (1)ad_header_logo
  • (1)ad_navbar_below
  • (1)ad_showthread_beforeqr
  • (1)bbcode_code
  • (4)bbcode_php
  • (1)bbcode_quote
  • (1)footer
  • (1)forumjump
  • (1)forumrules
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (1)modsystem_post
  • (1)navbar
  • (6)navbar_link
  • (120)option
  • (7)post_thanks_box
  • (7)post_thanks_button
  • (1)post_thanks_javascript
  • (1)post_thanks_navbar_search
  • (7)post_thanks_postbit_info
  • (6)postbit
  • (7)postbit_onlinestatus
  • (7)postbit_wrapper
  • (1)spacer_close
  • (1)spacer_open
  • (1)tagbit_wrapper 

Phrase Groups Available:
  • global
  • inlinemod
  • postbit
  • posting
  • reputationlevel
  • showthread
Included Files:
  • ./showthread.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/functions_bigthree.php
  • ./includes/class_postbit.php
  • ./includes/class_bbcode.php
  • ./includes/functions_reputation.php
  • ./includes/functions_post_thanks.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
  • showthread_start
  • showthread_getinfo
  • forumjump
  • showthread_post_start
  • showthread_query_postids
  • showthread_query
  • bbcode_fetch_tags
  • bbcode_create
  • showthread_postbit_create
  • postbit_factory
  • postbit_display_start
  • post_thanks_function_post_thanks_off_start
  • post_thanks_function_post_thanks_off_end
  • post_thanks_function_fetch_thanks_start
  • post_thanks_function_fetch_thanks_end
  • post_thanks_function_thanked_already_start
  • post_thanks_function_thanked_already_end
  • fetch_musername
  • postbit_imicons
  • bbcode_parse_start
  • bbcode_parse_complete_precache
  • bbcode_parse_complete
  • postbit_display_complete
  • post_thanks_function_can_thank_this_post_start
  • tag_fetchbit_complete
  • forumrules
  • navbits
  • navbits_complete
  • showthread_complete