From e8ef1fa135d7069b7c28a04feab7bd8a21dba11a Mon Sep 17 00:00:00 2001 From: hickert Date: Thu, 10 Nov 2005 11:43:49 +0000 Subject: [PATCH] Fixed KioslProfile handling, git-svn-id: https://oss.gonicus.de/repositories/gosa/trunk@1905 594d385d-05f5-0310-b6e9-bd551577e9d8 --- .../environment/class_environment.inc | 13 ++++++++++-- .../class_kioskManagementDialog.inc | 21 +++---------------- 2 files changed, 14 insertions(+), 20 deletions(-) diff --git a/plugins/personal/environment/class_environment.inc b/plugins/personal/environment/class_environment.inc index 1418d54d7..8aceb1830 100644 --- a/plugins/personal/environment/class_environment.inc +++ b/plugins/personal/environment/class_environment.inc @@ -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)){ diff --git a/plugins/personal/environment/class_kioskManagementDialog.inc b/plugins/personal/environment/class_kioskManagementDialog.inc index 947e662bc..c5490911f 100644 --- a/plugins/personal/environment/class_kioskManagementDialog.inc +++ b/plugins/personal/environment/class_kioskManagementDialog.inc @@ -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']; } } -- 2.30.2