From: hickert Date: Fri, 14 Dec 2007 08:37:44 +0000 (+0000) Subject: Fixed environment multiple edit X-Git-Url: https://git.tokkee.org/?a=commitdiff_plain;h=849827d387fb21cb85d0fcdda99c22d9b45ab535;p=gosa.git Fixed environment multiple edit git-svn-id: https://oss.gonicus.de/repositories/gosa/trunk@8124 594d385d-05f5-0310-b6e9-bd551577e9d8 --- diff --git a/gosa-core/include/class_multi_plug.inc b/gosa-core/include/class_multi_plug.inc index c96a0eda6..801e4a7be 100644 --- a/gosa-core/include/class_multi_plug.inc +++ b/gosa-core/include/class_multi_plug.inc @@ -162,17 +162,18 @@ class multi_plug }elseif(is_string($base[$key]) && $base[$key]!=$minus[$key]){ unset($base[$key]); }elseif(is_array($base[$key])){ + $tmp = array(); for($i = 0 ; $i < $base[$key]['count'] ; $i ++){ - if(isset($base[$key][$i]) && !in_array($base[$key][$i],$minus[$key])){ - $base[$key]['count'] --; - if($base[$key]['count'] == 0){ - unset($base[$key]); - break; - }else{ - unset($base[$key][$i]); - } + if(isset($base[$key][$i]) && in_array($base[$key][$i],$minus[$key])){ + $tmp[] = $base[$key][$i]; } } + if(count($tmp)){ + $tmp['count'] = count($tmp); + $base[$key] = $tmp; + }else{ + unset($base[$key]); + } } } return($base); diff --git a/gosa-core/include/class_plugin.inc b/gosa-core/include/class_plugin.inc index 9d4434090..458aa41e3 100644 --- a/gosa-core/include/class_plugin.inc +++ b/gosa-core/include/class_plugin.inc @@ -1706,7 +1706,9 @@ class plugin foreach ($this->attributes as $val){ $found= array_key_ics($val, $this->multi_attrs); if ($found != ""){ - $this->$val= $this->multi_attrs["$found"][0]; + if(isset($this->multi_attrs["$found"][0])){ + $this->$val= $this->multi_attrs["$found"][0]; + } } } } diff --git a/gosa-core/plugins/personal/environment/class_environment.inc b/gosa-core/plugins/personal/environment/class_environment.inc index 64f399457..25de2cb6d 100644 --- a/gosa-core/plugins/personal/environment/class_environment.inc +++ b/gosa-core/plugins/personal/environment/class_environment.inc @@ -1440,6 +1440,11 @@ class environment extends plugin $this->gotoShares[$name] = $share; } } + foreach($this->gotoShares as $name => $share){ + if(!isset($attrs['gotoShares'][$name])){ + unset($this->gotoShares[$name]); + } + } }