added retention rules to piler core

This commit is contained in:
SJ
2012-02-19 22:59:47 +01:00
parent e51af89e5d
commit 020756fa1c
24 changed files with 181 additions and 59 deletions

View File

@ -91,6 +91,7 @@ define('TABLE_DOMAIN', 'domain');
define('TABLE_COUNTER', 'counter');
define('TABLE_AUDIT', 'audit');
define('TABLE_ARCHIVING_RULE', 'archiving_rule');
define('TABLE_RETENTION_RULE', 'retention_rule');
define('VIEW_MESSAGES', 'messages');
define('SPHINX_DRIVER', 'sphinx');

View File

@ -21,16 +21,16 @@ class ControllerPolicyArchiving extends Controller {
$this->data['rules'] = array();
if(Registry::get('admin_user') == 0) {
die("go away");
}
if($_SERVER['REQUEST_METHOD'] == 'POST') {
$rc = $this->model_policy_archiving->add_new_rule($this->request->post);
}
$this->data['rules'] = $this->model_policy_archiving->get_rules();
//print_r($this->data['rules']);
$this->render();
}

View File

@ -170,6 +170,7 @@ $_['text_non_existent_queue_directory'] = "The queue directory you have specifie
$_['text_non_existing_user'] = "Non existing user";
$_['text_not_found'] = "Not found";
$_['text_not_running'] = "not running";
$_['text_not_spam'] = "not spam";
$_['title_not_found'] = "Page not found";
$_['text_number_of_messages_in_quarantine'] = "Number of messages in the quarantine matching your search criteria";
$_['text_number_of_spam_messages_in_quarantine'] = "Number of spam messages in the quarantine matching your search criteria";
@ -239,6 +240,8 @@ $_['text_simple'] = "Simple";
$_['text_simple_search'] = "Simple search";
$_['text_size'] = "Size";
$_['text_smtp_status'] = "SMTP status";
$_['text_spam'] = "Spam";
$_['text_spam2'] = "spam";
$_['text_statistics'] = "Statistics";
$_['text_status'] = "Status";
$_['text_subject'] = "Subject";

View File

@ -171,6 +171,7 @@ $_['text_non_existent_queue_directory'] = "A megadott queue k
$_['text_non_existing_user'] = "Nem l<>tez<65> felhaszn<7A>l<EFBFBD>";
$_['text_not_found'] = "Nincs tal<61>lat";
$_['text_not_running'] = "nem fut";
$_['text_not_spam'] = "nem spam";
$_['title_not_found'] = "Az oldal nem tal<61>lhat<61>";
$_['text_number_of_messages_in_quarantine'] = "A keres<65>si felt<6C>telnek megfelel<65> <20>zenetek sz<73>ma a karant<6E>nban";
$_['text_number_of_spam_messages_in_quarantine'] = "A keres<65>si felt<6C>telnek megfelel<65> spam <20>zenetek sz<73>ma a karant<6E>nban";
@ -240,6 +241,8 @@ $_['text_simple'] = "Egyszer
$_['text_simple_search'] = "Egyszer<EFBFBD> keres<65>s";
$_['text_size'] = "M<EFBFBD>ret";
$_['text_smtp_status'] = "SMTP st<73>tusz";
$_['text_spam'] = "Spam";
$_['text_spam2'] = "spam";
$_['text_statistics'] = "Statisztika";
$_['text_status'] = "St<EFBFBD>tusz";
$_['text_subject'] = "T<EFBFBD>rgy";

View File

@ -171,6 +171,7 @@ $_['text_non_existent_queue_directory'] = "A megadott queue könyvtár nem léte
$_['text_non_existing_user'] = "Nem létező felhasználó";
$_['text_not_found'] = "Nincs találat";
$_['text_not_running'] = "nem fut";
$_['text_not_spam'] = "nem spam";
$_['title_not_found'] = "Az oldal nem található";
$_['text_number_of_messages_in_quarantine'] = "A keresési feltételnek megfelelő üzenetek száma a karanténban";
$_['text_number_of_spam_messages_in_quarantine'] = "A keresési feltételnek megfelelő spam üzenetek száma a karanténban";
@ -240,6 +241,8 @@ $_['text_simple'] = "Egyszerű";
$_['text_simple_search'] = "Egyszerű keresés";
$_['text_size'] = "Méret";
$_['text_smtp_status'] = "SMTP státusz";
$_['text_spam'] = "Spam";
$_['text_spam2'] = "spam";
$_['text_statistics'] = "Statisztika";
$_['text_status'] = "Státusz";
$_['text_subject'] = "Tárgy";

View File

