Easy access to admin page
[platal.git] / htdocs / admin / ax-xorg.php
1 <?php
2 /***************************************************************************
3 * Copyright (C) 2003-2006 Polytechnique.org *
4 * http://opensource.polytechnique.org/ *
5 * *
6 * This program is free software; you can redistribute it and/or modify *
7 * it under the terms of the GNU General Public License as published by *
8 * the Free Software Foundation; either version 2 of the License, or *
9 * (at your option) any later version. *
10 * *
11 * This program is distributed in the hope that it will be useful, *
12 * but WITHOUT ANY WARRANTY; without even the implied warranty of *
13 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *
14 * GNU General Public License for more details. *
15 * *
16 * You should have received a copy of the GNU General Public License *
17 * along with this program; if not, write to the Free Software *
18 * Foundation, Inc., *
19 * 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA *
20 ***************************************************************************/
21
22 require_once('xorg.inc.php');
23 new_admin_page('admin/ax-xorg.tpl');
24 $page->assign('xorg_title','Polytechnique.org - Administration - AX/X.org');
25
26 // liste des différences
27 $res = XDB::query(
28 'SELECT u.promo,u.nom AS nom,u.prenom AS prenom,ia.nom AS nomax,ia.prenom AS prenomax,u.matricule AS mat,ia.matricule_ax AS matax
29 FROM auth_user_md5 AS u
30 INNER JOIN identification_ax AS ia ON u.matricule_ax = ia.matricule_ax
31 WHERE (SOUNDEX(u.nom) != SOUNDEX(ia.nom) AND SOUNDEX(CONCAT(ia.particule,u.nom)) != SOUNDEX(ia.nom)
32 AND SOUNDEX(u.nom) != SOUNDEX(ia.nom_patro) AND SOUNDEX(CONCAT(ia.particule,u.nom)) != SOUNDEX(ia.nom_patro))
33 OR u.prenom != ia.prenom OR (u.promo != ia.promo AND u.promo != ia.promo+1 AND u.promo != ia.promo-1)
34 ORDER BY u.promo,u.nom,u.prenom');
35 $page->assign('diffs', $res->fetchAllAssoc());
36
37 // gens à l'ax mais pas chez nous
38 $res = XDB::query(
39 'SELECT ia.promo,ia.nom,ia.nom_patro,ia.prenom
40 FROM identification_ax as ia
41 LEFT JOIN auth_user_md5 AS u ON u.matricule_ax = ia.matricule_ax
42 WHERE u.nom IS NULL');
43 $page->assign('mank', $res->fetchAllAssoc());
44
45 // gens chez nous et pas à l'ax
46 $res = XDB::query('SELECT promo,nom,prenom FROM auth_user_md5 WHERE matricule_ax IS NULL');
47 $page->assign('plus', $res->fetchAllAssoc());
48
49
50 $page->run();
51 ?>