vb.org Archive

vb.org Archive (https://vborg.vbsupport.ru/index.php)
-   Modification Graveyard (https://vborg.vbsupport.ru/forumdisplay.php?f=224)
-   -   Administrative and Maintenance Tools - Proxy to Real IP Conversion (https://vborg.vbsupport.ru/showthread.php?t=231873)

hsoen 10-06-2014 08:21 AM

If you are installing 4.2.0.0 version, you need to add below step 1 (from 4.1.0.8) in addition to step 2 (from 4.2.0.0).

-----------------------------------------------------------------------------------------------------------
Step 1 (THIS STEP IS NOT REQUIRED IN vBulletin 4.1.7 - IT *IS* REQUIRED IN ALL OTHER VERSIONS, INCLUDING 4.1.8 ONWARDS).

In class_core.php ;

Find ;

// fetch client IP address
$registry->ipaddress = $this->fetch_ip();
define('IPADDRESS', $registry->ipaddress);

// attempt to fetch IP address from behind proxies - useful, but don't rely on it...
$registry->alt_ip = $this->fetch_alt_ip();
define('ALT_IP', $registry->alt_ip);

Replace with ;

// Paul M - Get ip addresses.
$registry->ipaddress = $this->fetch_ip();
$registry->alt_ip = $this->fetch_alt_ip();

// Check that alt_ip is valid address, reset to original if not.
if (preg_match("#\d{1,3}\.\d{1,3}\.\d{1,3}\.\d{1,3}#" , $registry->alt_ip, $iplist))
{
$registry->alt_ip = $iplist[0];
}
else
{
$registry->alt_ip = $registry->ipaddress;
}

// Set ip constants.
if ($registry->ipaddress == $registry->alt_ip)
{
define('PROXYIP','');
define('ALT_IP',$registry->alt_ip);
define('IPADDRESS',$registry->ipaddress);
}
else
{
define('ALT_IP',$registry->alt_ip);
define('IPADDRESS',$registry->alt_ip);
define('PROXYIP',$registry->ipaddress);
$registry->ipaddress = $registry->alt_ip;
}

-----------------------------------------------------------------------------------------------------------
Step 2.

In class_core.php ;

Find ;

if ($proxy)
{
define('ALT_IP', $this->ipaddress);
define('IPADDRESS', $this->alt_ip);
}

Insert above it ;

// Detect ALL.
if ($registry->ipaddress == $registry->alt_ip)
{
define('PROXYIP','');
}
else
{
$proxy = true;
define('PROXYIP',$registry->ipaddress);
}

-----------------------------------------------------------------------------------------------------------

del Drago 12-30-2014 02:32 PM

This mod does not work. I'm attempting to use it with Cloudflare (at Cloudflare's recommendation), and I'm still only seeing Cloudflare IP addresses within vBulletin.

graphicsarea 12-30-2014 07:16 PM

Quote:

Originally Posted by del Drago (Post 2529567)
This mod does not work. I'm attempting to use it with Cloudflare (at Cloudflare's recommendation), and I'm still only seeing Cloudflare IP addresses within vBulletin.

Like Me :down:

madness85 12-30-2014 10:57 PM

Quote:

Originally Posted by graphicsarea (Post 2529615)
Like Me :down:

Option 2 I used https://support.cloudflare.com/hc/en...ith-vBulletin-

Master Of Unive 12-30-2014 11:32 PM

Quote:

Originally Posted by madness85 (Post 2529646)

I can confirm that only option 2 working.

Paul M 12-31-2014 12:28 AM

Quote:

Originally Posted by del Drago (Post 2529567)
This mod does not work. I'm attempting to use it with Cloudflare (at Cloudflare's recommendation), and I'm still only seeing Cloudflare IP addresses within vBulletin.

The mod works just fine, please do try and get your facts straight before making sweeping statements ;)

It will no longer work with Cloudfare because they changed their system to use a custom http variable called HTTP_CF_CONNECTING_IP, instead of the standard HTTP_X_FORWARDED_FOR.

del Drago 01-02-2015 06:10 PM

Thanks for clarifying the situation, Paul. Cloudflare needs to stop directing people to this mod, because they are causing a lot of unnecessary confusion.

thetechgenius 01-02-2015 06:49 PM

Will this work for vB 4.1.4 ?

ozzy47 01-02-2015 06:54 PM

As stated in the first post.

For vBulletin 4.1.0 Onwards

Paul M 01-02-2015 09:18 PM

Quote:

Originally Posted by del Drago (Post 2530089)
Thanks for clarifying the situation, Paul. Cloudflare needs to stop directing people to this mod, because they are causing a lot of unnecessary confusion.

I wasnt aware they were, but its easy enough to modify it to work with them.

In addition to the install instructions provided, just do this ;

Code:

In class_core.php ;

Find ;

                if (isset($_SERVER['HTTP_X_FORWARDED_FOR']))
                {
                        $altip = $_SERVER['HTTP_X_FORWARDED_FOR'];
                }


Replace with ;

                if (isset($_SERVER['HTTP_CF_CONNECTING_IP']))
                {
                        $altip = $_SERVER['HTTP_CF_CONNECTING_IP'];
                }
                else if (isset($_SERVER['HTTP_X_FORWARDED_FOR']))
                {
                        $altip = $_SERVER['HTTP_X_FORWARDED_FOR'];
                }


No need to perform their option 2 then.

I've included this in the instructions for v4.2.0.1


All times are GMT. The time now is 01:52 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.01563 seconds
  • Memory Usage 1,746KB
  • 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
  • (5)bbcode_quote_printable
  • (1)footer
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (6)option
  • (1)pagenav
  • (1)pagenav_curpage
  • (4)pagenav_pagelink
  • (1)pagenav_pagelinkrel
  • (1)post_thanks_navbar_search
  • (1)printthread
  • (10)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
  • pagenav_page
  • pagenav_complete
  • bbcode_fetch_tags
  • bbcode_create
  • bbcode_parse_start
  • bbcode_parse_complete_precache
  • bbcode_parse_complete
  • printthread_post
  • printthread_complete