@ -22,7 +22,7 @@ class ModelPolicyArchiving extends Model {
public function add_new_rule($data = array()) {
$query = $this->db->query("INSERT INTO " . TABLE_ARCHIVING_RULE . " (`from`,`to`,`subject`,`_size`,`size`,`attachment_type`,`_attachment_size`,`attachment_size`) VALUES(?,?,?,?,?,?,?,?)", array($data['from'], $data['to'], $data['subject'], $data['_size'], $data['size'], $data['attachment_type'], $data['_attachment_size'], $data['attachment_size']));
$query = $this->db->query("INSERT INTO " . TABLE_ARCHIVING_RULE . " (`from`,`to`,`subject`,`_size`,`size`,`attachment_type`,`_attachment_size`,`attachment_size`,`spam`) VALUES(?,?,?,?,?,?,?,?,?)", array($data['from'], $data['to'], $data['subject'], $data['_size'], $data['size'], $data['attachment_type'], $data['_attachment_size'], $data['attachment_size'], $data['spam']));
return $this->db->countAffected();
}

View File

@ -11,10 +11,11 @@
<div class="mcell" style="width: 350px; border: 0px solid red;">
<ul class="dropdown">
<li class="search_li" style="padding: 0;"><a href="search.php"<?php if($_SERVER['REQUEST_URI'] == '/' || strstr($_SERVER['REQUEST_URI'], "search.php")){ ?> id="active"<?php } ?>><?php print $text_simple_search; ?></a> | </li>
<li class="search_li" style="padding: 0; padding-left: 2px;"><a href="advanced.php"<?php if(strstr($_SERVER['REQUEST_URI'], "advanced.php")){ ?> id="active"<?php } ?>><?php print $text_advanced_search; ?></a> | </li>
<li class="search_li" style=""><a href="search.php"<?php if($_SERVER['REQUEST_URI'] == '/' || strstr($_SERVER['REQUEST_URI'], "search.php")){ ?> id="active"<?php } ?>><?php print $text_simple; ?></a> / </li>
<li class="search_li" style=""><a href="advanced.php"<?php if(strstr($_SERVER['REQUEST_URI'], "advanced.php")){ ?> id="active"<?php } ?>><?php print $text_advanced; ?></a></li>
<li class="no_search_li" style=""><?php print $text_search2; ?> | </li>
<li class="search_li" style="padding:0; padding-left: 2px;"><a class="hide" href="#"<?php if(strstr($_SERVER['QUERY_STRING'], "stat/") || strstr($_SERVER['QUERY_STRING'], "health/") || strstr($_SERVER['QUERY_STRING'], "audit/") ) { ?> id="active"<?php } ?>><?php print $text_monitor; ?></a> |
<li class="search_li" style=""><a class="hide" href="#"<?php if(strstr($_SERVER['QUERY_STRING'], "stat/") || strstr($_SERVER['QUERY_STRING'], "health/") || strstr($_SERVER['QUERY_STRING'], "audit/") ) { ?> id="active"<?php } ?>><?php print $text_monitor; ?></a> |
<ul class="sub_menu">
<li><a href="index.php?route=stat/stat&timespan=daily"><?php print $text_statistics; ?></a></li>
<li><a href="index.php?route=health/health"><?php print $text_health; ?></a></li>
@ -22,7 +23,7 @@
</ul>
</li>
<li class="search_li" style="padding:0; padding-left: 2px;"><a class="hide" href="#"<?php if(strstr($_SERVER['QUERY_STRING'], "domain/") || ($_SERVER['QUERY_STRING'] != "route=user/settings" && strstr($_SERVER['QUERY_STRING'], "user/")) || strstr($_SERVER['QUERY_STRING'], "policy/") || strstr($_SERVER['QUERY_STRING'], "import/")) { ?> id="active"<?php } ?>><?php print $text_administration; ?></a>
<li class="search_li" style=""><a class="hide" href="#"<?php if(strstr($_SERVER['QUERY_STRING'], "domain/") || ($_SERVER['QUERY_STRING'] != "route=user/settings" && strstr($_SERVER['QUERY_STRING'], "user/")) || strstr($_SERVER['QUERY_STRING'], "policy/") || strstr($_SERVER['QUERY_STRING'], "import/")) { ?> id="active"<?php } ?>><?php print $text_administration; ?></a>
<ul class="sub_menu">
<li><a href="index.php?route=user/list"><?php print $text_user_management; ?></a></li>
<li><a href="index.php?route=domain/domain"><?php print $text_domain; ?></a></li>

View File

@ -43,6 +43,18 @@
<input type="text" class="ruletext" name="attachment_size" />
</div>
</div>
<div class="row">
<div class="domaincell"><?php print $text_spam; ?>:</div>
<div class="domaincell">
<select class="ruleselect" name="spam">
<option value="-1">-</option>
<option value="0"><?php print $text_not_spam; ?></option>
<option value="1"><?php print $text_spam2; ?></option>
</select>
<input type="text" class="ruletext" name="attachment_size" />
</div>
</div>
<div class="row">
<div class="domaincell">&nbsp;</div>
@ -58,11 +70,12 @@
<?php if(isset($rules)){ ?>
<div id="ss1" style="margin-top: 10px; width: 600px; border: 1px solid red;">
<div id="ss1" style="margin-top: 10px; border: 1px solid red;">
<div class="domainrow">
<div class="domaincell"><?php print $text_from; ?></div>
<div class="domaincell"><?php print $text_to; ?></div>
<div class="domaincell"><?php print $text_subject; ?></div>
<div class="domaincell"><?php print $text_spam; ?></div>
<div class="domaincell"><?php print $text_size; ?></div>
<div class="domaincell"><?php print $text_attachment_type; ?></div>
<div class="domaincell"><?php print $text_attachment_size; ?></div>
@ -74,6 +87,7 @@
<div class="domaincell"><?php print $rule['from']; ?></div>
<div class="domaincell"><?php print $rule['to']; ?></div>
<div class="domaincell"><?php print $rule['subject']; ?></div>
<div class="domaincell"><?php if($rule['spam'] == -1) { print "-"; } else if($rule['spam'] == 0) { print $text_not_spam; } else { print $text_spam; } ?></div>
<div class="domaincell"><?php if($rule['size'] > 0) { print $rule['_size']; ?> <?php print $rule['size']; } ?></div>
<div class="domaincell"><?php print $rule['attachment_type']; ?></div>
<div class="domaincell"><?php if($rule['attachment_size'] > 0) { print $rule['_attachment_size']; ?> <?php print $rule['attachment_size']; } ?></div>