Code

hide fields that cant be edited /Databases/services
authorhickert <hickert@594d385d-05f5-0310-b6e9-bd551577e9d8>
Fri, 20 May 2005 11:31:41 +0000 (11:31 +0000)
committerhickert <hickert@594d385d-05f5-0310-b6e9-bd551577e9d8>
Fri, 20 May 2005 11:31:41 +0000 (11:31 +0000)
git-svn-id: https://oss.gonicus.de/repositories/gosa/trunk@277 594d385d-05f5-0310-b6e9-bd551577e9d8

plugins/admin/systems/class_servDB.inc
plugins/admin/systems/class_servKolab.inc
plugins/admin/systems/class_servService.inc
plugins/admin/systems/servservice.tpl

index 254f905972ed0fc33c160b9899c29da1e4373487..7a35f41db24fe33c231f1141411884aea1aebc2a 100644 (file)
@@ -79,7 +79,7 @@ class servdb extends plugin
         
       } else {
         $smarty->assign("$oc", "");
-        $smarty->assign("$oc"."ACL", "");
+        $smarty->assign("$oc"."ACL", chkacl($this->acl, $oc));
         $smarty->assign("$oc"."State", "disabled");
       }
     }
@@ -200,6 +200,7 @@ class servdb extends plugin
     $this->attrs = array_reverse($this->attrs);
 
 
+
     /* Write to LDAP */
     $ldap= $this->config->get_ldap_link();
     $ldap->cd($this->dn);
index fa46d5a03d91bd057fe7e74a81222da71554951b..43cdbd8dbb5b8bb534c3942dc35f920e6fcaf789 100644 (file)
@@ -199,12 +199,12 @@ class servkolab extends plugin {
 
    if(empty($this->postfix_mynetworks))
     { 
-      $message[] = _("SMTP privileged networks -> No value is given.");
+      ;//$message[] = _("SMTP privileged networks -> No value is given.");
     }
     
   if(empty($this->postfix_relayhost))
     {
-      $message[] = _("SMTP smarthost/relayhost -> No value is given.");
+      ;//$message[] = _("SMTP smarthost/relayhost -> No value is given.");
     }
 
 
index b596f22cb485a7bce37d282a3de479636afa2544..0af905aa2028bb0e7c67ddb4478e24034b82736a 100644 (file)
@@ -138,10 +138,7 @@ class servservice extends plugin
     foreach ($this->attributes as $attr){
       $smarty->assign("$attr", $this->$attr);
       $smarty->assign("$attr"."ACL", chkacl($this->acl, $attr));
-      if($this->$attr)
-        $smarty->assign($attr."State","");
-      else
-        $smarty->assign($attr."State","disabled");
+      $smarty->assign($attr."State","");
     }
 
 
@@ -154,7 +151,7 @@ foreach ($this->additionaloc as $oc => $dummy){
 
       } else {
         $smarty->assign("$oc", "");
-        $smarty->assign("$oc"."ACL", "");
+        $smarty->assign("$oc"."ACL", chkacl($this->acl, $oc));
         $smarty->assign("$oc"."State", "disabled");
       }
     }
@@ -237,9 +234,21 @@ foreach ($this->additionaloc as $oc => $dummy){
       }
     }
     $this->attrs = array_reverse($this->attrs);
+
+    /* Check if we are able to set these attributes */
+#fixme : It Would be better to check ObjectClass rights to, but what is to do if there are insuficient rights 
+    foreach($this->additionaloc as $oc => $attrs)
+    {
+      foreach($attrs as $val)
+      {
+      if(chkacl($this->acl,$val)=="")
+        {
+        unset($this->attrs[$val]);
+        unset($this->$val);
+        }
+      }
+    }
     
-//    print_a($this->attrs);
-     
     /* Write to LDAP */
     $ldap= $this->config->get_ldap_link();
     $ldap->cd($this->dn);
@@ -253,7 +262,6 @@ foreach ($this->additionaloc as $oc => $dummy){
     } else {
       $this->handle_post_events("add");
     }
