Code

Updated dns service template and ACL checks ..
authorhickert <hickert@594d385d-05f5-0310-b6e9-bd551577e9d8>
Mon, 22 Mar 2010 09:07:53 +0000 (09:07 +0000)
committerhickert <hickert@594d385d-05f5-0310-b6e9-bd551577e9d8>
Mon, 22 Mar 2010 09:07:53 +0000 (09:07 +0000)
git-svn-id: https://oss.gonicus.de/repositories/gosa/trunk@16980 594d385d-05f5-0310-b6e9-bd551577e9d8

gosa-plugins/dns/admin/systems/services/dns/class_servDNS.inc
gosa-plugins/dns/admin/systems/services/dns/class_servDNSeditZone.inc
gosa-plugins/dns/admin/systems/services/dns/servDNSeditZoneEntries.tpl
gosa-plugins/dns/admin/systems/services/dns/servdns.tpl

index 6dc1ab6c6bacb3af87db2c0e4a44780df247a000..8591519a2c73fa16bd1e7e560388bac4af2a967b 100644 (file)
@@ -197,6 +197,7 @@ class servdns extends goService
                $this->dialog = new servdnseditZone($this->config,$this->dn);
                if($this->is_new){
                        $this->dialog->acl_base = $this->acl_base;
+                       $this->dialog->acl_category = $this->acl_category;
                }
        }
 
@@ -211,6 +212,8 @@ class servdns extends goService
         $once =true;
         $tmp = postDecode(preg_replace("/^editZone_/","",$name));
         $this->dialog= new servdnseditZone($this->config,$this->dn,$this->Zones[$tmp]);
+        $this->dialog->acl_base = $this->acl_base;
+        $this->dialog->acl_category = $this->acl_category;
       }
 
       /* check posts for delete zone 
@@ -229,7 +232,9 @@ class servdns extends goService
     if(isset($_GET['act']) && $_GET['act'] == "edit" && isset($_GET['id'])){
       $id = postDecode($_GET['id']);
       if(isset($this->Zones[$id])){
-         $this->dialog= new servdnseditZone($this->config,$this->dn,$this->Zones[$id]);
+        $this->dialog= new servdnseditZone($this->config,$this->dn,$this->Zones[$id]);
+        $this->dialog->acl_base = $this->acl_base;
+        $this->dialog->acl_category = $this->acl_category;
       }
     }
 
@@ -237,6 +242,8 @@ class servdns extends goService
       $id = postDecode($_GET['id']);
       if(isset($this->Zones[$id])){
          $this->dialog= new servdnseditZone($this->config,$this->dn,$this->Zones[$id]);
+         $this->dialog->acl_base = $this->acl_base;
+         $this->dialog->acl_category = $this->acl_category;
       }
     }
 
index 75024f308470711ff2e38e792bd4ffcd5c8c8e8c..29fad0544ddf741d1f2bda0ab7c11a00bf136a25 100644 (file)
@@ -620,6 +620,13 @@ class servdnseditZone extends plugin
   }
 
 
+  function acl_is_writeable($attribute,$skip_write = FALSE)
+  {
+    if($this->read_only) return(FALSE);
+    $ui= get_userinfo();
+    return preg_match('/w/', $ui->get_permissions($this->acl_base, $this->acl_category."servdns", $attribute,      $skip_write));
+  }
+
 }
 // vim:tabstop=2:expandtab:shiftwidth=2:filetype=php:syntax:ruler:
 ?>
index 9245db24ca52be6de0e6091ece9ca7118717a70b..800d9b382180d1c3783f710ea53e706b4f9dd4b4 100644 (file)
@@ -1,35 +1,29 @@
-<h3>{t}This dialog allows you to configure all components of this DNS zone on a single list.{/t}</h3>
-<hr>
-{if $disableDialog}
-       <br><b>
-       {t}This dialog can't be used until the currently edited zone was saved or the zone entry exists in the ldap database.{/t}
-       </b>
-{else}
-       <br>
-       {$table}
-       <br>
 
-       {render acl=$acl}
-       <button type='submit' name='UserRecord' title="{t}Create a new DNS zone entry{/t}">{t}New entry{/t}</button>
+<h3>{t}This dialog allows you to configure all components of this DNS zone on a single list.{/t}
+</h3>
+<hr>
 
-       {/render}
+{if $disableDialog}
+ <br>
+ <b>{t}This dialog can't be used until the currently edited zone was saved or the zone entry exists in the ldap database.{/t}</b>
+ {else}
+ <br>
+ {$table}
+ <br>
+ {render acl=$acl}
+  <button type='submit' name='UserRecord' title="{t}Create a new DNS zone entry{/t}">{t}New entry{/t}</button>
+ {/render}
 {/if}
-
 <hr>
 <div style="text-algin:right;" align="right">
   <p>
-       {render acl=$acl}
-        <button type='submit' name='SaveZoneEntryChanges'>{msgPool type=saveButton}</button>
-
-       {/render}
-        <button type='submit' name='CancelZoneEntryChanges'>{msgPool type=cancelButton}</button>
-
   </p>
+ <p>
+  {render acl=$acl}
+   <button type='submit' name='SaveZoneEntryChanges'>
+   {msgPool type=saveButton}</button>
+  {/render}
+  <button type='submit' name='CancelZoneEntryChanges'>
+  {msgPool type=cancelButton}</button>
+ </p>
 </div>
-
-<script language="JavaScript" type="text/javascript">
-  <!-- // First input field on page
-       focus_field('zoneName');
-  -->
-</script>
-                                                                            
+<script language="JavaScript" type="text/javascript"><!-- // First input field on page focus_field('zoneName');  --></script>
\ No newline at end of file
index 7d3aa99776dfcdd5a28c18f981972e57f256745b..80e2dbf498221673511e89023a95dbd06577a69b 100644 (file)
@@ -13,8 +13,7 @@
      <button type='submit' name='cancel_take_over'>
      {msgPool type=cancelButton}</button>
     </p>
-    <p>
-     {t}Following objects will be taken over{/t}&nbsp;:
+    <p>{t}Following objects will be taken over{/t}&nbsp;:
     </p>
     <p>
      <pre>
      <button type='submit' name='take_over'>{t}Take over{/t}</button>
     </td>
    </tr>
+   
   {/if}
-
   <tr>
    <td style='width:100%;'>
-    <h3>{t}Zones{/t}</h3>
+    <h3>{t}Zones{/t}
+    </h3>
     {$ZoneList}
+    
     {if $is_createable}
-     <button type='submit' name='AddZone'>{msgPool type=addButton}</button>
+     <button type='submit' name='AddZone'>
+     {msgPool type=addButton}</button>
      {else}
-     <input type="button" value="{msgPool type=addButton}" disabled>
+     <input type="button" value="
+     {msgPool type=addButton}" disabled>
+     
     {/if}
    </td>
   </tr>
  </table>
-
- <script language="JavaScript" type="text/javascript">
-  <!-- // First input field on page   
-   focus_field('AddZone');  
-  -->
- </script>
+ <script language="JavaScript" type="text/javascript"><!-- // First input field on page      focus_field('AddZone');    --></script>
  
 {/if}
-
 <hr>
 <div class="plugin-actions">
- <button type='submit' name='SaveService'>{msgPool type=saveButton}</button>
- <button type='submit' name='CancelService'>{msgPool type=cancelButton}</button>
-</div>
+ <button type='submit' name='SaveService'>
+ {msgPool type=saveButton}</button>
+ <button type='submit' name='CancelService'>
+ {msgPool type=cancelButton}</button>
+</div>
\ No newline at end of file