Code

Added member info to group mail
authorhickert <hickert@594d385d-05f5-0310-b6e9-bd551577e9d8>
Wed, 17 Dec 2008 12:02:49 +0000 (12:02 +0000)
committerhickert <hickert@594d385d-05f5-0310-b6e9-bd551577e9d8>
Wed, 17 Dec 2008 12:02:49 +0000 (12:02 +0000)
git-svn-id: https://oss.gonicus.de/repositories/gosa/trunk@13305 594d385d-05f5-0310-b6e9-bd551577e9d8

gosa-plugins/mail/admin/groups/mail/class_groupMail.inc
gosa-plugins/mail/admin/groups/mail/mail.tpl

index 0d64e10c0a978b28b7f2d9902f643f52fbb338c1..3965203a21a5b40631c725997dfa330e76238385 100644 (file)
@@ -44,6 +44,7 @@ class mailgroup extends plugin
   var $uid = "";
   var $cn ="";
   var $orig_cn = "";
+  var $show_effective_memeber = FALSE;
 
   function __construct (&$config, $dn= NULL, $ui= NULL)
   {
@@ -254,7 +255,7 @@ class mailgroup extends plugin
       $this->view_logged = TRUE;
       new log("view","groups/".get_class($this),$this->dn);
     }
-
     /****************
       Account status
      ****************/
@@ -422,6 +423,8 @@ class mailgroup extends plugin
     $smarty->assign("mailEqualsCN", $this->mailMethod->mailEqualsCN());
     $smarty->assign("folder_acls" , $this->postable_acls());
     $smarty->assign("AclTypes" ,    $this->AclTypes);
+    $smarty->assign("Effective",    $this->get_effective_member_acls());
+    $smarty->assign("show_effective_memeber",    $this->show_effective_memeber);
   
     $smarty->assign("quotaEnabled", $this->mailMethod->quotaEnabled());
     if($this->mailMethod->quotaEnabled()){
@@ -572,6 +575,10 @@ class mailgroup extends plugin
     }
     if (isset($_POST['mailedit'])){
 
+      if(isset($_POST['show_effective_memeber'])){
+        $this->show_effective_memeber = !$this->show_effective_memeber;
+      }
+
       $mail = $this->mail;
       $server = $this->gosaMailServer;
       plugin::save_object();
@@ -1254,7 +1261,25 @@ class mailgroup extends plugin
     return($ret);
   }
 
-  
+
+  function get_effective_member_acls()
+  {
+    $tmp = array();
+    $member = $this->get_member();
+    foreach($member['mail'] as $uid => $mail){
+
+      /* Do not save overridden acls */
+      if(isset($this->folder_acls[$mail])){
+        continue;
+      }
+
+      
+      $tmp[$mail]  = $this->folder_acls['__member__'];
+    }
+    return($tmp);
+  }
+
+
   function allow_remove()
   {
     $resason = "";
index 1d73a9d1bc581a973b7396f56604bfc004ebc546..f1fac33ba52835edcf308f85a0dd5f0720fdafe4 100644 (file)
                                <input type='submit' value='{msgPool type=delButton}' name='remove_acl_user_{$item.post_name}'>
                        {/if}
 {/render}
+                       {if $user == "__member__"}
+                               {if $show_effective_memeber}
+                                       <input type='submit' name='show_effective_memeber' value='{t}Hide{/t}'> 
+                               {else}
+                                       <input type='submit' name='show_effective_memeber' value='{t}Show{/t}'> 
+                               {/if}
+                       {/if}
                 </td>
                </tr>
+               {if $user == "__member__" && $show_effective_memeber}
+                       {foreach from=$Effective item=i key=k}
+                               <tr><td>&nbsp;&nbsp;<i>{$k}</i></td></tr>
+                       {/foreach}
+               {/if}
        {/foreach}
+
+               
                <tr>
                        <td colspan="1"></td>
                        <td><input type='submit' value='{msgPool type=addButton}' name='add_acl_user'>