Code

last bit of the nagios plugins updates
authoropensides <opensides@594d385d-05f5-0310-b6e9-bd551577e9d8>
Mon, 17 Oct 2005 09:41:57 +0000 (09:41 +0000)
committeropensides <opensides@594d385d-05f5-0310-b6e9-bd551577e9d8>
Mon, 17 Oct 2005 09:41:57 +0000 (09:41 +0000)
git-svn-id: https://oss.gonicus.de/repositories/gosa/trunk@1582 594d385d-05f5-0310-b6e9-bd551577e9d8

plugins/admin/groups/class_groupGeneric.inc
plugins/admin/groups/generic.tpl

index 52df6e02369d44cc8bd4e8795c04e192b975ed0f..37e1814d54502b559cd29d631822faca69cc5665 100644 (file)
@@ -75,6 +75,11 @@ class group extends plugin
       } else {
         $this->fon_group= TRUE;
       }
+      if (array_search ('nagiosContactGroup', $this->attrs['objectClass']) == NULL ){
+        $this->nagios_group= FALSE;
+      } else {
+        $this->nagios_group= TRUE;
+      }
     }
 
     /* Set mail flag */
@@ -293,6 +298,13 @@ class group extends plugin
     }
     $smarty->assign("fon_groupACL", chkacl($this->acl, "fon_group"));
 
+    if ($this->nagios_group){
+      $smarty->assign("nagios_group", "checked");
+    } else {
+      $smarty->assign("nagios_group", "");
+    }
+    $smarty->assign("nagios_groupACL", chkacl($this->acl, "nagios_group"));
+
     /* Fields */
     foreach (array("cn", "description", "gidNumber") as $val){
       $smarty->assign("$val", $this->$val);
@@ -427,7 +439,13 @@ class group extends plugin
           $this->fon_group= FALSE;
         }
       }
-
+        if (chkacl ($this->acl, "nagios_group") == ""){
+        if (isset ($_POST['nagios_group'])){
+          $this->nagios_group= TRUE;
+        } else {
+          $this->nagios_group= FALSE;
+        }
+      }
     }
   }
 
@@ -462,7 +480,8 @@ class group extends plugin
     for ($i= 0; $i<count($this->attrs["objectClass"]); $i++){
       if ($this->attrs['objectClass'][$i] != 'sambaGroupMapping' &&
           $this->attrs['objectClass'][$i] != 'sambaIdmapEntry' &&
-          $this->attrs['objectClass'][$i] != 'goFonPickupGroup'){
+          $this->attrs['objectClass'][$i] != 'goFonPickupGroup' &&
+        $this->attrs['objectClass'][$i] != 'nagiosContactGroup'){
         $tmp[]= $this->attrs['objectClass'][$i];
       }
     }
@@ -514,6 +533,11 @@ class group extends plugin
       $this->attrs['objectClass'][]= "goFonPickupGroup";
     }
 
+    /* Add nagios functionality */
+    if ($this->nagios_group){
+       $this->attrs['objectClass'][]= "nagiosContactGroup";
+    }
+
     /* Take members array */
     if (count ($this->memberUid)){
       $this->attrs['memberUid']= array_unique($this->memberUid);
index e6a6360d032c1ce809bdea2bf8465d600993a19c..e6e786044b4d6fb4c7451094e37eca1974a11c97 100644 (file)
       <input type=checkbox name="fon_group" value="1" {$fon_group} {$fon_groupACL}>{t}Members are in a phone pickup group{/t}
      </td>
     </tr>
+    <tr>
+      <td colspan=2> <div style="height:15px; width:100%; border-bottom:1px solid #909090;"></div> </td>
+    </tr>
+    <tr>
+      <td colspan=2> <div style="height:15px; width:100%;"></div> </td>
+    </tr>
+    <tr>
+     <td colspan=2>
+      <input type=checkbox name="nagios_group" value="1" {$nagios_group} {$nagios_groupACL}>{t}Members are in a nagios group{/t}
+     </td>
+    </tr>
    </table>
 
   </td>