summary | shortlog | log | commit | commitdiff | tree
raw | patch | inline | side by side (parent: fb27f5f)
raw | patch | inline | side by side (parent: fb27f5f)
author | hickert <hickert@594d385d-05f5-0310-b6e9-bd551577e9d8> | |
Fri, 26 Aug 2005 10:44:52 +0000 (10:44 +0000) | ||
committer | hickert <hickert@594d385d-05f5-0310-b6e9-bd551577e9d8> | |
Fri, 26 Aug 2005 10:44:52 +0000 (10:44 +0000) |
git-svn-id: https://oss.gonicus.de/repositories/gosa/trunk@1228 594d385d-05f5-0310-b6e9-bd551577e9d8
plugins/personal/environment/class_kioskManagementDialog.inc | patch | blob | history |
diff --git a/plugins/personal/environment/class_kioskManagementDialog.inc b/plugins/personal/environment/class_kioskManagementDialog.inc
index 1061d3794205f4d6c25eac6af89046f817f78ebd..f7b5d86cae34ba478fcc33d2a2dd00bc4ac8fbde 100644 (file)
var $use_existing = false;
var $baseDir = "../kioskProfiles/";
- var $filePrefix = ".kioskProfile";
function kioskManagementDialog ($config, $dn= NULL,$use_existing=false )
{
$this->use_existing = $use_existing;
plugin::plugin ($config, $dn);
+ $this->baseDir = search_config($this->config->data['MENU'],"environment", "KIOSKPATH");
}
function execute()
$display= "";
/* Add new kiosk profile
- * Save the new Profile with filePrefix ($this->filePrefix)
* in profile directory ($this->baseDir);
*/
if((isset($_POST['profileAdd']))&&(isset($_FILES['newProfile']))){
$file = $_FILES['newProfile'];
if(!file_exists($this->baseDir.$file['name'])){
- $name = preg_replace("/\..*$/","",$file['name']).$this->filePrefix;
+ $name = $file['name'];
$str = file_get_contents($file['tmp_name']);
- $fp = @fopen($this->baseDir.$name,"w+");
+ $fp = @fopen($this->baseDir."/".$name,"w");
if($fp){
fwrite($fp,$str,strlen($str));
fclose($fp);
* Delete selected file form $this->baseDir
*/
if((isset($_POST['profileDel']))&&(isset($_POST['gotoKioskProfile']))){
- $filename = $this->baseDir.$_POST['gotoKioskProfile'].$this->filePrefix;
+ $filename = $this->baseDir.$_POST['gotoKioskProfile'];
$res = @unlink($filename);
if(!$res){
function getKioskProfiles()
{
+ $a_return = array();
$dir = @opendir($this->baseDir);
if(!$dir){
print_red(sprintf(_("Can't open %s permission denied."),$this->baseDir));
}else{
$a_return = array();
while($file = readdir($dir)){
- if(preg_match("/".$this->filePrefix."$/i",$file)){
- $name = preg_replace("/".$this->filePrefix."$/i","",$file);;
+ if(!(($file==".")||($file==".."))){
+ $name = $file;
$a_return[$name] = $name;
}
}