Code

Fixed KioslProfile handling,
authorhickert <hickert@594d385d-05f5-0310-b6e9-bd551577e9d8>
Thu, 10 Nov 2005 11:43:49 +0000 (11:43 +0000)
committerhickert <hickert@594d385d-05f5-0310-b6e9-bd551577e9d8>
Thu, 10 Nov 2005 11:43:49 +0000 (11:43 +0000)
git-svn-id: https://oss.gonicus.de/repositories/gosa/trunk@1905 594d385d-05f5-0310-b6e9-bd551577e9d8

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

index 1418d54d719b6d3bcdae12a53c5113ea3e2f947c..8aceb183006e972dd3cc95b96abe4b089631b8ac 100644 (file)
@@ -83,6 +83,8 @@ class environment extends plugin
       $suffix="User";
     }
 
+    $this->gotoKioskProfile= preg_replace("/^.*\//i","",$this->gotoKioskProfile);
+
     /* Get all Printer assignments */
     $ldap = $this->config->get_ldap_link();
     $ldap->cd($this->config->current['BASE']);
@@ -930,12 +932,19 @@ class environment extends plugin
     }
 
     if(!empty($this->gotoKioskProfile)){
-      $this->attrs['gotoKioskProfile']= $this->gotoKioskProfile;
+      if(preg_match("/https/i",$_SERVER['HTTP_REFERER'])){
+        $method="https://";
+      }else{
+        $method="http://";
+      }
+
+      $str = $method.$_SERVER['SERVER_NAME']."/kiosk/";
+      $this->attrs['gotoKioskProfile']= $str.$this->gotoKioskProfile;
     }else{
       $this->attrs['gotoKioskProfile']= array();
     }
 
-    $saveThis = array("gotoKioskProfile","gotoProfileQuota","gotoXResolution","gotoProfileServer");
+    $saveThis = array("gotoProfileQuota","gotoXResolution","gotoProfileServer");
   
     foreach($saveThis as $tosave){
       if(!empty($this->$tosave)){
index 947e662bc81f796172d0171afa7d3ebf5f75c498..c5490911ffeaf3d36bea96ed647c22f659c1727a 100644 (file)
@@ -89,14 +89,6 @@ class kioskManagementDialog extends plugin
       return ($a_return);
     }
     
-    if(preg_match("/https/i",$_SERVER['HTTP_REFERER'])){
-      $method="https://";
-    }else{
-      $method="http://";
-    }
-
-    $str = $method.$_SERVER['SERVER_NAME']."/kiosk/";
-
     $dir = @opendir($this->baseDir);
     if(!$dir){
       print_red(sprintf(_("Kiosk path '%s' is not accessible. Please check the permissions."),$this->baseDir));
@@ -105,25 +97,18 @@ class kioskManagementDialog extends plugin
       while($file = readdir($dir)){
         if(!(($file==".")||($file==".."))){
           $name = $file;
-          $a_return[$str.$name] = $name;
+          $a_return[$name] = $name;
         }
       }
     }
-    
-    if(preg_match("/https/i",$_SERVER['HTTP_REFERER'])){
-      $method="https://";
-    }else{
-      $method="http://";
-    }
 
-    $str = $method.$_SERVER['SERVER_NAME']."/kiosk/";
     foreach($this->filesToAttach as $file){
-      $a_return[$str.$file['name']] = $file['name'];
+      $a_return[$file['name']] = $file['name'];
     }
 
     if($attach){
       foreach($attach as $file){
-        $a_return[$str.$file['name']] = $file['name'];
+        $a_return[$file['name']] = $file['name'];
       }
     }