[Tickets #8991] Check for active rules
bugs at horde.org
bugs at horde.org
Wed Apr 28 09:38:23 UTC 2010
DO NOT REPLY TO THIS MESSAGE. THIS EMAIL ADDRESS IS NOT MONITORED.
Ticket URL: http://bugs.horde.org/ticket/8991
------------------------------------------------------------------------------
Ticket | 8991
Created By | rene.plattner at uibk.ac.at
Summary | Check for active rules
Queue | Ingo
Version | 1.2.3
Type | Enhancement
State | New
Priority | 1. Low
Milestone |
Patch |
Owners |
------------------------------------------------------------------------------
rene.plattner at uibk.ac.at (2010-04-28 05:38) wrote:
We added some code to check if any rules are active:
--- 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
More information about the bugs
mailing list