Recent Topics

1 Jan 20, 2009 20:58    

My b2evolution Version: 2.x

Hi there,

I like the fact that the trackback function now works :D I have a problem though, I'm using apache but not using a standard port 80 build (intranet with application on seperate apache servers instead of using virtual servers to limit the number of applications effected if problems/upgrades occur)

I should also say we are using this with https and http aswell. Using apache authentication to log us in.

The trackback function works fine when running on port 80 but on anything else it doesnt recognise the url as a trackback url(tries connecting to port 80 on the same server)! any idea how I could change this?!

2 Jan 23, 2009 22:29

Ok I found an answer to the problem by editing the file in inc/comments/trackback.funcs.php and editing line 91 to show as follows as the port number in the original version is hardcoded to 80

&& ($fp = @fsockopen($trackback_url['host'], $_SERVER['SERVER_PORT'], $foo, $foo, 20)) !== false)

Also if like us you are using http basic authentication with ldap to authenticate create accounts automatically and create a blog for each user then the below will work for protected websites.

You will need to edit lines 92 to 95 to look like this

			
$user=$_SERVER['PHP_AUTH_USER'];
$pw=$_SERVER['PHP_AUTH_PW'];
$authinfo="$user:$pw";
$auth=base64encode($authinfo);
$header  = 'GET '.$trackback_url['path'].'?'.$trackback_url['query']." HTTP/1.0\r\n";
$header .= 'Host: '.$trackback_url['host']."\r\n";
$header .= 'User-Agent: '.$app_name.'/'.$app_version."\r\n";
$header .= "Authorization: Basic $auth /r/n/r/n";

That will now inject your authentication into the header that the server (which so far hasnt authenticated which will give you a 401 error and the trackback will not work)

Hope that helps some people that may have been trying to find the solution to either of those problems. :)

3 Jan 23, 2009 23:21

Thanks for sharing the solution!


Form is loading...