Code

Gray out environment share if we have insufficient acls
authorhickert <hickert@594d385d-05f5-0310-b6e9-bd551577e9d8>
Thu, 14 Dec 2006 11:32:17 +0000 (11:32 +0000)
committerhickert <hickert@594d385d-05f5-0310-b6e9-bd551577e9d8>
Thu, 14 Dec 2006 11:32:17 +0000 (11:32 +0000)
git-svn-id: https://oss.gonicus.de/repositories/gosa/branches/2.5@5394 594d385d-05f5-0310-b6e9-bd551577e9d8

plugins/personal/environment/class_environment.inc

index 57aa9f1391350b8590fa0d4cd75dad28eca5bf7a..2f55230ef965415fd09cb6a0170ed40ae0180145 100644 (file)
@@ -608,9 +608,17 @@ class environment extends plugin
     $divlistShares->SetHeight(100);
     $tmp = $this->printOutAssignedShares();
     
+    
     foreach($tmp as $key => $value){
       $img = "";
    
+      $hide       = false;    
+      $background = "";
+      if(chkacl($this->acl,"gotoShare") != ""){
+        $background = "background: #D0D0D0; ";
+        $hide = true;    
+      }
+
       /* Check if entry starts with an ! */
       if(preg_match("/^!/",$this->gotoShares[$key]['server'])){
 
@@ -618,12 +626,12 @@ class environment extends plugin
         if($this->is_group) continue;
     
         /* Create pwd reset images */
-        if($this->gotoShares[$key]['PwdHash'] != ""){
+        if($this->gotoShares[$key]['PwdHash'] != "" && !$hide){
           $img.= "<input type='image' name='gotoShareResetPwd_".base64_encode($key)." 'src='images/list_reset_password.png' alt='"._("Reset password hash")."' 
             title='"._("Reset password hash")."'>";
         }
-        $field1 = array("string" => "<font style=\"color:#C0C0C0\">".$value."</font>" );
-        $field2 = array("string" => $img   , "attach" => "style='border-right:0px;'");
+        $field1 = array("string" => "<font style=\"color:#C0C0C0\">".$value."</font>" , "attach" => "style='".$background."'");
+        $field2 = array("string" => $img   , "attach" => "style='".$background."border-right:0px;'");
       }else{
 
         /* Create pwd reset img && delete image */
@@ -632,10 +640,12 @@ class environment extends plugin
             title='"._("Reset password hash")."'>";
           $img.= "&nbsp;";
         }
+        if(!$hide){
         $img.= "<input type='image' name='gotoShareDel_".base64_encode($key)." 'src='images/edittrash.png' alt='"._("Delete")."' 
           title='"._("Delete share entry")."'>";
-        $field1 = array("string" => $value);
-        $field2 = array("string" => $img   , "attach" => "style='border-right:0px;'");
+        }
+        $field1 = array("string" => $value , "attach" => "style='".$background."'");
+        $field2 = array("string" => $img   , "attach" => "style='".$background."border-right:0px;'");
       }
       $divlistShares->AddEntry(array($field1,$field2));
     }