Code

Updated system acls
[gosa.git] / plugins / admin / applications / class_divListApplication.inc
index 9056297824fe64aca306ca4b59ee2c096497255d..4676a4bb7ac129d4558fd42745548a8292ddfdf1 100755 (executable)
@@ -84,20 +84,9 @@ class divListApplication extends MultiSelectWindow
       $Copy_Paste ="";
     }
 
-    /* Create listhead, it will be shown on top of the divlist.
-     * It provides general navigation and object creation
-     */
-    $listhead = "<div style='background:#F0F0F9;padding:5px;'>".
-      " <input class='center' type='image' src='images/list_root.png' align='middle' ".
-        "title='"._("Go to root department")."' name='dep_root' alt='"._("Root")."'>&nbsp;".
-      " <input class='center' type='image' align='middle' src='images/list_back.png' ".
-        "title='"._("Go up one department")."' alt='"._("Up")."' name='dep_back'>&nbsp;".
-      " <input class='center' type='image' align='middle' src='images/list_home.png' ".
-        "title='"._("Go to users department")."' alt='"._("Home")."' name='dep_home'>&nbsp;".
-      " <input class='center' type='image' src='images/list_reload.png' align='middle' ".
-        "title='"._("Reload list")."' name='submit_department' alt='"._("Submit")."'>&nbsp;".
-      " <img class='center' src='images/list_seperator.png' align='middle' alt='' height='16' width='1'>&nbsp;".
-      " <input class='center' type='image' align='middle' src='images/list_new_app.png' alt='"._("new").
+    /* Add default header */
+    $listhead = MultiSelectWindow::get_default_header();
+    $listhead.= " <input class='center' type='image' align='middle' src='images/list_new_app.png' alt='"._("new").
         "' title='"._("Create new application")."' name='appl_new'>&nbsp;".
       $Copy_Paste.
       " <img class='center' src='images/list_seperator.png' align='middle' alt='' height='16' width='1'>&nbsp;".
@@ -137,6 +126,9 @@ class divListApplication extends MultiSelectWindow
 
     foreach($list as $key => $val){
 
+      $acl= get_permissions ($val['dn'], $this->ui->subtreeACL);
+      $acl= get_module_permission($acl, "application", $val['dn']);
+
       /* Get state */
       $state = "";
       if(isset($val['FAIstate'])){
@@ -148,20 +140,28 @@ class divListApplication extends MultiSelectWindow
 
       /* Create action icons */
       $actions = "";
-      if(($this->parent->CopyPasteHandler) && (!$is_freezed)){
-        $actions.= "<input class='center' type='image'
-          src='images/editcut.png' alt='"._("cut")."' name='cut_%KEY%' title='"._("Cut this entry")."'>&nbsp;";
-        $actions.= "<input class='center' type='image'
-          src='images/editcopy.png' alt='"._("copy")."' name='copy_%KEY%' title='"._("Copy this entry")."'>&nbsp;";
+
+      if($acl == "#all#"){
+        if(($this->parent->CopyPasteHandler) && (!$is_freezed)){
+          $actions.= "<input class='center' type='image'
+            src='images/editcut.png' alt='"._("cut")."' name='cut_%KEY%' title='"._("Cut this entry")."'>&nbsp;";
+        }
+        if($this->parent->CopyPasteHandler){
+          $actions.= "<input class='center' type='image'
+            src='images/editcopy.png' alt='"._("copy")."' name='copy_%KEY%' title='"._("Copy this entry")."'>&nbsp;";
+        }
       }
     
       $actions.= "<input class='center' type='image'
         src='images/edit.png' alt='"._("edit")."' name='appl_edit_%KEY%' title='"._("Edit this entry")."'>";
       if($is_freezed){
-        $actions.= "<img src='images/empty.png' width='16' alt='&nbsp;' >";
+        $actions.= "<img src='images/empty.png' width='16' alt='&nbsp;' class='center'>";
       }else{
-        $actions.= "<input class='center' type='image'
-          src='images/edittrash.png' alt='"._("delete")."' name='appl_del_%KEY%' title='"._("Delete this entry")."'>";
+
+        if(chkacl($acl,"delete") == ""){
+          $actions.= "<input class='center' type='image'
+            src='images/edittrash.png' alt='"._("delete")."' name='appl_del_%KEY%' title='"._("Delete this entry")."'>";
+        }
       }