Experimental way to get the server name from wwwroot instead of using such SERVER_NAME and HTTP_HOST variables.
Experimental way to get the server name from wwwroot instead of
using such SERVER_NAME and HTTP_HOST variables.

It should help in servers having wrong Apache configurations, being
the cause of bad logins, referer problems....

Seems to work both under PHP 4.3 (linux) and PHP 5 (MacOS X).

Please, TEST it, specially in installation, upgrade and cron!

dilawar/moodle