Code

Added acls for printer glpi
[gosa.git] / plugins / admin / systems / class_phoneGeneric.inc
index 24566d9f2ed296f5eb2ff12a1084b616e493bd68..2a98149b2c37c476b98104ca4a20dc6d2f196861 100644 (file)
@@ -53,9 +53,9 @@ class phoneGeneric extends plugin
 
   var $objectclasses= array("top", "goFonHardware");
 
-  function phonegeneric ($config, $dn= NULL)
+  function phonegeneric ($config, $dn= NULL, $parent= NULL)
   {
-    plugin::plugin ($config, $dn);
+    plugin::plugin ($config, $dn, $parent);
     $this->netConfigDNS = new termDNS($this->config,$this->dn,$this->objectclasses, true);
 
     /* Set base */
@@ -111,7 +111,7 @@ class phoneGeneric 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);
       }
     }
@@ -244,7 +244,7 @@ class phoneGeneric extends plugin
 
     $this->netConfigDNS->remove_from_parent();
     $ldap->rmdir($this->dn);
-    show_ldap_error($ldap->get_error(), _("Removing phone failed"));
+    show_ldap_error($ldap->get_error(), sprintf(_("Removing of system phone/generic with dn '%s' failed."),$this->dn));
     $this->handle_post_events("remove");
 
     /* Delete references to object groups */
@@ -394,12 +394,38 @@ class phoneGeneric extends plugin
     }
     $this->netConfigDNS->cn = $this->cn;    
     $this->netConfigDNS->save($this->dn);
-    show_ldap_error($ldap->get_error(), _("Saving phone failed"));
+    show_ldap_error($ldap->get_error(), sprintf(_("Saving of system phone/generic with dn '%s' failed."),$this->dn));
 
     /* Optionally execute a command after we're done */
     $this->postcreate();
   }
 
+
+  /* Return plugin informations for acl handling
+      #FIXME FAIscript seams to ununsed within this class... */
+  function plInfo()
+  {
+    return (array(
+          "plShortName"   => _("Generic"),
+          "plDescription" => _("Phone generic"),
+          "plSelfModify"  => FALSE,
+          "plDepends"     => array(),
+          "plPriority"    => 0,
+          "plSection"     => array("administration"),
+          "plCategory"    => array("phone" => array("description"  => _("Phone hardware"),
+                                                    "objectClass"  => "goFonHardware")),
+          "plProvidedAcls"=> array(
+            "cn"                  => _("Name"),
+            "description"         => _("Description"),
+            "goFonType"           => _("Mode"),
+            "goFonDmtfMode"       => _("DTMF mode"),
+            "goFonDefaultIP"      => _("Default ip"),
+            "goFonQualify"        => _("Qualify"),
+            "selected_categorie"  => _("Hardware type"))
+          ));
+  }
+
+
 }
 
 // vim:tabstop=2:expandtab:shiftwidth=2:filetype=php:syntax:ruler: