Add the list of the groups of the user and the lists of the mailing lists
authorFlorent Bruneau <florent.bruneau@polytechnique.org>
Sun, 3 Oct 2010 20:27:35 +0000 (22:27 +0200)
committerFlorent Bruneau <florent.bruneau@polytechnique.org>
Sun, 3 Oct 2010 20:27:35 +0000 (22:27 +0200)
of the user on admin/user.

Signed-off-by: Florent Bruneau <florent.bruneau@polytechnique.org>
classes/user.php
modules/admin.php
templates/admin/user.tpl

index ea182ef..60919a3 100644 (file)
@@ -611,7 +611,7 @@ class User extends PlUser
             $result = array();
             foreach ($this->groups as $id=>$data) {
                 if ($institutions) {
-                    if ($data['cat'] != Goup::CAT_GROUPESX && $data['cat'] != Group::CAT_INSTITUTIONS) {
+                    if ($data['cat'] != Group::CAT_GROUPESX && $data['cat'] != Group::CAT_INSTITUTIONS) {
                         continue;
                     }
                 }
index 81c1684..da4b804 100644 (file)
@@ -671,6 +671,10 @@ class AdminModule extends PLModule
         $page->assign('lastlogin', $lastlogin);
         $page->assign('host', $host);
 
+        // Display mailing lists
+        $list = new MMList(S::user());
+        $page->assign('mlists', $list->get_all_user_lists($user->forlifeEmail()));
+
         // Display active aliases.
         $page->assign('virtuals', $user->emailAliases());
         $page->assign('aliases', XDB::iterator("SELECT  alias, type='a_vie' AS for_life,
index 0b98fff..ece9ad6 100644 (file)
@@ -303,6 +303,26 @@ $(document).ready(function() {
   </table>
 </form>
 
+<h1>Groupes dont l'utilisateur est membre</h1>
+
+<table class="bicol">
+  <tr>
+    <th>Nom du groupe</th>
+    <th>Permissions</th>
+  </tr>
+  {foreach from=$user->groups() item=group}
+  <tr class="impair">
+    <td>{$group.nom}</td>
+    <td style="text-align: right">
+      {$group.perms}
+      <a href="http://www.polytechnique.net/{$group.diminutif}/member/{$user->hruid}">
+      {icon name="user_edit" title="Modifier l'inscription"}
+      </a>
+    </td>
+  </tr>
+  {/foreach}
+</table>
+
 </div>
 
 <div id="emails">
@@ -447,6 +467,28 @@ $(document).ready(function() {
 
 <table class="bicol">
   <tr>
+    <th colspan="3">Mailing lists auquelles l'utilisateur appartient</th>
+  </tr>
+  {foreach from=$mlists item=mlist}
+  <tr>
+    <td>
+      <a href="http://listes.polytechnique.org/members/{$mlist.addr|replace:"@":"_"}">
+      {$mlist.addr}
+      </a>
+    </td>
+    <td>
+      <input type="checkbox" disabled="disabled" {if $mlist.sub}checked="checked"{/if} /> Membre
+    </td>
+    <td>
+      <input type="checkbox" disabled="disabled" {if $mlist.own}checked="checked"{/if} /> Modérateur
+    </td>
+  </tr>
+  {/foreach}
+</table>
+
+<br />
+<table class="bicol">
+  <tr>
     <th>Virtual aliases auquel l'utilisateur appartient</th>
   </tr>
   {foreach from=$virtuals item=virtual}