Code

Fixed acls for nagios
[gosa.git] / plugins / personal / nagios / main.inc
index a3373c24207a266b70d00c8489349d82d1f90c0b..800190568466a513409c8f6de31ded7c742d681a 100644 (file)
@@ -30,6 +30,8 @@ if (!$remove_lock){
   /* Create mail object on demand */
   if (!isset($_SESSION['nagiosAccount']) || (isset($_GET['reset']) && $_GET['reset'] == 1)){
     $_SESSION['nagiosAccount']= new nagiosAccount ($config, $ui->dn);
+    $_SESSION['nagiosAccount']->set_acl_base($ui->dn);
+    $_SESSION['nagiosAccount']->set_acl_category("users");
   }
   $nagiosAccount= $_SESSION['nagiosAccount'];
 
@@ -99,11 +101,11 @@ if (!$remove_lock){
       $info= "<img alt=\"\" align=\"middle\" src=\"".get_template_path('images/openlock.png').
              "\"> ".$ui->dn."&nbsp;";
 
-      echo "FIXME : user -> nagios, 102 Only display edit button if there is at least one attribute editable.";
-      $info.= "<img alt=\"\" align=\"middle\" src=\"".get_template_path('images/lamp.png').
-        "\"> "._("Click the 'Edit' button below to change informations in this dialog");
-      $display.= "<input type=submit name=\"edit\" value=\""._("Edit")."\">\n";
-
+      if(preg_match("/w/",$ui->get_permissions($ui->dn,"users/nagiosAccount"))){
+        $info.= "<img alt=\"\" align=\"middle\" src=\"".get_template_path('images/lamp.png').
+          "\"> "._("Click the 'Edit' button below to change informations in this dialog");
+        $display.= "<input type=submit name=\"edit\" value=\""._("Edit")."\">\n";
+      }
       $display.= "<input type=\"hidden\" name=\"ignore\">\n";
     }
     $display.= "</p>\n";