Code

Search CYRUSUNIXSTYLE in current location and in main
[gosa.git] / plugins / personal / nagios / class_nagiosAccount.inc
index 9465e97e73245e331f49da1e13051e0c5de28f87..216c0913521b9b7b929275b81da892ac17b4ef70 100644 (file)
@@ -141,8 +141,10 @@ class nagiosAccount extends plugin
 
     /* Write back to ldap */
     $ldap->cd($this->dn);
-    $ldap->modify($this->attrs);
-    show_ldap_error($ldap->get_error());
+    $this->cleanup();
+    $ldap->modify ($this->attrs); 
+
+    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){
@@ -156,7 +158,9 @@ class nagiosAccount extends plugin
 
   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 == ""){
@@ -216,8 +220,10 @@ class nagiosAccount extends plugin
     @DEBUG (DEBUG_LDAP, __LINE__, __FUNCTION__, __FILE__,
         $this->attributes, "Save");
     $ldap->cd($this->dn);
-    $ldap->modify($this->attrs);
-    show_ldap_error($ldap->get_error());
+    $this->cleanup();
+    $ldap->modify ($this->attrs); 
+
+    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']);
@@ -226,6 +232,38 @@ class nagiosAccount extends plugin
     $this->handle_post_events('remove');
   }
 
+
+
+  function plInfo()
+  {
+    return (array(
+          "plDescription"   => _("Intranet account settings"),
+          "plSelfModify"    => TRUE,
+          "plDepends"       => array("objectClass" => "gosaAccount"),
+
+          "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: