Code

Hide not allowed options
authorhickert <hickert@594d385d-05f5-0310-b6e9-bd551577e9d8>
Thu, 11 Jan 2007 11:04:16 +0000 (11:04 +0000)
committerhickert <hickert@594d385d-05f5-0310-b6e9-bd551577e9d8>
Thu, 11 Jan 2007 11:04:16 +0000 (11:04 +0000)
git-svn-id: https://oss.gonicus.de/repositories/gosa/branches/2.5@5533 594d385d-05f5-0310-b6e9-bd551577e9d8

plugins/admin/ogroups/class_divListOGroup.inc
plugins/admin/ogroups/class_mailogroup.inc
plugins/admin/ogroups/class_ogroup.inc
plugins/admin/ogroups/class_ogroupManagement.inc
plugins/admin/ogroups/class_phonequeue.inc
plugins/admin/ogroups/class_termgroup.inc
plugins/admin/ogroups/phonequeue.tpl

index a40237facd07a3df3157b04090f85515199132c2..52693207f04586c6c1f5db4b2419021b72049821 100755 (executable)
@@ -117,19 +117,6 @@ class divListOGroup extends MultiSelectWindow
   {
     /* Add Copy & Paste buttons if copy&paste is enabled
      */
-    /* Create action icons */
-    $actions = "";
-    if($this->parent->CopyPasteHandler){
-      $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;";
-    }
-    $actions.= "<input class='center' type='image'
-      src='images/edit.png' alt='"._("edit")."' name='group_edit_%KEY%' title='"._("Edit this entry")."'>";
-    $actions.= "<input class='center' type='image'
-      src='images/edittrash.png' alt='"._("delete")."' name='group_del_%KEY%' title='"._("Delete this entry")."'>";
-
     // Defining Links
     $linkopen = "<a href='?plug=".$_GET['plug']."&amp;act=dep_open&amp;dep_id=%s'>%s</a>";
     $editlink = "<a href='?plug=".$_GET['plug']."&amp;id=%s&amp;act=edit_entry'>%s</a>";
@@ -140,6 +127,25 @@ class divListOGroup extends MultiSelectWindow
     // Assigning ogroups
     foreach($list as $key => $val){
 
+      $acl= get_permissions ($val['dn'], $this->ui->subtreeACL);
+      $acl= get_module_permission($acl, "ogroup", $val['dn']);
+  
+      /* Create action icons */
+      $actions = "";
+      if($this->parent->CopyPasteHandler && $acl == "#all#"){
+        $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;";
+      }
+      $actions.= "<input class='center' type='image'
+        src='images/edit.png' alt='"._("edit")."' name='group_edit_%KEY%' title='"._("Edit this entry")."'>";
+
+      if(chkacl($acl,"delete") == ""){
+        $actions.= "<input class='center' type='image'
+          src='images/edittrash.png' alt='"._("delete")."' name='group_del_%KEY%' title='"._("Delete this entry")."'>";
+      }
+
       if(isset($val['mail'])){
         $mail = $mailimg;
       }else{
index 560e4653ca0dba81d43432618fb468505491b251..3dd55699d624f5055858ff9f73875ebffac1ab15 100644 (file)
@@ -29,9 +29,16 @@ class mailogroup extends plugin
     /* Call parent execute */
     plugin::execute();
 
+    
     /* Do we need to flip is_account state? */
     if (isset($_POST['modify_state'])){
-      $this->is_account= !$this->is_account;
+
+      /* Onyl change account state if allowed */
+      if($this->is_account && $this->acl == "#all#"){
+        $this->is_account= !$this->is_account;
+      }elseif(!$this->is_account && chkacl($this->acl,"create") == ""){
+        $this->is_account= !$this->is_account;
+      }
     }
 
     /* Show tab dialog headers */
index 1f9b454ab01c091d3fd4bb2b55b880dc643d6108..b5366a941636d202abce482d3495bc02bd01cf9d 100644 (file)
@@ -110,7 +110,7 @@ class ogroup extends plugin
       $this->reload();
     }else{
       /* Delete objects from group */
-      if (isset($_POST['delete_membership']) && isset($_POST['members'])){
+      if (isset($_POST['delete_membership']) && isset($_POST['members'])  && chkacl($this->acl,"gosaGroupObjects") == ""){
         foreach ($_POST['members'] as $value){
           $this->objects["$value"]= $this->memberList[$value];
           unset ($this->memberList["$value"]);
@@ -122,7 +122,7 @@ class ogroup extends plugin
       }
 
       /* Add objects to group */
-      if (isset($_POST['add_object_finish']) && isset($_POST['objects'])){
+      if (isset($_POST['add_object_finish']) && isset($_POST['objects'])  && chkacl($this->acl,"gosaGroupObjects") == ""){
         foreach ($_POST['objects'] as $value){
           $this->memberList["$value"]= $this->objects[$value];
           $this->member["$value"]= $value;
@@ -150,7 +150,7 @@ class ogroup extends plugin
     }
 
     /* Delete objects from group */
-    if (isset($_POST['delete_membership']) && isset($_POST['members'])){
+    if (isset($_POST['delete_membership']) && isset($_POST['members']) && chkacl($this->acl,"gosaGroupObjects") == ""){
       foreach ($_POST['members'] as $value){
         if(isset($this->memberList[$value])){
           $this->objects["$value"]= $this->memberList[$value];
@@ -183,7 +183,7 @@ class ogroup extends plugin
     /* Base select dialog */
     $once = true;
     foreach($_POST as $name => $value){
-      if(preg_match("/^chooseBase/",$name) && $once){
+      if(preg_match("/^chooseBase/",$name) && $once && chkacl($this->acl,"base") == ""){
         $once = false;
         $this->dialog = new baseSelectDialog($this->config);
         $this->dialog->setCurrentBase($this->base);
@@ -206,7 +206,7 @@ class ogroup extends plugin
     }
 
     /* Add objects? */
-    if (isset($_POST["edit_membership"])){
+    if (isset($_POST["edit_membership"])  && chkacl($this->acl,"gosaGroupObjects") == ""){
       $this->group_dialog= TRUE;
       $this->dialog= TRUE;
     }
@@ -271,10 +271,9 @@ class ogroup extends plugin
     }
 
     /* Bases / Departments */
-   
-      if (isset($_POST['base'])){
-        $this->base= $_POST['base'];
-      }
+    if (isset($_POST['base']) && chkacl($this->acl,"base") == ""){
+      $this->base= $_POST['base'];
+    }
 
     /* Assemble combine string */
     if ($this->gosaGroupObjects == "[]"){
@@ -338,7 +337,6 @@ class ogroup extends plugin
       if (chkacl ($this->acl, "base") == "" && isset($_POST["base"])){
         $this->base= $_POST["base"];
       }
-
     }
   }
 
@@ -609,7 +607,7 @@ class ogroup extends plugin
     $ui= get_userinfo();
     $acl= get_permissions ($new_dn, $ui->subtreeACL);
     $acl= get_module_permission($acl, "group", $new_dn);
-    if (chkacl($acl, "create") != ""){
+    if (chkacl($acl, "create") != "" && $this->dn=="new"){
       $message[]= _("You have no permissions to create a group on this 'Base'.");
     }
 
index 09fba6b173dcf135311ce696315d78d20da52384..a0a981e6441536ffd3d627d04d77ae9a5c632c5b 100644 (file)
@@ -114,10 +114,34 @@ class ogroupManagement extends plugin
     /* Only perform copy / paste if it is enabled
      */
 
-    /* Display the copy & paste dialog, if it is currently open */
-    $ret = $this->copyPasteHandling($s_action,$s_entry);
-    if($ret){
-      return($ret);
+
+    /********************
+      Copy & Paste Handling  ...
+     ********************/
+
+    /* Only perform copy&paste requests if it is enabled
+     */
+    /* Get 'dn' from posted 'uid' */
+    if(in_array_ics($s_action,array("editPaste","cut","copy"))){
+
+      if(isset($this->ogrouplist[trim($s_entry)]['dn'])){
+        $dn= $this->ogrouplist[trim($s_entry)]['dn'];
+      }else{
+        $dn = $this->DivListOGroup->selectedBase;
+      }
+
+      $acl= get_permissions ($dn, $this->ui->subtreeACL);
+      $acl= get_module_permission($acl, "ogroup", $dn);
+
+      if($acl != "#all#"){
+        print_red (_("You are not allowed to execute this method!"));
+      }else{
+        /* Display the copy & paste dialog, if it is currently open */
+        $ret = $this->copyPasteHandling($s_action,$s_entry);
+        if($ret){
+          return($ret);
+        }
+      }
     }
 
     /****************
index 2a2b1ad9c0e5311998bf99548df4c5d7e060840f..7e712a4a0ce0814f602b93fe08d9339437069302 100644 (file)
@@ -196,7 +196,13 @@ class phonequeue extends plugin
 
     /* Do we need to flip is_account state? */
     if (isset($_POST['modify_state'])){
-      $this->is_account= !$this->is_account;
+
+      /* Onyl change account state if allowed */
+      if($this->is_account && $this->acl == "#all#"){
+        $this->is_account= !$this->is_account;
+      }elseif(!$this->is_account && chkacl($this->acl,"create") == ""){
+        $this->is_account= !$this->is_account;
+      }
     }
 
     /* Show tab dialog headers */
@@ -767,10 +773,12 @@ class phonequeue extends plugin
     plugin::save_object();  
     if(isset($_POST['phonenumber'])){
       foreach(array("goFonDialOption_t","goFonDialOption_T","goFonDialOption_h","goFonDialOption_r","goFonDialOption_H","goFonMusiconHold") as $val){
-        if(isset($_POST[$val])){
-          $this->$val = $_POST[$val];
-        }else{
-          $this->$val = false;
+        if(chkacl($this->acl,$val) == "") {
+          if(isset($_POST[$val])){
+            $this->$val = $_POST[$val];
+          }else{
+            $this->$val = false;
+          }
         }
       }
       if(isset($_POST['goFonQueueAnnounceHoldtime'])){
index 03d76d20a84f6f33705dc442b41567860abc20dc..4b2e746954c385b7dbadc3909b26837b25aff416 100644 (file)
@@ -202,7 +202,7 @@ class termgroup extends plugin
         $names.= "$cn ";
       }
 
-      if (isset($_POST['action'])){
+      if (isset($_POST['action']) && $this->acl == "#all#"){
 
         /* Update members fai state */
         $this->update_term_member_FAIstate(trim($_POST['saction']));
@@ -227,12 +227,12 @@ class termgroup extends plugin
      ***************/
 
     /* Add new ntp Server to our list */
-    if((isset($_POST['addNtpServer'])) && (isset($_POST['gotoNtpServers']))){
+    if((isset($_POST['addNtpServer'])) && (isset($_POST['gotoNtpServers'])) && $this->acl == "#all#"){
       $this->gotoNtpServer[$_POST['gotoNtpServers']] = $_POST['gotoNtpServers'];
     }
 
     /* Delete selected NtpServer for list of used servers  */
-    if((isset($_POST['delNtpServer'])) && (isset($_POST['gotoNtpServerSelected']))){
+    if((isset($_POST['delNtpServer'])) && (isset($_POST['gotoNtpServerSelected'])) && $this->acl == "#all#"){
       foreach($_POST['gotoNtpServerSelected'] as $name){
         unset($this->gotoNtpServer[$name]);
       }
index 02e671f0f912b14a73b3253e1c4b532108805b7a..cdd9e71846390c66fcecbd73b1320017cf48f96d 100644 (file)
@@ -37,7 +37,7 @@
                        <tr>
                <td><LABEL for="goFonHomeServer">{t}Home server{/t}</LABEL>{$must}</td>
                <td>
-                       <select name='goFonHomeServer'>
+                       <select name='goFonHomeServer' {$goFonHomeServerACL}>
                         {html_options options=$goFonHomeServers selected=$goFonHomeServer}
                        </select>
                </td>