diff --git a/core/control/Controller.php b/core/control/Controller.php index e17742a37..86d56a3b5 100644 --- a/core/control/Controller.php +++ b/core/control/Controller.php @@ -269,15 +269,15 @@ class Controller extends ViewableData { */ function init() { // Test and development sites should be secured, via basic-auth - if(ClassInfo::ready() && ClassInfo::hasTable("Member") && Director::isTest() && $this->basicAuthEnabled) { + if(ClassInfo::hasTable("Group") && ClassInfo::hasTable("Member") && Director::isTest() && $this->basicAuthEnabled) { BasicAuth::requireLogin("SilverStripe test website. Use your CMS login", "ADMIN"); } // Cookie::set("PastVisitor", true); - // ClassInfo::ready() called to ensure that we're not in a very-first-setup stage - if(ClassInfo::ready() && ClassInfo::hasTable("Member") && ($member = Member::currentUser())) { + // ClassInfo::hasTable() called to ensure that we're not in a very-first-setup stage + if(ClassInfo::hasTable("Group") && ClassInfo::hasTable("Member") && ($member = Member::currentUser())) { Cookie::set("PastMember", true); DB::query("UPDATE Member SET LastVisited = NOW() WHERE ID = $member->ID", null); } diff --git a/filesystem/Folder.php b/filesystem/Folder.php index bd4a068b2..7134590b1 100755 --- a/filesystem/Folder.php +++ b/filesystem/Folder.php @@ -167,6 +167,7 @@ class Folder extends File { } if(Member::currentUser()) $ownerID = Member::currentUser()->ID; + else $ownerID = 0; $filename = addslashes($this->Filename . $name); if($className == 'Folder' ) $filename .= '/';