From: hickert Date: Tue, 1 Jul 2008 13:30:32 +0000 (+0000) Subject: Updated enviroment. X-Git-Url: https://git.tokkee.org/?a=commitdiff_plain;h=5ad7d1d4e53d916f9b6312eef95e46084e8f2986;p=gosa.git 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 --- 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;