Merge pull request #2465 from chillu/pulls/remove-pastmember

API Removed "PastMember" cookie and template getter
This commit is contained in:
Andrew Short 2013-09-27 18:18:38 -07:00
commit 91fb39f272
3 changed files with 2 additions and 12 deletions

View File

@ -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);
}

View File

@ -627,13 +627,6 @@ class Member extends DataObject implements TemplateGlobalProvider {
return DataObject::get_one("Member", "\"Member\".\"ID\" = $id", true, 1);
}
}
/**
* 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',
);
}
}

View File

@ -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'
);