BUGFIX: remove the possibility that Director::isDev() could be recursively called when putting isDev=1 in $_GET, addressed in ticket #4978 (http://open.silverstripe.org/ticket/4978) (from r97926)

git-svn-id: svn://svn.silverstripe.com/silverstripe/open/modules/sapphire/trunk@102556 467b73ca-7a2a-4603-9d3b-597d59a354a9
This commit is contained in:
Ingo Schommer 2010-04-13 01:45:00 +00:00
parent 7c84bb984e
commit 37e9c9e569

View File

@ -789,8 +789,11 @@ class Director {
// Use ?isDev=1 to get development access on the live server
if(isset($_GET['isDev'])) {
if(Security::database_is_ready()) {
BasicAuth::requireLogin("SilverStripe developer access. Use your CMS login", "ADMIN");
if($firstTimeCheckingGetVar && !Permission::check('ADMIN')){
BasicAuth::requireLogin("SilverStripe developer access. Use your CMS login", "ADMIN");
}
$_SESSION['isDev'] = $_GET['isDev'];
if($firstTimeCheckingGetVar) $firstTimeCheckingGetVar = false;
} else {
if($firstTimeCheckingGetVar && DB::connection_attempted()) {
echo "<p style=\"padding: 3px; margin: 3px; background-color: orange;