Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add fields for purge_junk_days and purge_trash_days #109

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
17 changes: 16 additions & 1 deletion ispconfig3_spam/ispconfig3_spam.php
Original file line number Diff line number Diff line change
Expand Up @@ -122,6 +122,8 @@ function save()
}

$params['move_junk'] = $move_junk;
$params['purge_junk_days'] = rcube_utils::get_input_value('_purge_junk_days', rcube_utils::INPUT_POST);
$params['purge_trash_days'] = rcube_utils::get_input_value('_purge_trash_days', rcube_utils::INPUT_POST);

$this->soap->mail_user_update($session_id, $uid, $mail_user[0]['mailuser_id'], $params);
$this->soap->logout($session_id);
Expand Down Expand Up @@ -175,6 +177,9 @@ function gen_form($attrib)
$enabled = $mail_user[0]['move_junk'];
if ($enabled == 'y') {
$enabled = 1;

$purge_junk_days = $mail_user[0]['purge_junk_days'];
$purge_trash_days = $mail_user[0]['purge_trash_days'];
}
}
catch (SoapFault $e) {
Expand All @@ -194,8 +199,18 @@ function gen_form($attrib)
$input_spammove = new html_checkbox(['name' => '_' . $field_id, 'id' => $field_id, 'value' => '1']);
$table->add('title', html::label($field_id, rcube::Q($this->gettext('spammove'))));
$table->add('', $input_spammove->show($enabled));
$out .= $table->show();

$field_id = 'purge_junk_days';
$input_purge_junk_days = new html_inputfield(array('name' => '_' . $field_id, 'id' => $field_id, 'size' => '10'));
$table->add('title', html::label($field_id, rcube::Q($this->gettext('purge_junk_days'))));
$table->add('', $input_purge_junk_days->show($purge_junk_days));

$field_id = 'purge_trash_days';
$input_purge_trash_days = new html_inputfield(array('name' => '_' . $field_id, 'id' => $field_id, 'size' => '10'));
$table->add('title', html::label($field_id, rcube::Q($this->gettext('purge_trash_days'))));
$table->add('', $input_purge_trash_days->show($purge_trash_days));

$out .= $table->show();
$out .= "</fieldset>\n";

return $out;
Expand Down
4 changes: 3 additions & 1 deletion ispconfig3_spam/localization/en_US.inc
Original file line number Diff line number Diff line change
Expand Up @@ -7,4 +7,6 @@ $labels['policy_greylisting'] = 'Greylisting level';
$labels['policy_tag'] = 'Tag level';
$labels['policy_tag2'] = 'Tag2 level';
$labels['policy_kill'] = 'Kill level';
$labels['spamnopolicies'] = 'No policies available';
$labels['spamnopolicies'] = 'No policies available';
$labels['purge_junk_days'] = 'Purge Junk automatically after X days';
$labels['purge_trash_days'] = 'Purge Trash automatically after X days';
4 changes: 3 additions & 1 deletion ispconfig3_spam/localization/nl_NL.inc
Original file line number Diff line number Diff line change
Expand Up @@ -7,4 +7,6 @@ $labels['policy_greylisting'] = 'Greylisting level';
$labels['policy_tag'] = 'Tag level';
$labels['policy_tag2'] = 'Tag2 level';
$labels['policy_kill'] = 'Kill level';
$labels['spamnopolicies'] = 'Geen policies beschikbaar';
$labels['spamnopolicies'] = 'Geen policies beschikbaar';
$labels['purge_junk_days'] = 'Verwijder uit de Junk map automatisch na X dagen';
$labels['purge_trash_days'] = 'Verwijder uit de Prullenbak automatisch na X dagen';
Loading