Code

Updated acls for terminalGeneric and network dns stuff
authorhickert <hickert@594d385d-05f5-0310-b6e9-bd551577e9d8>
Fri, 12 Jan 2007 04:12:26 +0000 (04:12 +0000)
committerhickert <hickert@594d385d-05f5-0310-b6e9-bd551577e9d8>
Fri, 12 Jan 2007 04:12:26 +0000 (04:12 +0000)
git-svn-id: https://oss.gonicus.de/repositories/gosa/branches/2.5@5542 594d385d-05f5-0310-b6e9-bd551577e9d8

plugins/admin/systems/class_termDNS.inc
plugins/admin/systems/class_terminalGeneric.inc
plugins/admin/systems/network.tpl

index a62eaaedaf2f0e13f81532cb3ef81f714a471946..4b2cd52b9b6048b2952324c9da1c8d947d960961 100644 (file)
@@ -153,6 +153,7 @@ class termDNS extends plugin
       /* Assign smarty all non DNs attributes */
       foreach($this->attributes as $attr){
         $smarty->assign($attr,$this->$attr);
+        $smarty->assign($attr."ACL",chkacl($this->acl,$attr));
       }
       $smarty->assign("staticAddress","<font class=\"must\">*</font>");
 
@@ -191,14 +192,18 @@ class termDNS extends plugin
     /* Assign smarty all non DNs attributes */
     foreach($this->attributes as $attr){
       $smarty->assign($attr,$this->$attr);
+      $smarty->assign($attr."ACL",chkacl($this->acl,$attr));
     }
 
     /* Assign smarty all DNS attributes */
     foreach($this->DNSattributes as $attr){
       $smarty->assign($attr,$this->dnsEntry[$attr]);
+      $smarty->assign($attr."ACL",chkacl($this->acl,$attr));
     }
     
     /* Assign all needed vars */
+    $smarty->assign("DNSaccountACL",chkacl($this->acl,"termDNS"));
+
     $smarty->assign("DNSAccount",$this->DNS_is_account);
     $smarty->assign("Zones",$this->Zones);
     $smarty->assign("ZoneKeys",($this->Zones));
@@ -236,15 +241,8 @@ class termDNS extends plugin
     /* Save all posted vars */
     plugin::save_object();
     
-    /* Ge all non dns attributes (IP/MAC)*/
-    foreach($this->attributes as $attr){
-      if(isset($_POST[$attr])){
-        $this->$attr = $_POST[$attr];
-      }
-    }
-
     /* Get dns attributes */
