From d2af48f168b3ec2da7dddf1e5f93c245ca5fe61e Mon Sep 17 00:00:00 2001 From: hickert Date: Thu, 1 Jun 2006 08:09:21 +0000 Subject: [PATCH] Added ! entries to list of shares. If we are not in group environemnt. ... git-svn-id: https://oss.gonicus.de/repositories/gosa/trunk@3600 594d385d-05f5-0310-b6e9-bd551577e9d8 --- .../environment/class_environment.inc | 39 ++++++++++++------- 1 file changed, 26 insertions(+), 13 deletions(-) diff --git a/plugins/personal/environment/class_environment.inc b/plugins/personal/environment/class_environment.inc index 60eb816b9..4c87bf17c 100644 --- a/plugins/personal/environment/class_environment.inc +++ b/plugins/personal/environment/class_environment.inc @@ -578,19 +578,34 @@ class environment extends plugin $tmp = $this->printOutAssignedShares(); foreach($tmp as $key => $value){ - $img = ""; + + /* Check if entry starts with an ! */ + if(preg_match("/^!/",$this->gotoShares[$key]['server'])){ - if($this->gotoShares[$key]['PwdHash'] != ""){ - $img.= ""; - } - $img.= " "; - $img.= ""; + /* If we are currently editing groups environment, skip those ! entries */ + if($this->is_group) continue; + + /* Create pwd reset images */ + if($this->gotoShares[$key]['PwdHash'] != ""){ + $img.= ""; + } + $field1 = array("string" => "".$value."" ); + $field2 = array("string" => $img , "attach" => "style='border-right:0px;'"); + }else{ - $field1 = array("string" => $value); - $field2 = array("string" => $img , "attach" => "style='border-right:0px;'"); + /* Create pwd reset img && delete image */ + if($this->gotoShares[$key]['PwdHash'] != ""){ + $img.= ""; + $img.= " "; + } + $img.= ""; + $field1 = array("string" => $value); + $field2 = array("string" => $img , "attach" => "style='border-right:0px;'"); + } $divlistShares->AddEntry(array($field1,$field2)); } $smarty->assign("divlistShares",$divlistShares->DrawList()); @@ -1131,9 +1146,7 @@ $ldap->modify ($attrs); $a_return = array(); if(is_array($this->gotoShares)){ foreach($this->gotoShares as $share){ - if (!preg_match('/^!/', $share['server'])){ - $a_return[$share['name']."|".$share['server']]= $share['server']."://".$share['name']." on ".$share['mountPoint']." as ".$share['Username']; - } + $a_return[$share['name']."|".$share['server']]= preg_replace("/^!/","",$share['server'])."://".$share['name']." on ".$share['mountPoint']." as ".$share['Username']; } } return($a_return); -- 2.30.2