Code

Added acls for printer glpi
[gosa.git] / plugins / admin / systems / class_terminalGeneric.inc
index 7f07d2e8ea1d5fc612fecd3b35f5572d1f595a54..69a5872fd5e2b2ab5a6222322f157d5f4e920c20 100644 (file)
@@ -56,9 +56,9 @@ class termgeneric extends plugin
                             "sysinfo"         => "sysinfo");
 
 
-  function termgeneric ($config, $dn= NULL)
+  function termgeneric ($config, $dn= NULL, $parent= NULL)
   {
-    plugin::plugin ($config, $dn);
+    plugin::plugin ($config, $dn, $parent);
     $this->netConfigDNS = new termDNS($this->config,$this->dn,$this->objectclasses);
     /* Read arrays */
     foreach (array("ghNetNic", "ghIdeDev", "ghScsiDev") as $val){
@@ -158,7 +158,7 @@ class termgeneric extends plugin
 
       $ldap->cd($this->dn);
       $ldap->modify($attrs);
-      show_ldap_error($ldap->get_error());
+      show_ldap_error($ldap->get_error(), sprintf(_("Saving of system terminal/generic (FAIstate) with dn '%s' failed."),$this->dn));
 
       switch($_POST['saction']){
         case 'wake':
@@ -204,7 +204,7 @@ class termgeneric extends plugin
     foreach($_POST as $name => $value){
       if(preg_match("/^chooseBase/",$name) && $once){
         $once = false;
-        $this->dialog = new baseSelectDialog($this->config);
+        $this->dialog = new baseSelectDialog($this->config,$this);
         $this->dialog->setCurrentBase($this->base);
       }
     }
@@ -282,11 +282,16 @@ class termgeneric extends plugin
     }
   
     $smarty->assign("nfsservers",     $tmp2);
+    $smarty->assign("syslogservers",  $this->gotoSyslogServers);
 
+    $tmp = array();
+    foreach($this->gotoNtpServers as $server){
+      if(!in_array($server,$this->gotoNtpServer)){
+        $tmp[$server] = $server;
+      }
+    }
     
-
-    $smarty->assign("syslogservers",  $this->gotoSyslogServers);
-    $smarty->assign("ntpservers",     $this->gotoNtpServers);
+    $smarty->assign("ntpservers",     $tmp);
 
     /* Variables */
     foreach(array("base", "gotoMode", "gotoTerminalPath", "gotoSwapServer",
@@ -311,7 +316,7 @@ class termgeneric extends plugin
     if($ldap->count()){
       $this->netConfigDNS->remove_from_parent();
       $ldap->rmDir($this->dn);
-      show_ldap_error($ldap->get_error(), _("Removing terminal failed"));
+      show_ldap_error($ldap->get_error(), sprintf(_("Removing of object system terminal/generic with dn '%s' failed."),$this->dn));
 
       /* Optionally execute a command after we're done */
       $this->handle_post_events("remove", array("macAddress" => $this->netConfigDNS->macAddress));
@@ -468,12 +473,36 @@ class termgeneric extends plugin
     }
     $this->netConfigDNS->cn = $this->cn;
     $this->netConfigDNS->save($this->dn);
-    show_ldap_error($ldap->get_error(), _("Saving terminal failed"));
+    show_ldap_error($ldap->get_error(), sprintf(_("Saving of object system terminal/generic with dn '%s' failed."),$this->dn));
 
     /* Optionally execute a command after we're done */
     $this->postcreate();
   }
 
+
+  /* Return plugin informations for acl handling */
+  function plInfo()
+  {
+    return (array(
+          "plShortName"   => _("Terminal"),
+          "plDescription" => _("Terminal generic"),
+          "plSelfModify"  => FALSE,
+          "plDepends"     => array(),
+          "plPriority"    => 0,
+          "plSection"     => array("administration"),
+          "plCategory"    => array("terminal" => array( "description"  => _("Terminal"),
+                                                        "objectClass"  => "gotoTerminal")),
+          "plProvidedAcls"=> array(
+            "gotoMode"            => _("Mode"),
+            "gotoTerminalPath"    => _("Root server"),
+            "gotoSwapServer"      => _("Swap server"),
+            "gotoSyslogServer"    => _("Syslog server enabled"),
+            "gotoNtpServer"       => _("Ntp server settings"),
+            "base"                => _("Base"),
+            "cn"                  => _("Name"),
+            "FAIstate"            => _("Action flag"))
+          ));
+  }
 }
 
 // vim:tabstop=2:expandtab:shiftwidth=2:filetype=php:syntax:ruler: