summary | shortlog | log | commit | commitdiff | tree
raw | patch | inline | side by side (parent: 7dea80f)
raw | patch | inline | side by side (parent: 7dea80f)
author | hickert <hickert@594d385d-05f5-0310-b6e9-bd551577e9d8> | |
Fri, 26 Aug 2005 12:24:28 +0000 (12:24 +0000) | ||
committer | hickert <hickert@594d385d-05f5-0310-b6e9-bd551577e9d8> | |
Fri, 26 Aug 2005 12:24:28 +0000 (12:24 +0000) |
git-svn-id: https://oss.gonicus.de/repositories/gosa/trunk@1232 594d385d-05f5-0310-b6e9-bd551577e9d8
plugins/personal/environment/class_environment.inc | patch | blob | history | |
plugins/personal/environment/class_kioskManagementDialog.inc | patch | blob | history |
diff --git a/plugins/personal/environment/class_environment.inc b/plugins/personal/environment/class_environment.inc
index 365ccc98033127278636eb3df7d850ea7fd8e0e0..c8fd3ea3ac0fbc553dc820f1f69a2a8cc588abac 100644 (file)
/* Kiosk profile */
var $gotoKioskProfile = ""; // The selected Kiosk Profile
var $gotoKioskProfiles = array();// All available Kiosk profiles
+ VAR $newKioskProfiles = array();
/* Hotplug Devices */
var $gotoHotplugDevice = ""; // Selected hotplug
* Read available from filesystem
* Open management if post is transmitted
*/
- $tmp = new kioskManagementDialog($this->config,$this->dn);
- $list = $tmp->getKioskProfiles();
-
- $smarty->assign("gotoKioskProfiles",$list);
- $smarty->assign("gotoKioskProfileKeys",array_flip($list));
/* Open Management Dialog */
if(isset($_POST['KioskManagementDialog'])){
- $this->dialog = new kioskManagementDialog($this->config,$this->dn);
+ $this->dialog = new kioskManagementDialog($this->config,$this->dn,$this->newKioskProfiles);
$this->is_dialog = true;
}
/* Save */
if(isset($_POST['KioskClose'])){
+ $this->newKioskProfiles = array_merge($this->newKioskProfiles,$this->dialog->save());
+
unset($this->dialog);
$this->dialog=NULL;
$this->is_dialog = false;
}
+ $tmp = new kioskManagementDialog($this->config,$this->dn);
+ $list = $tmp->getKioskProfiles($this->newKioskProfiles);
+
+ $smarty->assign("gotoKioskProfiles",$list);
+ $smarty->assign("gotoKioskProfileKeys",array_flip($list));
/* Logonscript Management
* Get available LogonScripts (possibly grey out (or mark) these script that are defined for the group)
$ldap= $this->config->get_ldap_link();
$realyUsedAttrs= array();
-
+
+
+ $path = search_config($this->config->data['MENU'],"environment", "KIOSKPATH");
+ /* Creating Kiosk Profiles */
+ foreach($this->newKioskProfiles as $file){
+ $contents = $file['contents'];
+ $fp = @fopen($path."/".$file['name'],"w");
+ if(!$fp){
+ print_red("Can't save new kiosk profiles, possibly permission denied for folder :",$path);
+ }else{
+ fwrite($fp,$contents,strlen($contents));
+ }
+ @unlink($file['tmp_name']);
+ }
+
+
+
+
+
+
/* Save already used objectClasses */
$ocs = $this->attrs['objectClass'];
unset($ocs['count']);
diff --git a/plugins/personal/environment/class_kioskManagementDialog.inc b/plugins/personal/environment/class_kioskManagementDialog.inc
index 4d2663f46cc042cd6d6d68937eae1915565e9ea2..80b2c8f78befeee7281ca0c4477eb174b2ad21ee 100644 (file)
/* attribute list for save action */
var $ignore_account = TRUE;
- var $attributes = array();
+ var $attributes = array("filesToAttach");
var $objectclasses = array("whatever");
var $use_existing = false;
+ var $filesToAttach = array();
var $baseDir = "../kioskProfiles/";
- function kioskManagementDialog ($config, $dn= NULL,$use_existing=false )
+ function kioskManagementDialog ($config, $dn= NULL,$attach=false )
{
- $this->use_existing = $use_existing;
plugin::plugin ($config, $dn);
+ if($attach){
+ $this->filesToAttach = $attach;
+ }
$this->baseDir = search_config($this->config->data['MENU'],"environment", "KIOSKPATH");
}
if((isset($_POST['profileAdd']))&&(isset($_FILES['newProfile']))){
$file = $_FILES['newProfile'];
if(!file_exists($this->baseDir.$file['name'])){
- $name = $file['name'];
- $str = file_get_contents($file['tmp_name']);
- $fp = @fopen($this->baseDir."/".$name,"w");
- if($fp){
- fwrite($fp,$str,strlen($str));
- fclose($fp);
- }else{
- print_red(_("Can't save kioskProfile. Permission denied.")." ".$this->baseDir);
- }
- unlink($file['tmp_name']);;
+ $this->filesToAttach[$file['name']]=$file;
+ $this->filesToAttach[$file['name']]['contents'] = file_get_contents($file['tmp_name']);
}
}
return($display);
}
- function getKioskProfiles()
+ function save(){
+ return($this->filesToAttach);
+ }
+
+ function getKioskProfiles($attach = false)
{
$a_return = array();
$dir = @opendir($this->baseDir);
}
}
}
+
+ foreach($this->filesToAttach as $file){
+ $a_return[$file['name']] = $file['name'];
+ }
+
+ if($attach){
+ foreach($attach as $file){
+ $a_return[$file['name']] = $file['name'];
+ }
+ }
+
return($a_return);
}