From 1c48c2a9ad4d2e01e126c43fa97f5282f2a800f5 Mon Sep 17 00:00:00 2001 From: Vincent Zanotti Date: Thu, 20 Mar 2008 01:03:03 +0100 Subject: [PATCH] Adds a listing page for dead user with not yet disabled accounts. Signed-off-by: Vincent Zanotti --- modules/admin.php | 15 +++++++++ templates/admin/dead_but_active.tpl | 61 +++++++++++++++++++++++++++++++++++++ templates/admin/index.tpl | 2 ++ 3 files changed, 78 insertions(+) create mode 100644 templates/admin/dead_but_active.tpl diff --git a/modules/admin.php b/modules/admin.php index af011ea..92a2107 100644 --- a/modules/admin.php +++ b/modules/admin.php @@ -27,6 +27,7 @@ class AdminModule extends PLModule 'phpinfo' => $this->make_hook('phpinfo', AUTH_MDP, 'admin'), 'admin' => $this->make_hook('default', AUTH_MDP, 'admin'), 'admin/ax-xorg' => $this->make_hook('ax_xorg', AUTH_MDP, 'admin'), + 'admin/dead-but-active' => $this->make_hook('dead_but_active', AUTH_MDP, 'admin'), 'admin/deaths' => $this->make_hook('deaths', AUTH_MDP, 'admin'), 'admin/downtime' => $this->make_hook('downtime', AUTH_MDP, 'admin'), 'admin/homonyms' => $this->make_hook('homonyms', AUTH_MDP, 'admin'), @@ -835,6 +836,20 @@ class AdminModule extends PLModule $page->assign('decedes', $res); } + function handler_dead_but_active(&$page) { + $page->changeTpl('admin/dead_but_active.tpl'); + $page->assign('xorg_title','Polytechnique.org - Administration - Décédés'); + + $res = XDB::iterator( + "SELECT u.promo, u.nom, u.prenom, u.deces, u.matricule_ax, a.alias, + DATEDIFF(NOW(), u.deces) AS days + FROM auth_user_md5 AS u + LEFT JOIN aliases AS a ON (a.id = u.user_id AND a.type = 'a_vie') + WHERE perms IN ('admin', 'user') AND deces <> 0 + ORDER BY u.promo, u.nom"); + $page->assign('dead', $res); + } + function handler_synchro_ax(&$page, $user = null, $action = null) { $page->changeTpl('admin/synchro_ax.tpl'); $page->assign('xorg_title','Polytechnique.org - Administration - Synchro AX'); diff --git a/templates/admin/dead_but_active.tpl b/templates/admin/dead_but_active.tpl new file mode 100644 index 0000000..cb3813c --- /dev/null +++ b/templates/admin/dead_but_active.tpl @@ -0,0 +1,61 @@ +{**************************************************************************} +{* *} +{* Copyright (C) 2003-2008 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 *} +{* *} +{**************************************************************************} + +

Décédés encore actifs

+ +

+ Liste des polytechniciens décédés, mais dont le compte est encore actif + (veufs/veuves, ...). +

+ + + + + + + + + {iterate from=$dead item=d} + + + + + + + + {/iterate} +
PromotionÉtat civilDate de décèsdepuis
{$d.promo} + {icon name=user_suit title='Afficher la fiche'} + {* + *}{icon name=user_gray title="fiche AX"} + {icon name=wrench title='Administrer user'} + {$d.prenom} {$d.nom}{$d.deces} + {if $d.days gt 730} + {$d.days/365|string_format:"%d"} ans + {elseif $d.days gt 365} + 1 an + {else} + {$d.days/30.5|string_format:"%d"} mois + {/if} +
+ +{* vim:set et sw=2 sts=2 sws=2 enc=utf-8: *} diff --git a/templates/admin/index.tpl b/templates/admin/index.tpl index fe4dd82..13f0d5d 100644 --- a/templates/admin/index.tpl +++ b/templates/admin/index.tpl @@ -69,6 +69,8 @@   |   Décès   |   + Décédés actifs +   |   Synchro AX -- 2.1.4