Code

Fixed shareserver list
authorhickert <hickert@594d385d-05f5-0310-b6e9-bd551577e9d8>
Fri, 26 Aug 2005 11:37:47 +0000 (11:37 +0000)
committerhickert <hickert@594d385d-05f5-0310-b6e9-bd551577e9d8>
Fri, 26 Aug 2005 11:37:47 +0000 (11:37 +0000)
git-svn-id: https://oss.gonicus.de/repositories/gosa/trunk@1230 594d385d-05f5-0310-b6e9-bd551577e9d8

plugins/personal/environment/class_environment.inc
plugins/personal/environment/class_kioskManagementDialog.inc

index cd023e8504603777245df01a028b5f533e5f202f..248595e9b77d5b4993c87fb76fd47575bf487bd7 100644 (file)
@@ -244,7 +244,7 @@ class environment extends plugin
     }
 
     $this->gotoXResolutions = array("640x480","800x600","1024x768","1280x768","1280x1024");
-    $this->gotoProfileServers = array("none","none1");
+    $this->gotoProfileServers =$this->getShareServerList() ;
 
     $smarty->assign("gotoXResolutions",$this->gotoXResolutions);
     $smarty->assign("gotoProfileServers",$this->gotoProfileServers);
@@ -802,22 +802,38 @@ class environment extends plugin
     $a_res = $ldap->search("(objectClass=goShareServer)",array("goExportEntry"));
     $return= array();
     while($entry = $ldap->fetch($a_res)){
-      $shareAttrs = split("\|",$entry['goExportEntry'][0]);
-      if($listboxEntry) { 
-        $return[$shareAttrs[0]] = $shareAttrs[0]." - ".$shareAttrs[4];
-      }else{
-        $return[$shareAttrs[0]]['name']         = $shareAttrs[0]; 
-        $return[$shareAttrs[0]]['description']  = $shareAttrs[1]; 
-        $return[$shareAttrs[0]]['type']         = $shareAttrs[2]; 
-        $return[$shareAttrs[0]]['charset']      = $shareAttrs[3]; 
-        $return[$shareAttrs[0]]['path']         = $shareAttrs[4]; 
-        $return[$shareAttrs[0]]['option']       = $shareAttrs[5]; 
+      unset($entry['goExportEntry']['count']);
+      foreach($entry['goExportEntry'] as $export){
+        $shareAttrs = split("\|",$export);
+        if($listboxEntry) { 
+          $return[$shareAttrs[0]] = $shareAttrs[0]." - ".$shareAttrs[4];
+        }else{
+          $return[$shareAttrs[0]]['name']         = $shareAttrs[0]; 
+          $return[$shareAttrs[0]]['description']  = $shareAttrs[1]; 
+          $return[$shareAttrs[0]]['type']         = $shareAttrs[2]; 
+          $return[$shareAttrs[0]]['charset']      = $shareAttrs[3]; 
+          $return[$shareAttrs[0]]['path']         = $shareAttrs[4]; 
+          $return[$shareAttrs[0]]['option']       = $shareAttrs[5]; 
+        }
       }
     }
     return($return);
   }
 
 
+/* This function returns all available ShareServer  
+ */
+  function getShareServerList()
+  {
+    $ldap= $this->config->get_ldap_link();
+    $a_res = $ldap->search("(objectClass=goShareServer)",array("goExportEntry","cn"));
+    $return= array();
+    while($entry = $ldap->fetch($a_res)){
+      $return[$entry['cn'][0]] = $entry['cn'][0];
+    }
+    return($return);
+  }
+
 /* Generate ListBox frindly output for the defined shares 
  * Possibly Add or remove an attribute here, 
  */
index f7b5d86cae34ba478fcc33d2a2dd00bc4ac8fbde..4d2663f46cc042cd6d6d68937eae1915565e9ea2 100644 (file)
@@ -51,7 +51,7 @@ class kioskManagementDialog extends plugin
      * Delete selected file form $this->baseDir
      */
     if((isset($_POST['profileDel']))&&(isset($_POST['gotoKioskProfile']))){
-      $filename = $this->baseDir.$_POST['gotoKioskProfile'];
+      $filename = $this->baseDir."/".$_POST['gotoKioskProfile'];
   
       $res = @unlink($filename);
       if(!$res){