diff options
Diffstat (limited to 'application/controllers')
-rw-r--r-- | application/controllers/user.php | 14 |
1 files changed, 14 insertions, 0 deletions
diff --git a/application/controllers/user.php b/application/controllers/user.php index 3b6570a91..add6e8bdc 100644 --- a/application/controllers/user.php +++ b/application/controllers/user.php @@ -216,4 +216,18 @@ class User extends CI_Controller { $this->load->view($this->var->view_dir.'hash_password', $this->data); $this->load->view($this->var->view_dir.'footer', $this->data); } + + function cron() + { + if (!$this->input->is_cli_request()) return; + + if ($this->config->item('invitations_max_age') == 0) return; + + $oldest_time = (time() - $this->config->item('invitations_max_age')); + + $this->db->query(" + DELETE FROM invitations + WHERE date < ? + ", array($oldest_time)); + } } |