Code

Some fixes for gofax account
authorhickert <hickert@594d385d-05f5-0310-b6e9-bd551577e9d8>
Wed, 9 Aug 2006 04:55:20 +0000 (04:55 +0000)
committerhickert <hickert@594d385d-05f5-0310-b6e9-bd551577e9d8>
Wed, 9 Aug 2006 04:55:20 +0000 (04:55 +0000)
git-svn-id: https://oss.gonicus.de/repositories/gosa/trunk@4428 594d385d-05f5-0310-b6e9-bd551577e9d8

plugins/gofax/faxaccount/class_gofaxAccount.inc
plugins/gofax/faxaccount/generic.tpl
plugins/gofax/faxaccount/main.inc

index 5aa2b8bc282030d22270c80986fc195a35e6a03e..34e3fb729c152e733c3516f94304d52ff75f63a2 100644 (file)
@@ -58,7 +58,7 @@ class gofaxAccount extends plugin
 
     if ($dn != "new"){
       /* Get arrays */
-      foreach (array("goFaxRBlocklist", "goFaxRBlockgroups", "goFaxSBlocklist","facsimileTelephoneNumber",
+      foreach (array("goFaxRBlocklist", "goFaxRBlockgroups", "goFaxSBlocklist",
             "goFaxSBlockgroups", "facsimileAlternateTelephoneNumber") as $val){
         $this->$val =array();
         if (isset($this->attrs["$val"]["count"])){
index 93deffd4214ff97c55e31c4c99ac9d6a3c6ebdbb..01a5282891d4efb629282784fa8cd3444a05361a 100644 (file)
@@ -11,7 +11,7 @@
          <td>
 
 {render acl=$facsimileTelephoneNumberACL}
-           <input name="facsimileTelephoneNumber" id="facsimileTelephoneNumber" ze=20 maxlength=65
+           <input name="facsimileTelephoneNumber" id="facsimileTelephoneNumber" size=20 maxlength=65
                value="{$facsimileTelephoneNumber}" title="{t}Fax number for GOfax to trigger on{/t}">
 {/render}
 
index 1227dd74b236e6e537dbf4ab91e1aea64dbac424..ab20ed675da4c2a999e7800d42a0ece0199eeaa1 100644 (file)
@@ -13,6 +13,9 @@ if (!$remove_lock){
        /* Create gofaxAccount object on demand */
        if (!isset($_SESSION['gofaxAccount']) || (isset($_GET['reset']) && $_GET['reset'] == 1)){
                $_SESSION['gofaxAccount']= new gofaxAccount ($config, $ui->dn);
+               $_SESSION['gofaxAccount']->set_acl_base($ui->dn);
+               $_SESSION['gofaxAccount']->set_acl_category("users");
+
        }
        $gofaxAccount= $_SESSION['gofaxAccount'];
 
@@ -37,16 +40,6 @@ if (!$remove_lock){
                $_SESSION['edit']= TRUE;
        }
 
-       /* Adjust acl's to mode */
-       if (isset($_SESSION['edit'])){
-               $acl= get_permissions ($ui->dn, $ui->subtreeACL);
-               $gofaxAccount->acl= get_module_permission($acl, "gofax", $ui->dn);
-       } else {
-               $acl= get_permissions ($ui->dn, $ui->subtreeACL);
-               $editacl= get_module_permission($acl, "gofax", $ui->dn);
-               $gofaxAccount->acl= "#none#";
-       }
-
        /* save changes to LDAP and disable edit mode */
        if (isset($_POST['edit_finish'])){
 
@@ -57,7 +50,6 @@ if (!$remove_lock){
                 if (count ($message) == 0){
                         $gofaxAccount->save ();
                        gosa_log ("User/fax object'".$ui->dn."' has been saved");
-                        $gofaxAccount->acl= "#none#";
                         del_lock ($ui->dn);
                         sess_del ('edit');
 
@@ -92,7 +84,8 @@ if (!$remove_lock){
                        $info= "<img alt='' align=\"middle\" src=\"".get_template_path('images/closedlock.png')."\"> ".$ui->dn."&nbsp;";
                } else {
                        $info= "<img alt=\"\" align=\"middle\" src=\"".get_template_path('images/openlock.png')."\"> ".$ui->dn."&nbsp;";
-                       if (isset($editacl) && $editacl != "#none#"){
+
+                       if(preg_match("/w/",$ui->get_permissions($ui->dn,"users/gofaxAccount"))){
                                $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")."\">";
                        }