From 5ad7d1d4e53d916f9b6312eef95e46084e8f2986 Mon Sep 17 00:00:00 2001 From: hickert Date: Tue, 1 Jul 2008 13:30:32 +0000 Subject: [PATCH] Updated enviroment. -Only display Shares we are allowed to view. -If a share is selected which we are not allowed to view, then display it, so we will ensure that it stays selected after saving. git-svn-id: https://oss.gonicus.de/repositories/gosa/trunk@11499 594d385d-05f5-0310-b6e9-bd551577e9d8 --- .../environment/class_environment.inc | 21 +++++++++++-------- 1 file changed, 12 insertions(+), 9 deletions(-) diff --git a/gosa-plugins/goto/personal/environment/class_environment.inc b/gosa-plugins/goto/personal/environment/class_environment.inc index 21ecc93f1..a19bb719f 100644 --- a/gosa-plugins/goto/personal/environment/class_environment.inc +++ b/gosa-plugins/goto/personal/environment/class_environment.inc @@ -263,6 +263,9 @@ class environment extends plugin function update_kiosk_profiles() { + $this->gotoKioskProfile_Server = preg_replace("/^.*:\/\/([^\/]*).*$/","\\1",$this->gotoKioskProfile); + $this->gotoKioskProfile_Profile= preg_replace("/^.*\//","",$this->gotoKioskProfile); + $tmp1 = array("none" => array(_("disabled"))); $tmp2 = array("none" => _("disabled")); $tmp3 = array(); @@ -270,15 +273,18 @@ class environment extends plugin $ldap->cd($this->config->current['BASE']); $ldap->search("(&(objectClass=goEnvironmentServer)(gotoKioskProfile=*)(cn=*))",array("cn","gotoKioskProfile")); $cnt = 0; + $ui = get_userinfo(); while($attrs = $ldap->fetch()){ + $acl = $ui->get_permissions($attrs['dn'],"server/goShareServer",""); for($i = 0 ; $i < $attrs['gotoKioskProfile']['count'] ; $i ++){ - $name = preg_replace("/^.*\//","",$attrs['gotoKioskProfile'][$i]); - $name = preg_replace("/^.*\//","",$attrs['gotoKioskProfile'][$i]); - $tmp1[$attrs['cn'][0]][] = $name; - $tmp3[$attrs['cn'][0]][$name] = $attrs['gotoKioskProfile'][$i]; + if(preg_match("/r/",$acl) || $this->gotoKioskProfile_Server == $attrs['cn'][0]){ + $name = preg_replace("/^.*\//","",$attrs['gotoKioskProfile'][$i]); + $tmp1[$attrs['cn'][0]][] = $name; + $tmp3[$attrs['cn'][0]][$name] = $attrs['gotoKioskProfile'][$i]; + $tmp2[$attrs['cn'][0]]= $attrs['cn'][0]; + $cnt ++; + } } - $tmp2[$attrs['cn'][0]]= $attrs['cn'][0]; - $cnt ++; } if($cnt && $this->config->search("environment","kioskpath",array('menu','tabs'))){ @@ -289,9 +295,6 @@ class environment extends plugin $this->gotoKioskProfiles['SERVERS'] = $tmp2; $this->gotoKioskProfiles['MAP'] = $tmp3; - $this->gotoKioskProfile_Server = preg_replace("/^.*:\/\/([^\/]*).*$/","\\1",$this->gotoKioskProfile); - $this->gotoKioskProfile_Profile= preg_replace("/^.*\//","",$this->gotoKioskProfile); - $error = false; if(!isset($this->gotoKioskProfiles['SERVERS'][$this->gotoKioskProfile_Server])){ $error = true; -- 2.30.2