Code

Implemented new acls methods
authorhickert <hickert@594d385d-05f5-0310-b6e9-bd551577e9d8>
Fri, 21 Jul 2006 06:21:39 +0000 (06:21 +0000)
committerhickert <hickert@594d385d-05f5-0310-b6e9-bd551577e9d8>
Fri, 21 Jul 2006 06:21:39 +0000 (06:21 +0000)
git-svn-id: https://oss.gonicus.de/repositories/gosa/trunk@4269 594d385d-05f5-0310-b6e9-bd551577e9d8

plugins/personal/environment/class_environment.inc
plugins/personal/environment/environment.tpl

index 16e1c71575d83c28ad721232c19225cc20121760..547b6dd32721b738ca4307ce70b8bbf4f7e465b4 100644 (file)
@@ -257,12 +257,7 @@ class environment extends plugin
     }
 
     /* Prepare ACL settings*/
-    if(chkacl($this->acl,$s_attr)=="") {
-      $smarty->assign($s_attr."ACL","");
-    }else{
-      $smarty->assign($s_attr."ACL"," disabled ");
-    }
-
+    $smarty->assign($s_attr."ACL",$this->getacl($s_attr));
   }
 
   /* Is accout enabled | are we editing from usermenu or admin menu 
@@ -373,42 +368,25 @@ class environment extends plugin
       }
     
       /* Prepare ACL settings*/
-      if(chkacl($this->acl,$s_attr)=="") {
-        $smarty->assign($s_attr."ACL","");
-      }else{
-        $smarty->assign($s_attr."ACL"," disabled ");
-      }
+      $smarty->assign($s_attr."ACL",$this->getacl($s_attr));
  
     }
 
-    foreach(array("gotoHotplugDevice","gotoPrinterSel") as $s_attr){
-      if(chkacl($this->acl,$s_attr)=="") {
-        $smarty->assign($s_attr."ACL","");
-      }else{
-        $smarty->assign($s_attr."ACL"," disabled ");
-      }
+    foreach(array("gotoHotplugDevice","gotoProfileFlagC","gotoProfileFlagL") as $s_attr){
+      $smarty->assign($s_attr."ACL",$this->getacl($s_attr));
     }
 
     if(empty($this->useProfile)){
-      $smarty->assign("gotoProfileACL","disabled");
       $smarty->assign("useProfileCHK","");
+      $smarty->assign("gotoProfileServerACL" , preg_replace("/w/","",$this->getacl("gotoProfileServer")));
+      $smarty->assign("gotoProfileQuotaACL" , preg_replace("/w/","",$this->getacl("gotoProfileQuota")));
+      $smarty->assign("gotoProfileFlagCACL" , preg_replace("/w/","",$this->getacl("gotoProfileFlagC")));
     }else{
-      $smarty->assign("gotoProfileACL","");
       $smarty->assign("useProfileCHK"," checked ");
     }
-
-    $smarty->assign("useProfileACL","");
-    if($this->acl != "#none#"){
-      $smarty->assign("useProfileACL","");
-      $smarty->assign("gotoProfileFlagCACL"," ");
-      $smarty->assign("gotoProfileQuotaACL"," ");
-    }else{
-      $smarty->assign("gotoProfileFlagCACL"," disabled ");
-      $smarty->assign("useProfileACL","disabled");
-      $smarty->assign("gotoProfileServer"," disabled ");
-      $smarty->assign("gotoProfileQuotaACL"," disabled ");
-    }
+   
+     
+    $smarty->assign("gotoProfileACL", $this->getacl("gotoProfileServer").$this->getacl("gotoProfileQuota"));
 
     /* HANDLE Profile Settings here 
      * Assign available Quota and resolution settings
@@ -789,19 +767,6 @@ class environment extends plugin
       }
       return($disp);
     }
-    if($this->acl != "#none#"){
-      $smarty->assign("useProfileACL","");
-    }else{
-      $smarty->assign("gotoProfileFlagCACL"," disabled ");
-      $smarty->assign("gotoProfileServerACL"," disabled ");
-      $smarty->assign("gotoProfileQuotaACL"," disabled ");
-    }
-
-    if(!$this->useProfile){
-      $smarty->assign("gotoProfileFlagCACL"," disabled ");
-      $smarty->assign("gotoProfileServerACL"," disabled ");
-      $smarty->assign("gotoProfileQuotaACL"," disabled ");
-    }
 
     /* Als smarty vars are set. Get smarty template and generate output */
     $display.= $smarty->fetch(get_template_path('environment.tpl', TRUE,dirname(__FILE__)));
@@ -951,12 +916,6 @@ class environment extends plugin
       }
     }
 
-
-    /* Save usersettings to Printer */
-    if(chkacl($this->acl,"gotoPrinter")!=""){
-      $this->gotoPrinter = array();
-    }  
-    
     /* 1. Search all printers that have our uid/cn as member 
      * 2. Delete this uid/cn from every single entry and save it again.
      * 2.1 There are different types of members: Users / Groups, this will be defined in $suffix
@@ -1056,14 +1015,6 @@ class environment extends plugin
       $this->attrs['gotoProfileServer']= array(); 
     }
 
-    foreach($this->attributes as $s_attr){
-      if(chkacl($this->acl,$s_attr)!="") {
-        if(isset($this->attrs[$s_attr])){
-          unset($this->attrs[$s_attr]);
-        }
-      }
-    }
-
     $ldap->cat ($this->dn, array('dn'));
     if ($ldap->fetch()){
       $mode= "modify";
index 1f7f926ba98e5d0e2784a10315d5c6bb4b992a74..ed4e32a9c99232520b29b83ffe792a25d863136b 100644 (file)
@@ -17,7 +17,7 @@
    <table summary="{t}Profile managment{/t}">
     <tr>
      <td style="vertical-align:top">
-{render acl=$ProfileACL}
+{render acl=$gotoProfileACL}
       <input class="center" type="checkbox" value="1" {$useProfileCHK} name="useProfile" id="useProfile"
        onclick="changeState('gotoProfileServer');changeState('gotoProfileFlagC');changeState('gotoProfileQuota');">
 {/render}
@@ -36,7 +36,7 @@
          <label for="gotoProfileServer">{t}Profil path{/t}</label>
         </td>
         <td>
-{render acl=$ProfileACL}
+{render acl=$gotoProfileServerACL}
          <select id="gotoProfileServer" name="gotoProfileServer">
           {html_options values=$gotoProfileServerKeys output=$gotoProfileServers selected=$gotoProfileServer}
           <option disabled>&nbsp;</option>
@@ -51,7 +51,7 @@
          <br>
         </td>
         <td>
-{render acl=$ProfileACL}
+{render acl=$gotoProfileQuotaACL}
          <input type="text" name="gotoProfileQuota" value="{$gotoProfileQuota}" size="6" id="gotoProfileQuota">{t}MB{/t}
 {/render}
          <br>
@@ -61,7 +61,7 @@
        <tr>
         <td colspan=2> 
 {render acl=$gotoProfileFlagCACL}
-         <input class="center" type="checkbox" name="gotoProfileFlagC" value="C" {$gotoProfileFlagCCHK id="gotoProfileFlagC"}>&nbsp;
+         <input class="center" type="checkbox" name="gotoProfileFlagC" value="C" {$gotoProfileFlagCCHK} id="gotoProfileFlagC">&nbsp;
 {/render}
          <label for="gotoProfileFlagC">{t}Cache profile localy{/t}</label>
         </td>