-
   }
 
 }
index c938c2224d74086949ca7b91959a66a70976e5c0..69589164e59d4d99cfe1f8d6e7b5841b26182709 100644 (file)
    <table>
     <tr>
      <td>
-               <select style="width:350px;" id="goExportEntry" name="goExportEntry" {$goNfsServerState} size=4 multiple >
+               <select style="width:350px;" id="goExportEntry" name="goExportEntry" {$goExportEntryACL} size=4 multiple >
                {html_options values=$goExportEntry output=$goExportEntry}
            </select>
        <br>    
                <input type="text"              name="NewNfsExport" {$goNfsServerState} id="NewNfsExportId"> 
-               <input type="submit"    value="{t}Add{/t}"              name="NewNfsAdd"        {$goNfsServerState} id="NewNfsAddId"> 
-               <input type="submit"    value="{t}Delete{/t}"   name="DelNfsEnt"        {$goNfsServerState} id="DelNfsEntId">
+               <input type="submit"    value="{t}Add{/t}"              name="NewNfsAdd" {$goNfsServer} {$goExportEntryACL}     {$goNfsServerState} id="NewNfsAddId"> 
+               <input type="submit"    value="{t}Delete{/t}"   name="DelNfsEnt" {$goNfsServer} {$goExportEntryACL}     {$goNfsServerState} id="DelNfsEntId">
        </td>
        </tr>
    </table>
    <table>
     <tr>
      <td>
-        <select style="width:350px;" id="goTimeEntry" name="goTimeSource" {$goNtpServerState} size=4 multiple>
+        <select style="width:350px;" id="goTimeEntry" name="goTimeSource" {$goNtpServerState} {$goTimeSourceACL}  size=4 multiple>
             {html_options values=$goTimeSource output=$goTimeSource}
         </select>
     <br>
         <input type="text" name="NewNTPExport" {$goNtpServerState} id="NewNTPExportId">
-        <input type="submit"    value="{t}Add{/t}"      name="NewNTPAdd"    {$goNtpServerState} id="NewNTPAddId">
-        <input type="submit"    value="{t}Delete{/t}"   name="DelNTPEnt"    {$goNtpServerState} id="DelNTPEntId">
+        <input type="submit"    value="{t}Add{/t}"      name="NewNTPAdd"    {$goNtpServerState} {$goTimeSourceACL} id="NewNTPAddId">
+        <input type="submit"    value="{t}Delete{/t}"   name="DelNTPEnt"    {$goNtpServerState} {$goTimeSourceACL} id="DelNTPEntId">
     </td>
        </tr>
    </table>
@@ -58,7 +58,7 @@
 
      <b>{t}LDAP Service{/t}</b>
 
-               <input type="text"      value="{$goLdapBase}"         name="goLdapBase" {$goLdapServerState} id="goLdapBaseId">
+               <input type="text"      value="{$goLdapBase}"     {$goLdapBaseACL}    name="goLdapBase" {$goLdapServerState} id="goLdapBaseId">
 
        <p class="seperator">&nbsp;</p>
     <br>
   <table>
        <tr>
         <td colspan=2>
-         <input type="checkbox"  value="1" name="goXdmcpIsEnabled" {$goXdmcpIsEnabled}  {$goTerminalServerState} id="Temporariid"> {t}Temporary disable login{/t}</td>
+         <input type="checkbox"  value="1" name="goXdmcpIsEnabled" {$goXdmcpIsEnabled}  {$goTerminalServerState} {$goXdmcpIsEnabledACL} id="Temporariid"> {t}Temporary disable login{/t}</td>
     </tr>
     <tr>
         <td>{t}Font path{/t}</td>
-        <td> <input type="text"      value="{$goFontPath}"         name="goFontPath" {$goTerminalServerState} id="FontPathId"></td>
+        <td> <input type="text"      value="{$goFontPath}"         name="goFontPath" {$goTerminalServerState} {$goXdmcpIsEnabledACL}  id="FontPathId"></td>
        </tr>
    </table>