mirror of
https://github.com/silverstripe/silverstripe-framework
synced 2024-10-22 14:05:37 +02:00
Added better checking for wonky databases (merged from 2.1.0 branch, r42589)
git-svn-id: svn://svn.silverstripe.com/silverstripe/open/modules/sapphire/trunk@42924 467b73ca-7a2a-4603-9d3b-597d59a354a9
This commit is contained in:
parent
7df57c3040
commit
ba02a631c9
@ -271,15 +271,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);
|
||||
}
|
||||
|
@ -168,6 +168,7 @@ class Folder extends File {
|
||||
}
|
||||
|
||||
if(Member::currentUser()) $ownerID = Member::currentUser()->ID;
|
||||
else $ownerID = 0;
|
||||
|
||||
$filename = addslashes($this->Filename . $name);
|
||||
if($className == 'Folder' ) $filename .= '/';
|
||||
|
Loading…
Reference in New Issue
Block a user