Block the access to aliases and lists pages when the group doesn't have a mail domain
authorx2003bruneau <x2003bruneau@839d8a87-29fc-0310-9880-83ba4fa771e5>
Wed, 22 Nov 2006 20:24:59 +0000 (20:24 +0000)
committerx2003bruneau <x2003bruneau@839d8a87-29fc-0310-9880-83ba4fa771e5>
Wed, 22 Nov 2006 20:24:59 +0000 (20:24 +0000)
git-svn-id: svn+ssh://murphy/home/svn/platal/trunk@1129 839d8a87-29fc-0310-9880-83ba4fa771e5

modules/xnetlists.php
templates/xnetlists/index.tpl

index 986cad9..fbdde4e 100644 (file)
@@ -70,6 +70,9 @@ class XnetListsModule extends ListsModule
     {
         global $globals;
 
+        if (!$globals->asso('mail_domain')) {
+            return PL_NOT_FOUND;
+        }
         $this->prepare_client($page);
 
         $page->changeTpl('xnetlists/index.tpl');
@@ -113,6 +116,9 @@ class XnetListsModule extends ListsModule
     {
         global $globals;
 
+        if (!$globals->asso('mail_domain')) {
+            return PL_NOT_FOUND;
+        }
         $this->prepare_client($page);
 
         $page->changeTpl('xnetlists/create.tpl');
@@ -188,6 +194,9 @@ class XnetListsModule extends ListsModule
     {
         global $globals;
 
+        if (!$globals->asso('mail_domain')) {
+            return PL_NOT_FOUND;
+        }
         $this->prepare_client($page);
 
         $page->changeTpl('xnetlists/sync.tpl');
@@ -229,7 +238,9 @@ class XnetListsModule extends ListsModule
 
     function handler_aadmin(&$page, $lfull = null)
     {
-        if (is_null($lfull)) {
+        global $globals;
+
+        if (!$globals->asso('mail_domain') || is_null($lfull)) {
             return PL_NOT_FOUND;
         }
 
@@ -305,6 +316,9 @@ class XnetListsModule extends ListsModule
     {
         global $globals;
 
+        if (!$globals->asso('mail_domain')) {
+            return PL_NOT_FOUND;
+        }
         new_groupadmin_page('xnet/groupe/alias-create.tpl');
 
         if (!Post::has('submit')) {
index f11941e..b41fb27 100644 (file)
@@ -90,6 +90,13 @@ croix verte te permet de t'inscrire, apr
   {foreachelse}
   <tr><td colspan='7'>Pas de listes pour ce groupe</td></tr>
   {/foreach}
+  {if $may_update}
+  <tr><td colspan="7" class="center">
+    <a href="{$platal->ns}lists/create">
+      {icon name=add title="Créer une liste"} Créer une nouvelle liste
+    </a>
+  </td></tr>
+  {/if}
 </table>
 
 <p class="descr">
@@ -100,11 +107,11 @@ t'emp
         
 <h2>Voici les alias existants pour le groupe {$asso.nom} :</h2>
 
-{if $alias->total()}
 <table cellspacing="0" cellpadding="0" class='large'>
   <tr>
     <th{if $may_update} colspan='3'{/if}>Alias</th>
   </tr>
+  {if $alias->total()}
   {iterate from=$alias item=a}
   <tr>
     {if $may_update}
@@ -116,10 +123,19 @@ t'emp
     {/if}
   </tr>
   {/iterate}
+  {else}
+  <tr>
+    <td{if $may_update} colspan='3'{/if}>Aucun alias pour ce groupe</td>
+  </tr>
+  {/if}
+  {if $may_update}
+  <tr><td colspan="3" class="center">
+    <a href="{$platal->ns}alias/create">
+      {icon name=add title="Créer une liste"} Créer un nouvel alias
+    </a>
+  </td></tr>
+  {/if}
 </table>
-{else}
-<p>Aucun alias pour ce groupe</p>
-{/if}
 
 {/if}