possibility to set default expiration time

This commit is contained in:
Claude 2013-03-08 18:28:03 +01:00
parent 5a6415de48
commit b1affc5932
2 changed files with 21 additions and 0 deletions

View File

@ -79,6 +79,21 @@ $config['blocked_words'] = '';
$config['spamadmin_user'] = '';
$config['spamadmin_pass'] = '';
/**
* Default paste expiration time (minutes)
*
* Possible values:
* 0 (keep forever)
* 30 (30 minutes)
* 60 (1 hour)
* 360 (6 hours)
* 720 (12 hours)
* 1440 (1 day)
* 10080 (1 week)
* 40320 (4 weeks)
**/
$config['default_expiration'] = 0;
/**
* Default language
*

View File

@ -267,6 +267,12 @@ class Main extends CI_Controller
if (!$this->input->post('submit'))
{
if (!$this->db_session->userdata('expire'))
{
$default_expiration = $this->config->item('default_expiration');
$this->db_session->set_userdata('expire', $default_expiration);
}
if ($this->db_session->flashdata('settings_changed'))
{
$data['status_message'] = 'Settings successfully changed';