Code

Updated kiosk profile management
authorhickert <hickert@594d385d-05f5-0310-b6e9-bd551577e9d8>
Fri, 12 Sep 2008 13:09:39 +0000 (13:09 +0000)
committerhickert <hickert@594d385d-05f5-0310-b6e9-bd551577e9d8>
Fri, 12 Sep 2008 13:09:39 +0000 (13:09 +0000)
-Added ACLs

git-svn-id: https://oss.gonicus.de/repositories/gosa/trunk@12454 594d385d-05f5-0310-b6e9-bd551577e9d8

gosa-plugins/goto/admin/systems/services/kiosk/class_goKioskService.inc
gosa-plugins/goto/admin/systems/services/kiosk/goKioskService.tpl

index 07baffc6ec1e2f539bda7eb6b4361a0f782a4789..dc27c533356b0224c10a8eda49edfcf3ebcd23eb 100644 (file)
@@ -84,12 +84,14 @@ class goKioskService extends goService{
     /* Fill templating stuff */
     $smarty= get_smarty();
     $smarty->assign("baseDir",$this->baseDir);
+    $smarty->assign("ThisACL",$this->getacl(""));
     $display= "";
 
     /* Download kiosk profile 
      */
     if(isset($_GET['getkiosk'])){
       $id = $_GET['getkiosk'];
+
       foreach($this->gotoKioskProfiles as $profile){
         if($profile['name'] == $id){
           $name = $this->baseDir."/".$id;
@@ -105,7 +107,7 @@ class goKioskService extends goService{
     /* Add new kiosk profile
      * in profile directory ($this->baseDir);
      */
-    if((isset($_POST['profileAdd']))&&(isset($_FILES['newProfile']))){
+    if((isset($_POST['profileAdd']))&&(isset($_FILES['newProfile'])) && $this->acl_is_writeable("")){
       $file = $_FILES['newProfile'];
       if(!file_exists($this->baseDir.$file['name'])){
         $tmp = array(
@@ -122,7 +124,7 @@ class goKioskService extends goService{
     $only_once = true;
     foreach($_POST as $name => $value){
 
-      if((preg_match("/^delkiosk_/",$name))&&($only_once)){
+      if((preg_match("/^delkiosk_/",$name))&&($only_once) && $this->acl_is_writeable("")){
   
         /* Get id, name and path */
         $only_once = false;
@@ -171,11 +173,17 @@ class goKioskService extends goService{
     /* Display list of profiles */
     $divlist = new divSelectBox("KioskProfiles");
     $divlist -> SetHeight (300);
+
+
     foreach($this->gotoKioskProfiles as $key => $val ){
+      $del = "&nbsp;";
+      if($this->acl_is_writeable("")){
+        $del = "<input type='image' src='images/lists/trash.png'
+          class='center' alt='delete' name='delkiosk_".$key."'>";
+      }
       $divlist->AddEntry(array(
             array("string"=>"<a href='?plug=".$_GET['plug']."&getkiosk=".$val['name']."'>".$val['name']."</a>"),
-            array("string"=>"<input type='image' src='images/lists/trash.png'
-              class='center' alt='delete' name='delkiosk_".$key."'>" ,
+            array("string"=>$del,
               "attach"=>" style='border-right: 0px;width:24px; text-align:center;' ")
             ));
     }
index e43973262fb9114494eaa09187b1ee048c6da7ce..7d9f0ca545c2d455236030ca03714067cf457a87 100644 (file)
 {t}Server path{/t}&nbsp;<input name="server_path" style="width:300px;" value="{$server_path}">
 <br>
 <br>
+{render acl=$ThisACL}
 {$divlist}
+{/render}
+{render acl=$ThisACL}
 <input type="file" size=50 name="newProfile" value="{t}Browse{/t}">
+{/render}
+{render acl=$ThisACL}
 <input type="submit" name="profileAdd" value="{msgPool type=addButton}">
+{/render}
 
 <p class='seperator'>&nbsp;</p>
 <div style="width:100%; text-align:right;padding-top:10px;padding-bottom:3px;">