Code

Updated enviroment.
authorhickert <hickert@594d385d-05f5-0310-b6e9-bd551577e9d8>
Tue, 1 Jul 2008 13:30:32 +0000 (13:30 +0000)
committerhickert <hickert@594d385d-05f5-0310-b6e9-bd551577e9d8>
Tue, 1 Jul 2008 13:30:32 +0000 (13:30 +0000)
-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

gosa-plugins/goto/personal/environment/class_environment.inc

index 21ecc93f1c30e79d147cb8f5ffebc383bf37ab4a..a19bb719f9654600ca2e5c2cbe60a92ee93a0ee2 100644 (file)
@@ -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;