From: <ep...@us...> - 2008-05-21 16:44:38
|
Revision: 8470 http://armagetronad.svn.sourceforge.net/armagetronad/?rev=8470&view=rev Author: epsy Date: 2008-05-21 09:44:24 -0700 (Wed, 21 May 2008) Log Message: ----------- works on non-short authorities(unlike forums) Modified Paths: -------------- tools/http-auth-server/trunk/armaauth.php Modified: tools/http-auth-server/trunk/armaauth.php =================================================================== --- tools/http-auth-server/trunk/armaauth.php 2008-05-19 14:37:09 UTC (rev 8469) +++ tools/http-auth-server/trunk/armaauth.php 2008-05-21 16:44:24 UTC (rev 8470) @@ -5,9 +5,20 @@ include('functions.php'); //select database from what server we're on -//if we're on the root domain, that's bad. won't know what db to use -if ($_SERVER['HTTP_HOST'] == $rootDomain) -{ //so die! +if (strpos($_SERVER['HTTP_HOST'], $rootDomain)) +{ + //this happens when we're a short-named authority (like forums) + $host = substr($_SERVER['HTTP_HOST'], 0, strpos($_SERVER['HTTP_HOST'], $rootDomain) - 1); +} +else if ($_SERVER['HTTP_HOST'] != $rootDomain) +{ + //otherwise, + $host = $_SERVER['HTTP_HOST'] . substr($_SERVER['HTTP_HOST'], 0, strrpos($_SERVER['REQUEST_URI'], '/armaauth/')); +} +else +{ + //if we're on the root domain, that's bad. won't know what db to use + //so die! conclude('INVALID_DOMAIN', 409); } //we're not, it's cool This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |