Skip to content

Instantly share code, notes, and snippets.

@wilr
Created September 7, 2014 11:07
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save wilr/d33bbdcbba980fb5e706 to your computer and use it in GitHub Desktop.
Save wilr/d33bbdcbba980fb5e706 to your computer and use it in GitHub Desktop.
if($this->request->getVar('key') && $this->request->getVar('token')) {
$key = $this->request->getVar('key');
$token = $this->request->getVar('token');
} else if($this->request->isPOST()) {
$key = $this->request->requestVar('Key');
$token = $this->request->requestVar('Token');
}
if(!$key || !$token) {
// do something?
}
$memory = ContributorMaps_Data::get()->filter(array(
'Unique_Key' => $key,
'EditToken' => $token,
'EditTokenExpires:GreaterThan' => date('Y-m-d')
))->First();
if(!$memory) {
return $this->redirect($this->Link("?action=edit&status=2"));
}
$fields = new FieldList(
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment