Code

Made proxy account compatible with acls
[gosa.git] / plugins / personal / nagios / class_nagiosAccount.inc
index ba64598dc4fd215fa2b5b43f658ba3387d6bb05b..3809cb58a33b5c18751fe490a7facab21e47b587 100644 (file)
@@ -98,10 +98,10 @@ class nagiosAccount extends plugin
     /* Show tab dialog headers */
     if ($this->parent != NULL){
       if ($this->is_account){
-        $display= $this->show_header(_("Remove nagios account"),
+        $display= $this->show_disable_header(_("Remove nagios account"),
             _("This account has nagios features enabled. You can disable them by clicking below."));
       } else {
-        $display= $this->show_header(_("Create nagios account"), _("This account has nagios features disabled. You can enable them by clicking below."));
+        $display= $this->show_enable_header(_("Create nagios account"), _("This account has nagios features disabled. You can enable them by clicking below."));
         return($display);
       }
     }
@@ -142,9 +142,9 @@ class nagiosAccount extends plugin
     /* Write back to ldap */
     $ldap->cd($this->dn);
     $this->cleanup();
-$ldap->modify ($this->attrs); 
+    $ldap->modify ($this->attrs); 
 
-    show_ldap_error($ldap->get_error());
+    show_ldap_error($ldap->get_error(), sprintf(_("Saving of user/nagios account with dn '%s' failed."),$this->dn));
 
     /* Optionally execute a command after we're done */
     if ($this->initially_was_account == $this->is_account){
@@ -158,7 +158,9 @@ $ldap->modify ($this->attrs);
 
   function check()
   {
-    $message= array();
+    /* Call common method to give check the hook */
+    $message= plugin::check();
+
     $ldap= $this->config->get_ldap_link();
     /* must: mail */
     if ($this->NagiosAlias == ""){
@@ -219,9 +221,9 @@ $ldap->modify ($this->attrs);
         $this->attributes, "Save");
     $ldap->cd($this->dn);
     $this->cleanup();
-$ldap->modify ($this->attrs); 
+    $ldap->modify ($this->attrs); 
 
-    show_ldap_error($ldap->get_error());
+    show_ldap_error($ldap->get_error(), sprintf(_("Removing of user/nagios account with dn '%s' failed."),$this->dn));
 
     /* remove the entry from LDAP */
     unset ($this->attrs['uid']);
@@ -230,6 +232,45 @@ $ldap->modify ($this->attrs);
     $this->handle_post_events('remove');
   }
 
+
+
+  function plInfo()
+  {
+    return (array(
+          "plShortName"     => _("Nagios"),
+          "plDescription"   => _("Nagios account settings"),
+          "plSelfModify"    => TRUE,
+          "plDepends"       => array("user"),
+          "plPriority"      => 8,                                 // Position in tabs
+          "plSection"       => "personal",                        // This belongs to personal
+          "plCategory"      => array("users"),                   
+          "plOptions"       => array(),
+
+          "plProvidedAcls"  => array(
+
+            "NagiosAlias"                       =>  _("Alias"),
+            "NagiosPager"                       =>  _("Pager number"),
+            "NagiosMail"                        =>  _("Mail address"),
+
+            "HostNotificationCommands"          =>  _("Host notification commands"),
+            "HostNotificationOptions"           =>  _("Host notification options"),
+            "HostNotificationPeriod"            =>  _("Host notification period"),
+
+            "ServiceNotificationCommands"       =>  _("Service notification commands"),
+            "ServiceNotificationOptions"        =>  _("Service notification options"),
+            "ServiceNotificationPeriod"         =>  _("Service notification period"),
+
+            "AuthorizedAllHosts"                =>  _("View all hosts"),
+            "AuthorizedAllServices"             =>  _("View all services"),
+
+            "AuthorizedSystemCommands"          =>  _("Trigger system commands"),
+            "AuthorizedAllHostCommands"         =>  _("Trigger all host commands"),
+            "AuthorizedAllServiceCommands"      =>  _("Trigger all service commands"),
+
+            "AuthorizedConfigurationInformation"=>  _("View configuration information"),
+            "AuthorizedSystemInformation"       =>  _("View system informations"))
+      ));
+  }
 }
 
 // vim:tabstop=2:expandtab:shiftwidth=2:filetype=php:syntax:ruler: