sminnee: Changes to keep db/build working on sites that don't yet have RememberLoginToken?

(merged from branches/gsoc)


git-svn-id: svn://svn.silverstripe.com/silverstripe/open/modules/sapphire/trunk@41839 467b73ca-7a2a-4603-9d3b-597d59a354a9
This commit is contained in:
Ingo Schommer 2007-09-15 00:27:40 +00:00
parent ef33498a97
commit fedd019322
2 changed files with 7 additions and 4 deletions

View File

@ -655,6 +655,8 @@ class PDODatabase extends Database {
* A result-set from a database query (array). * A result-set from a database query (array).
*/ */
class PDOQuery extends Query { class PDOQuery extends Query {
private $database;
private $handle;
/** /**
* The object that holds the result set. * The object that holds the result set.

View File

@ -67,11 +67,12 @@ class Member extends DataObject {
if(isset($_COOKIE['alc_enc']) && !Session::get("loggedInAs")) { if(isset($_COOKIE['alc_enc']) && !Session::get("loggedInAs")) {
@list($uid, $token) = explode(':', $_COOKIE['alc_enc'], 2); @list($uid, $token) = explode(':', $_COOKIE['alc_enc'], 2);
$uid = Convert::raw2sql($uid); $SQL_uid = Convert::raw2sql($uid);
$token = Convert::raw2sql($token);
$member = DataObject::get_one( $member = DataObject::get_one(
"Member", "Member.ID = '$uid' And RememberLoginToken = '$token'"); "Member", "Member.ID = '$SQL_uid'");
if($member && $member->RememberLoginToken != $token) $member = null;
if($member) { if($member) {
session_regenerate_id(true); session_regenerate_id(true);