-    if(($this->DNSenabled) && (isset($_POST['network_tpl_posted']))){
+    if(($this->DNSenabled) && (isset($_POST['network_tpl_posted'])) && chkacl($this->acl,"termDNS") == ""){
 
       /* Check for posted record changes */
       if(is_array($this->dnsEntry['RECORDS'])){
@@ -424,6 +422,7 @@ class termDNS extends plugin
 
       /* Add || Update new DNS entries 
        */
+      print_a($tmp);
       foreach($tmp['add'] as $dn => $attrs){
         $ldap->cd($dn);
         $ldap->cat($dn, array('dn'));
index 7a12d4ef91850ea358a49027ec11c368992167cc..cb446b8792d3873e996c9e2242871072d9a3f1c5 100644 (file)
@@ -131,13 +131,14 @@ class termgeneric extends plugin
     /* Call parent execute */
     plugin::execute();
 
+    $this->netConfigDNS->acl = $this->acl;
+
     /* Do we need to flip is_account state? */
     if (isset($_POST['modify_state'])){
       $this->is_account= !$this->is_account;
     }
 
-    if (isset($_POST['action'])){
-
+    if (isset($_POST['action']) && chkacl($this->acl,"FAIstate") ==""){
 
       if($this->fai_activated && $this->dn != "new"){
         /* Set FAIstate */
@@ -212,7 +213,7 @@ class termgeneric extends plugin
     /* Base select dialog */
     $once = true;
     foreach($_POST as $name => $value){
-      if(preg_match("/^chooseBase/",$name) && $once){
+      if(preg_match("/^chooseBase/",$name) && $once && chkacl($this->acl,"base") == ""){
         $once = false;
         $this->dialog = new baseSelectDialog($this->config);
         $this->dialog->setCurrentBase($this->base);
@@ -242,12 +243,12 @@ class termgeneric extends plugin
     }
 
     /* Add new ntp Server to our list */
-    if((isset($_POST['addNtpServer'])) && (isset($_POST['gotoNtpServers']))){
+    if((isset($_POST['addNtpServer'])) && (isset($_POST['gotoNtpServers'])) && chkacl($this->acl,"gotoNtpServer")== ""){
       $this->gotoNtpServer[$_POST['gotoNtpServers']] = $_POST['gotoNtpServers'];
     }
 
     /* Delete selected NtpServer for list of used servers  */
-    if((isset($_POST['delNtpServer'])) && (isset($_POST['gotoNtpServerSelected']))){
+    if((isset($_POST['delNtpServer'])) && (isset($_POST['gotoNtpServerSelected'])) && chkacl($this->acl,"gotoNtpServer")== ""){
       foreach($_POST['gotoNtpServerSelected'] as $name){
         unset($this->gotoNtpServer[$name]);
       } 
@@ -317,6 +318,7 @@ class termgeneric extends plugin
   function remove_from_parent()
   {
     
+    $this->netConfigDNS->acl = $this->acl;
     $ldap= $this->config->get_ldap_link();
     $ldap->cd($this->dn);
     $ldap->cat($this->dn, array('dn'));
@@ -428,6 +430,7 @@ class termgeneric extends plugin
   /* Save to LDAP */
   function save()
   {
+    $this->netConfigDNS->acl = $this->acl;
 
     /* Move object if requested */
     if( $this->orig_dn != 'new' && $this->dn != $this->orig_dn){
index dcb3d45210490e3a04ec8090dd85a58e1dc3bb61..f3b68830ce6063e1b3774d68558de663e0d6e985 100644 (file)
@@ -7,23 +7,24 @@
                        <table  summary="">
                                <tr>
                                        <td><LABEL      for="ipHostNumber">{t}IP-address{/t}{if $IPisMust}{$staticAddress}{/if}</LABEL></td>
-                                       <td><input      id="ipHostNumber"       name="ipHostNumber"     size=25 maxlength=80    value="{$ipHostNumber}"></td>
+                                       <td><input      id="ipHostNumber"       name="ipHostNumber"     size=25 maxlength=80    value="{$ipHostNumber}" {$ipHostNumberACL}></td>
                                </tr>
                                <tr>
                                        <td><LABEL      for="macAddress">{t}MAC-address{/t}</LABEL>{$staticAddress}</td>
-                                       <td><input      name="macAddress"       id="macAddress" size=25 maxlength=80    value="{$macAddress}"></td>
+                                       <td><input      name="macAddress"       id="macAddress" size=25 maxlength=80    value="{$macAddress}" {$macAddressACL}></td>
                                </tr>
         {if $autonet==true}
                                <tr>
                                        <td>&nbsp;</td>
-                                       <td><input type="submit" name="autonet" value="{t}Autodetect{/t}"></td>
+                                       <td><input type="submit" name="autonet" value="{t}Autodetect{/t}" 
+            {if ($ipHostNumberACL !="" || $macAddressACL!= "")} disabled {/if}></td>
                                </tr>
         {/if}
       </table> 
     </td>
     {if $DNS_is_account==true}
                <td     style="width:50%;vertical-align:top;border-left:1px solid #b0b0b0;" valign="top">
-      <input type="checkbox" name="enableDNS" value="1" 
+      <input type="checkbox" name="enableDNS" value="1" {$DNSaccountACL} 
         {if $DNSAccount == true}checked="checked"
         onclick="toggle('test2');
           changeState('zoneName');
@@ -39,7 +40,7 @@
       "/>
         {/if}
       {t}Enable DNS for this device{/t}
-      <input type="submit" name="reloadThisDNSStuff" value="{t}Refresh{/t}"/>
+      <input type="submit" name="reloadThisDNSStuff" value="{t}Refresh{/t}" {$DNSaccountACL}/>
       {if $DNSAccount == true}
       <div style="padding-left:20px;visibility:visible;" id="test2">
       {else}
                                <tr>
                                        <td><LABEL      for="zoneName">{t}Zone{/t}</LABEL></td>
                                        <td>
-              <select name="zoneName" id="zoneName" {if $DNSAccount == false} disabled='disabled' {/if}>
+              <select name="zoneName" id="zoneName" {if $DNSAccount == false} disabled='disabled' {/if}  {$zoneNameACL}>
                 {html_options values=$ZoneKeys output=$Zones selected=$zoneName}
               </select>
           </td>
                                </tr>
                                <tr>
           <td>{t}TTL{/t}</td>
-          <td><input type="text" name="dNSTTL" value="{$dNSTTL}" id="dNSTTL" {if $DNSAccount == false} disabled='disabled' {/if}>
+          <td><input type="text" name="dNSTTL" value="{$dNSTTL}" id="dNSTTL" {if $DNSAccount == false} disabled='disabled' {/if} {$dNSTTLACL}>
           </td> 
                                </tr>
                                <tr>