From 807736490f649715a530a2da0f9d10420933961b Mon Sep 17 00:00:00 2001 From: Geoff Munn Date: Wed, 11 Mar 2009 21:50:03 +0000 Subject: [PATCH] API CHANGE: NOW() replaced with DB-specific version git-svn-id: svn://svn.silverstripe.com/silverstripe/open/modules/sapphire/trunk@72922 467b73ca-7a2a-4603-9d3b-597d59a354a9 --- email/QueuedEmailDispatchTask.php | 2 +- filesystem/Folder.php | 2 +- security/Member.php | 3 +-- 3 files changed, 3 insertions(+), 4 deletions(-) diff --git a/email/QueuedEmailDispatchTask.php b/email/QueuedEmailDispatchTask.php index 1e1138f08..8f7f89dcf 100644 --- a/email/QueuedEmailDispatchTask.php +++ b/email/QueuedEmailDispatchTask.php @@ -13,7 +13,7 @@ class QueuedEmailDispatchTask extends DailyTask { echo "SENDING QUEUED EMAILS\n"; - $queued = DataObject::get('QueuedEmail', "\"Send\" < NOW()"); + $queued = DataObject::get('QueuedEmail', "\"Send\" < " . DB::getConn()->now()); if( !$queued ) return; diff --git a/filesystem/Folder.php b/filesystem/Folder.php index d4535c199..ce4c7ed8b 100755 --- a/filesystem/Folder.php +++ b/filesystem/Folder.php @@ -156,7 +156,7 @@ class Folder extends File { DB::query("INSERT INTO \"File\" (\"ClassName\", \"ParentID\", \"OwnerID\", \"Name\", \"Filename\", \"Created\", \"LastEdited\", \"Title\") - VALUES ('$className', $this->ID, $ownerID, '$name', '$filename', NOW(), NOW(), '$name')"); + VALUES ('$className', $this->ID, $ownerID, '$name', '$filename', " . DB::getConn()->now() . ',' . DB::getConn()->now() . ", '$name')"); return DB::getGeneratedID("File"); } diff --git a/security/Member.php b/security/Member.php index 3ef8ea144..eddcb2059 100644 --- a/security/Member.php +++ b/security/Member.php @@ -325,8 +325,7 @@ class Member extends DataObject { static function member_from_autologinhash($RAW_hash, $login = false) { $SQL_hash = Convert::raw2sql($RAW_hash); - $member = DataObject::get_one('Member',"\"AutoLoginHash\"='" . $SQL_hash . - "' AND \"AutoLoginExpired\" > NOW()"); + $member = DataObject::get_one('Member',"\"AutoLoginHash\"='" . $SQL_hash . "' AND \"AutoLoginExpired\" > " . DB::getConn()->now()); if($login && $member) $member->logIn();