From: hickert Date: Mon, 16 Jan 2006 08:38:45 +0000 (+0000) Subject: Updated kiosk list X-Git-Url: https://git.tokkee.org/?a=commitdiff_plain;h=54d542369853af76bc62fbd0cfdbda7114c0946a;p=gosa.git Updated kiosk list git-svn-id: https://oss.gonicus.de/repositories/gosa/trunk@2485 594d385d-05f5-0310-b6e9-bd551577e9d8 --- diff --git a/plugins/personal/environment/class_environment.inc b/plugins/personal/environment/class_environment.inc index af7d2bcb1..dcbe0bdb4 100644 --- a/plugins/personal/environment/class_environment.inc +++ b/plugins/personal/environment/class_environment.inc @@ -407,6 +407,7 @@ class environment extends plugin if(isset($_POST['KioskManagementDialog'])){ $this->dialog = new kioskManagementDialog($this->config,$this->dn,$this->newKioskProfiles); $this->dialog->parent= $this; + $this->dialog->acl = $this->acl; $this->is_dialog = true; } diff --git a/plugins/personal/environment/class_kioskManagementDialog.inc b/plugins/personal/environment/class_kioskManagementDialog.inc index 93af0635d..107af0066 100644 --- a/plugins/personal/environment/class_kioskManagementDialog.inc +++ b/plugins/personal/environment/class_kioskManagementDialog.inc @@ -36,9 +36,9 @@ class kioskManagementDialog extends plugin $smarty->assign("gotoKioskProfileACL",chkacl($this->acl,"gotoKioskProfile")); - foreach($this->attributes as $attr){ - $smarty->assign($attr."ACL",chkacl($this->acl,$attr)); - } + foreach($this->attributes as $attr){ + $smarty->assign($attr."ACL",chkacl($this->acl,$attr)); + } /* Add new kiosk profile * in profile directory ($this->baseDir); @@ -50,7 +50,29 @@ class kioskManagementDialog extends plugin $this->filesToAttach[$file['name']]['contents'] = file_get_contents($file['tmp_name']); } } + + $only_once = true; + foreach($_POST as $name => $value){ + if((preg_match("/^delkiosk_/",$name))&&($only_once)){ + $only_once = false; + $id = preg_replace("/^delkiosk_/","",$name); + $id = preg_replace("/_.*$/","",$id); + + $filename = $this->baseDir."/".preg_replace("/^.*\//i","",base64_decode($id)); + + $res = unlink($filename); + if(!$res){ + if(!is_writeable($filename)){ + print_red(sprintf(_("Can't delete '%s'. Error was: permission denied."), $filename)); + } + if(!file_exists($filename)){ + print_red(sprintf(_("Can't delete '%s'. Errow was: file doesn't exist."), $filename)); + } + } + } + } + /* Delete profile * Delete selected file form $this->baseDir */ @@ -69,7 +91,25 @@ class kioskManagementDialog extends plugin } } + $divlist = new divSelectBox("KioskProfiles"); + $divlist -> SetHeight (300); + + $tmp = $this->getKioskProfiles(); + + foreach($tmp as $val ){ + $divlist->AddEntry(array( + array("string"=>"".$val.""), + array("string"=>"" , + "attach"=>" style='border-right: 0px;width:24px; text-align:center;' ") + )); + } + + /*Assign all existing profiles to smarty*/ + + + $smarty->assign("divlist",$divlist->DrawList()); + $smarty->assign("gotoKioskProfiles",$this->getKioskProfiles()); $smarty->assign("gotoKioskProfileKeys",array_flip($this->getKioskProfiles())); diff --git a/plugins/personal/environment/kioskManagement.tpl b/plugins/personal/environment/kioskManagement.tpl index c32ebfef4..091407596 100644 --- a/plugins/personal/environment/kioskManagement.tpl +++ b/plugins/personal/environment/kioskManagement.tpl @@ -5,13 +5,14 @@
- - +