Visiting all of the following sends you to the login screen:
http://mysite.com/admin/configuration.php
http://mysite.com/admin/login.php
However if you visit (note the last two portions of the url string are both .php):
http://mysite.com/admin/configuration.php/login.php
You can see the configuration screen and all of its data!
Further, if you append some GET variables you can even get editable fields:
http://mysite.com/admin/configuration.php/login.php?cID=1&action=edit
What is going on here?
I should note that this is on site using an absolutely horrible shopping cart called oscommerce. The code is a nightmare to deal with but I am stuck with it for now.
EDIT
A fix based on vstm's excellent and accurate comment below:
This would go just before the check to see if $current_page != FILENAME_LOGIN
(around lines 141-143 in /admin/includes/application_top.php). Mind you this is just an emergency patch as the real solution is to never use oscommerce as it is about as secure as a hooker's belt.
//$current_page = basename($PHP_SELF); //this is the default
$current_page = basename($_SERVER['SCRIPT_NAME']); //change that default to this
if ( ($current_page == FILENAME_LOGIN) && !tep_session_is_registered('redirect_origin') ) {
$current_page = FILENAME_DEFAULT;
$HTTP_GET_VARS = array();
}
If anyone tries this don't forget that the redirect_origin
session var might already be set so this will appear to not work. Just unset it and try again.