Loading...
 
Skip to main content

InterTiki fails to recognize same-server (127.0.0.1)

Status
Open
Subject
InterTiki fails to recognize same-server (127.0.0.1)
Version
3.x
Category
  • Usability
  • Regression
  • Consistency
Feature
InterTiki
Submitted by
mizraith
Lastmod by
mizraith
Rating
(0)
Description

This may or may not be considered an error, but is not-as-expected behavior.

Problem

When setting up InterTiki, one would assume that 127.0.0.1 would work as an IP filter for localhost. However, it was pretty clear that this was not working in 3.0 (beta 3, beta 4, rc1)

Regression

  • Turned on the XMLRPC debugger in /lib/userlib.php around line 2817 $client->setDebug(1); to look at the response back from the server and do a bunch of printouts.


Traced InterTiki problems to the IP security check to the following (line 55) in /remote.php.

Copy to clipboard
if (!isset($prefs['known_hosts'][$key]) or $prefs['known_hosts'][$key]['ip'] != $tikilib->get_ip_address()) {


By changing the line to the following, the IP check problems went away:

Copy to clipboard
if (!isset($prefs['known_hosts'][$key])) {




Solution

Possible solution

There are a couple of possible ways to address this.

  1. The most user transparent would be to simply check if the user has entered 127.0.0.1 and in such a case check $_SERVERSERVER_ADDR against $tikilib->get_ip_address().
  2. Another option would be to add a feature (with a warning) to simply turn OFF the IP check.


my syntax may not be perfect, but the idea might be

Copy to clipboard
//add this inside the remote.php file prior to the line 55 IP check if ( $prefs['known_hosts'][$key]['ip'] == "127.0.0.1" or $prefs['known_hosts'][$key]['ip']=="localhost") { if ($tikilib->get_ip_address() == $_SERVER[SERVER_ADDR] ) { $intertikilocalreq = TRUE; // then modify the line 55 if statement to read something like: if (!$intertikilocalreq or !isset($prefs['known_hosts'][$key]) or $prefs['known_hosts'][$key]['ip'] != $tikilib->get_ip_address()) { ..... }


Priority
25
Demonstrate Bug on Tiki 19+
Demonstrate Bug (older Tiki versions)
Ticket ID
2500
Created
Tuesday 12 May, 2009 00:59:51 UTC
by Unknown
LastModif
Tuesday 12 May, 2009 01:00:48 UTC


Show PHP error messages