Summary | Check for active rules |
Queue | Ingo |
Queue Version | 1.2.3 |
Type | Enhancement |
State | Assigned |
Priority | 1. Low |
Owners | jan (at) horde (dot) org |
Requester | rene.plattner (at) uibk (dot) ac (dot) at |
Created | 04/28/2010 (5496 days ago) |
Due | |
Updated | 04/29/2022 (1112 days ago) |
Assigned | 06/15/2010 (5448 days ago) |
Resolved | |
Milestone | |
Patch | Yes |
So we are interrested in to disable the local user procmail script,
if no user rule is aktive.
If no local procmail script is active then the global procmail
script is used.
This is easier for us for debugging.
State ⇒ Assigned
Patch ⇒ Yes
So we are interrested in to disable the local user procmail script, if
no user rule is aktive.
If no local procmail script is active then the global procmail script is used.
This is easier for us for debugging.
State ⇒ Feedback
Priority ⇒ 1. Low
Type ⇒ Enhancement
Summary ⇒ Check for active rules
Queue ⇒ Ingo
Milestone ⇒
Patch ⇒ No
State ⇒ New
--- ingo-h3-1.2.3/lib/Storage.php 2009-07-24 10:57:03.000000000 +0200
+++ /var/www/html/horde/ingo/lib/Storage.php 2010-03-09
11:30:49.000000000 +0100
@@ -896,6 +896,21 @@
}
/**
+ * Checks, if all rules are disabled.
+ *
+ * @return boolean True on success.
+ */
+ function allRulesDisabled()
+ {
+ foreach ($this->_filters as $id => $rule) {
+ if ($rule['disable'] == false) {
+ return false;
+ }
+ }
+ return true;
+ }
+
+ /**
* Searches for the first rule of a certain action type and returns its
* number.
*
If all rules are disabled then we remove the script on the backend:
--- ingo-h3-1.2.3/lib/Ingo.php 2008-12-15 03:33:08.000000000 +0100
+++ /var/www/html/horde/ingo/lib/Ingo.php 2010-03-09
11:34:17.000000000 +0100
@@ -153,6 +153,11 @@
global $notification;
$driver = Ingo::getDriver();
+ $filters =
&$GLOBALS['ingo_storage']->retrieve(INGO_STORAGE_ACTION_FILTERS);
+ if ($filters->allRulesDisabled()) {
+ $script = '';
+ $deactivate = true;
+ }
$res = $driver->setScriptActive($script);
if (is_a($res, 'PEAR_Error')) {
$msg = ($deactivate)
I appreciate your comment.
Kind regards,
René Plattner