Code

Updated translation, fixed some typo/errors
[gosa.git] / plugins / gofax / faxaccount / class_gofaxAccount.inc
index 8cda3f99163c45a8feb3d6e548a45154de7625b0..42ab729cecd4b5f0765cdff8aa5efdd74e300ad2 100644 (file)
@@ -6,17 +6,11 @@ class gofaxAccount extends plugin
   var $plHeadline= "FAX";
   var $plDescription= "This does something";
 
-  /* CLI vars */
-  var $cli_summary= "Manage users fax account";
-  var $cli_description= "Some longer text\nfor help";
-  var $cli_parameters= array("eins" => "Eins ist toll", "zwei" => "Zwei ist noch besser");
-
-
   /* Department list shown in the divSelectList*/
   var $departments;
 
   /* Fax attributes */
-  var $goFaxDeliveryMode= "";
+  var $goFaxDeliveryMode= "0";
   var $facsimileTelephoneNumber= "";
   var $goFaxIsEnabled= 1;
   var $goFaxPrinter= "";
@@ -100,12 +94,19 @@ class gofaxAccount extends plugin
           "regex"           => "");
       register_global("faxfilter", $faxfilter);
     }
+    $this->ui = get_userinfo();
   }
 
   function execute()
   {
     /* Call parent execute */
     plugin::execute();
+
+
+    $acl= get_permissions ($this->ui->dn, $this->ui->subtreeACL);
+    $editacl= get_module_permission($acl, "gofax", $this->dn);
+    $this->acl = $editacl;
+
     /* Hickert : 11.11.05
      * Added to be able to handle department selection in divSelelect
      */
@@ -136,7 +137,13 @@ class gofaxAccount extends plugin
 
     /* Do we need to flip is_account state? */
     if (isset($_POST['modify_state'])){
-      $this->is_account= !$this->is_account;
+
+      /* Onyl change account state if allowed */
+      if($this->is_account && $this->acl == "#all#"){
+        $this->is_account= !$this->is_account;
+      }elseif(!$this->is_account && chkacl($this->acl,"create") == ""){
+        $this->is_account= !$this->is_account;
+      }
     }
 
     /* Do we represent a valid account? */
@@ -565,7 +572,8 @@ class gofaxAccount extends plugin
 
 
     /* Show main page */
-    $smarty->assign("languages", $this->config->data['MAIN']['LANGUAGES']);
+    $smarty->assign("languages", get_languages(TRUE));
+
     $smarty->assign("formats", $this->config->data['MAIN']['FAXFORMATS']);
     $smarty->assign("printers", $this->printerList);