Code

fixed acls for blocklists...
authorhickert <hickert@594d385d-05f5-0310-b6e9-bd551577e9d8>
Fri, 2 Dec 2005 10:55:04 +0000 (10:55 +0000)
committerhickert <hickert@594d385d-05f5-0310-b6e9-bd551577e9d8>
Fri, 2 Dec 2005 10:55:04 +0000 (10:55 +0000)
git-svn-id: https://oss.gonicus.de/repositories/gosa/trunk@2203 594d385d-05f5-0310-b6e9-bd551577e9d8

plugins/admin/groups/acl_definition.inc
plugins/gofax/blocklists/class_blocklistManagement.inc
plugins/gofax/blocklists/generic.tpl

index 2413e2205133b138a0b028db361148a13585cd73..54a5e2dd4b0f9c988d4c47b36f47bc1914e13cab 100644 (file)
@@ -33,6 +33,8 @@ $ACLD['gofax']=      array("cn",
                        "gosaMailForwardingAddress");
 $ACLD['blocklists']= array("cn",
                        "create",
+                       "type",
+                       "delete",
                        "description",
                        "goFaxBlocklist");
 $ACLD['group']=      array("cn",
index d77bf2b4efa42ec520f3f90a3484ad8a6cc47683..e9c5e01ab693ae790fe7e5ccb397b6df87cb6d60 100644 (file)
@@ -32,7 +32,7 @@ class blocklist extends plugin
 
     /* Get global filter config */
     if (!is_global("blockfilter")){
-      $uii= get_userinfo();
+      $ui= get_userinfo();
       $base= get_base_from_people($ui->dn);
       $blockfilter= array("sendlists" => "checked",
           "receivelists" => "checked",
@@ -44,6 +44,9 @@ class blocklist extends plugin
       $blockfilter = $_SESSION["blockfilter"];
       $this->base = $blockfilter['depselect'];
     }
+    $ui= get_userinfo();
+    $acl= get_permissions ($ui->dn, $ui->subtreeACL);
+    $this->acl= get_module_permission($acl, "blocklists", $ui->dn);
   }
 
   function execute()
@@ -164,7 +167,6 @@ class blocklist extends plugin
     /* Create new blocklist? */
     if ($s_action=="new"){
       $this->clear_fields();
-      $this->acl= "#all#";
       $this->dn= "new";
       plugin::plugin ($this->config, $this->dn);
     }
@@ -173,8 +175,6 @@ class blocklist extends plugin
     if ($s_action=="edit"){
       $this->clear_fields();
       $this->dn=$this->blocklists[$s_entry]['dn']; 
-      $this->acl= get_permissions ($this->dn, $this->ui->subtreeACL);
-      $this->acl= get_module_permission($this->acl, "blocklists", $this->dn);
       plugin::plugin ($this->config, $this->dn);
 
       /* Load missing lists */
@@ -210,9 +210,7 @@ class blocklist extends plugin
 
     /* Finally delete blocklist */
     if (isset($_POST['delete_blocklist_confirm'])){
-      $acl= get_permissions ($this->dn, $this->ui->subtreeACL);
-      $acl= get_module_permission($acl, "blocklists", $this->dn);
-      if (chkacl($acl, "all") == ""){
+      if (chkacl($this->acl, "delete") == ""){
         $this->remove_from_parent();
         gosa_log ("Blocklist object'".$this->dn."' has been removed");
         $this->reload ();
@@ -258,7 +256,6 @@ class blocklist extends plugin
 
         $this->save ();
         gosa_log ("Blocklist object'".$this->dn."' has been saved");
-        $this->acl= "#none#";
         $this->dn= "";
         del_lock ($this->ui->dn);
         unset($_SESSION['objectinfo']);
@@ -408,7 +405,6 @@ class blocklist extends plugin
     $this->cn= "";
     $this->base= "";
     $this->goFaxBlocklist= array();
-    $this->acl= "#none#";
   }
 
   function reload()
@@ -497,18 +493,13 @@ class blocklist extends plugin
   {
     plugin::save_object();
 
-    /* Save type, needed to detect objectClass */
-    if (isset($_POST['type']) && chkacl($this->acl, "cn") == ""){
-      $this->type= $_POST['type'];
-    }
-
-    /* Save base, since this is no LDAP attribute */
-    if (isset($_POST['base']) && chkacl($this->acl, "create") == ""){
-      $this->base= $_POST['base'];
+    foreach($this->attributes as $attr){
+      if(isset($_POST[$attr])){
+        $this->$attr = $_POST[$attr];
+      }
     }
   }
 
-
   /* Check values */
   function check()
   {
@@ -521,10 +512,7 @@ class blocklist extends plugin
       $new_dn= $this->dn;
     }
 
-    $ui= get_userinfo();
-    $acl= get_permissions ($new_dn, $ui->subtreeACL);
-    $acl= get_module_permission($acl, "blocklist", $new_dn);
-    if (chkacl($acl, "create") != ""){
+    if (chkacl($this->acl, "create") != ""){
       $message[]= _("You have no permissions to create a blocklist on this 'Base'.");
     }
 
index d2e80aae030021ca9651cd112df406b3cc2ca6bb..b3337d9db5569e71d7a3200b12a1848bfbf1bb9d 100644 (file)
@@ -31,7 +31,7 @@
      <tr>
        <td><LABEL for="type">{t}Type{/t}</LABEL></td>
        <td>
-        <select size="1" id="type" name="type" {$typeACL} title="{t}Select wether to filter incoming or outgoing calls{/t}">
+        <select size="1" id="type" name="type" {$goFaxBlocklistACL} title="{t}Select wether to filter incoming or outgoing calls{/t}">
         {html_options options=$types selected=$type}
                <option disabled>&nbsp;</option>
         </select>