page des perdus de vue
authorx2001corpet <x2001corpet@839d8a87-29fc-0310-9880-83ba4fa771e5>
Sun, 15 Apr 2007 22:26:11 +0000 (22:26 +0000)
committerx2001corpet <x2001corpet@839d8a87-29fc-0310-9880-83ba4fa771e5>
Sun, 15 Apr 2007 22:26:11 +0000 (22:26 +0000)
git-svn-id: svn+ssh://murphy/home/svn/platal/trunk@1701 839d8a87-29fc-0310-9880-83ba4fa771e5

modules/email.php
templates/admin/index.tpl
templates/emails/lost.tpl [new file with mode: 0644]

index f40ce86..59b08cc 100644 (file)
@@ -32,7 +32,8 @@ class EmailModule extends PLModule
             'emails/send'     => $this->make_hook('send', AUTH_MDP),
             'emails/antispam/submit'  => $this->make_hook('submit', AUTH_COOKIE),
 
-            'admin/emails/duplicated' => $this->make_hook('duplicated', AUTH_MDP, 'admin')
+            'admin/emails/duplicated' => $this->make_hook('duplicated', AUTH_MDP, 'admin'),
+            'admin/emails/lost' => $this->make_hook('lost', AUTH_MDP, 'admin'),
         );
     }
 
@@ -562,6 +563,18 @@ L'équipe d'administration <support@polytechnique.org>";
             $page->assign('doublon', $props);
         }
     }
+    function handler_lost(&$page, $action = 'list', $email = null)
+    {
+        $page->changeTpl('emails/lost.tpl');
+        
+        $page->assign('lost_emails', XDB::iterator('
+                                       SELECT u.user_id,       a.alias
+                                       FROM auth_user_md5 AS u
+                                               INNER JOIN aliases AS a ON (a.id = u.user_id AND a.type = "a_vie")
+                                               LEFT JOIN emails AS e ON (u.user_id=e.uid AND FIND_IN_SET("active",e.flags))
+                                       WHERE e.uid IS NULL AND u.deces = 0
+                                       ORDER BY u.promo DESC, u.nom, u.prenom'));
+    }
 }
 
 // vim:set et sw=4 sts=4 sws=4 foldmethod=marker enc=utf-8:
index 6763005..ef067d6 100644 (file)
@@ -45,6 +45,8 @@
       &nbsp;&nbsp;|&nbsp;&nbsp;
       <a href="admin/emails/duplicated">Doublons</a>
       &nbsp;&nbsp;|&nbsp;&nbsp;
+      <a href="admin/emails/lost">Perdus de vue</a>
+      &nbsp;&nbsp;|&nbsp;&nbsp;
       <a href="admin/ipwatch">IPs</a>
     </td>
   </tr>
diff --git a/templates/emails/lost.tpl b/templates/emails/lost.tpl
new file mode 100644 (file)
index 0000000..7e8c04e
--- /dev/null
@@ -0,0 +1,37 @@
+{**************************************************************************}
+{*                                                                        *}
+{*  Copyright (C) 2003-2007 Polytechnique.org                             *}
+{*  http://opensource.polytechnique.org/                                  *}
+{*                                                                        *}
+{*  This program is free software; you can redistribute it and/or modify  *}
+{*  it under the terms of the GNU General Public License as published by  *}
+{*  the Free Software Foundation; either version 2 of the License, or     *}
+{*  (at your option) any later version.                                   *}
+{*                                                                        *}
+{*  This program is distributed in the hope that it will be useful,       *}
+{*  but WITHOUT ANY WARRANTY; without even the implied warranty of        *}
+{*  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the         *}
+{*  GNU General Public License for more details.                          *}
+{*                                                                        *}
+{*  You should have received a copy of the GNU General Public License     *}
+{*  along with this program; if not, write to the Free Software           *}
+{*  Foundation, Inc.,                                                     *}
+{*  59 Temple Place, Suite 330, Boston, MA  02111-1307  USA               *}
+{*                                                                        *}
+{**************************************************************************}
+
+<h1>Perdus de vue</h1>
+
+<p>Ces {$lost_emails->total()} camarades n'ont pas ou plus d'adresse email valides</p>
+
+<table class="bicol">
+  <tr>
+    <th>Utilisateur</th>
+  </tr>
+  {iterate from=$lost_emails item="looser"}
+    <tr class="{cycle values="pair,impair"}">
+      <td>
+        <a href="profile/{$looser.alias}" class="popup2">{$looser.alias}</a>
+      </td>
+  {/iterate}
+</table>