mirror of
https://github.com/silverstripe/silverstripe-framework
synced 2024-10-22 14:05:37 +02:00
Merge pull request #2465 from chillu/pulls/remove-pastmember
API Removed "PastMember" cookie and template getter
This commit is contained in:
commit
91fb39f272
@ -75,7 +75,6 @@ class Controller extends RequestHandler implements TemplateGlobalProvider {
|
||||
if(Session::get('loggedInAs') && Security::database_is_ready()) {
|
||||
$member = Member::currentUser();
|
||||
if($member) {
|
||||
if(!headers_sent()) Cookie::set("PastMember", true, 90, null, null, false, true);
|
||||
DB::query("UPDATE \"Member\" SET \"LastVisited\" = " . DB::getConn()->now()
|
||||
. " WHERE \"ID\" = $member->ID", null);
|
||||
}
|
||||
|
@ -628,13 +628,6 @@ class Member extends DataObject implements TemplateGlobalProvider {
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns true if the current member is a repeat visitor who has logged in more than once.
|
||||
*/
|
||||
public static function is_repeat_member() {
|
||||
return Cookie::get("PastMember") ? true : false;
|
||||
}
|
||||
|
||||
/**
|
||||
* Get the ID of the current logged in user
|
||||
*
|
||||
@ -1463,8 +1456,6 @@ class Member extends DataObject implements TemplateGlobalProvider {
|
||||
return array(
|
||||
'CurrentMember' => 'currentUser',
|
||||
'currentUser',
|
||||
'PastMember' => 'is_repeat_member',
|
||||
'IsRepeatMember' => 'is_repeat_member',
|
||||
);
|
||||
}
|
||||
}
|
||||
|
@ -277,7 +277,7 @@ class DirectorTest extends SapphireTest {
|
||||
'HTTP_USER_AGENT' => 'User Agent',
|
||||
'HTTP_ACCEPT' => 'text/html',
|
||||
'HTTP_ACCEPT_LANGUAGE' => 'en-us',
|
||||
'HTTP_COOKIE' => 'PastMember=1',
|
||||
'HTTP_COOKIE' => 'MyCookie=1',
|
||||
'SERVER_PROTOCOL' => 'HTTP/1.1',
|
||||
'REQUEST_METHOD' => 'GET',
|
||||
'REQUEST_URI' => '/',
|
||||
@ -291,7 +291,7 @@ class DirectorTest extends SapphireTest {
|
||||
'User-Agent' => 'User Agent',
|
||||
'Accept' => 'text/html',
|
||||
'Accept-Language' => 'en-us',
|
||||
'Cookie' => 'PastMember=1',
|
||||
'Cookie' => 'MyCookie=1',
|
||||
'Content-Type' => 'text/xml',
|
||||
'Content-Length' => '10'
|
||||
);
|
||||
|
Loading…
Reference in New Issue
Block a user