mirror of
https://github.com/silverstripe/silverstripe-framework
synced 2024-10-22 14:05:37 +02:00
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:
parent
ef33498a97
commit
fedd019322
@ -655,6 +655,8 @@ class PDODatabase extends Database {
|
||||
* A result-set from a database query (array).
|
||||
*/
|
||||
class PDOQuery extends Query {
|
||||
private $database;
|
||||
private $handle;
|
||||
|
||||
/**
|
||||
* The object that holds the result set.
|
||||
|
@ -67,11 +67,12 @@ class Member extends DataObject {
|
||||
if(isset($_COOKIE['alc_enc']) && !Session::get("loggedInAs")) {
|
||||
|
||||
@list($uid, $token) = explode(':', $_COOKIE['alc_enc'], 2);
|
||||
$uid = Convert::raw2sql($uid);
|
||||
$token = Convert::raw2sql($token);
|
||||
$SQL_uid = Convert::raw2sql($uid);
|
||||
|
||||
$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) {
|
||||
session_regenerate_id(true);
|
||||
@ -1071,4 +1072,4 @@ class Member_Validator extends RequiredFields {
|
||||
}
|
||||
|
||||
|
||||
?>
|
||||
?>
|
||||
|
Loading…
Reference in New Issue
Block a user