Skip to content
This repository has been archived by the owner on Jun 4, 2018. It is now read-only.

Commit

Permalink
v.0.0.5
Browse files Browse the repository at this point in the history
- Added housekeeping script to delete all expired keys
  • Loading branch information
Pierre-Luc Auclair committed Jul 29, 2015
1 parent c8efc7f commit cd1b804
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 3 deletions.
14 changes: 13 additions & 1 deletion PasswordReset.module
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ class PasswordReset extends WireData implements Module
return array(
'title' => 'Password Reset',
'summary' => 'Customizable frontend password reset',
'version' => 4,
'version' => 5,
'autoload' => false,
'singular' => true
);
Expand Down Expand Up @@ -197,11 +197,23 @@ class PasswordReset extends WireData implements Module
}


private function deleteAllExpiredKeys() {
$time = new DateTime('now');
$time = $time->getTimestamp();
$expiredKeys = $this->pages->find("parent={$this->page->id}, passwordResetExpiration<{$time}");
foreach ($expiredKeys as $key) {
$key->delete();
}
}


public function controller() {
$this->setField();
$segment1 = ($this->input->urlSegment1);
$segment2 = ($this->input->urlSegment2);

$this->deleteAllExpiredKeys();

if (empty($segment1)) {
$this->session->requestKeySent = false;
return $this->getRequestForm();
Expand Down
7 changes: 5 additions & 2 deletions readme.md
Original file line number Diff line number Diff line change
Expand Up @@ -60,15 +60,18 @@ Make sure the controller is echo'ed somewhere. It will output the forms and any

## Todo

- Housekeeping script to delete expired requests
- Uninstall script
- Probably some markup tweaking
- Ajaxify (eventually)
- Progress bar?

## Versions

**0.0.4 Current beta**
**0.0.5 Current beta**



**0.0.4**

[See changes](https://github.com/plauclair/PasswordReset/commit/fa9cdcbea7425c8efc8eb316573df89870f2c802)

Expand Down

0 comments on commit cd1b804

Please sign in to comment.