448 |
ddelon |
1 |
<?php
|
|
|
2 |
/*vim: set expandtab tabstop=4 shiftwidth=4: */
|
|
|
3 |
// +------------------------------------------------------------------------------------------------------+
|
|
|
4 |
// | PHP version 4.1 |
|
|
|
5 |
// +------------------------------------------------------------------------------------------------------+
|
|
|
6 |
// | Copyright (C) 2004 Tela Botanica (accueil@tela-botanica.org) |
|
|
|
7 |
// +------------------------------------------------------------------------------------------------------+
|
|
|
8 |
// | This library is free software; you can redistribute it and/or |
|
|
|
9 |
// | modify it under the terms of the GNU Lesser General Public |
|
|
|
10 |
// | License as published by the Free Software Foundation; either |
|
|
|
11 |
// | version 2.1 of the License, or (at your option) any later version. |
|
|
|
12 |
// | |
|
|
|
13 |
// | This library is distributed in the hope that it will be useful, |
|
|
|
14 |
// | but WITHOUT ANY WARRANTY; without even the implied warranty of |
|
|
|
15 |
// | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU |
|
|
|
16 |
// | Lesser General Public License for more details. |
|
|
|
17 |
// | |
|
|
|
18 |
// | You should have received a copy of the GNU Lesser General Public |
|
|
|
19 |
// | License along with this library; if not, write to the Free Software |
|
|
|
20 |
// | Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA |
|
|
|
21 |
// +------------------------------------------------------------------------------------------------------+
|
1428 |
alexandre_ |
22 |
// CVS : $Id: annuaire_backoffice.php,v 1.7 2007-06-01 13:39:52 alexandre_tb Exp $
|
448 |
ddelon |
23 |
/**
|
|
|
24 |
* programme principal du module annuaire_moteur
|
|
|
25 |
*
|
|
|
26 |
* programme principal du module annuaire_moteur
|
|
|
27 |
*
|
|
|
28 |
*@package annuaire
|
|
|
29 |
//Auteur original :
|
|
|
30 |
*@author Alexandre Granier <alexandre@tela-botanica.org>
|
|
|
31 |
//Autres auteurs :
|
|
|
32 |
*@author Aucun
|
|
|
33 |
*@copyright Tela-Botanica 2000-2004
|
1428 |
alexandre_ |
34 |
*@version $Revision: 1.7 $
|
448 |
ddelon |
35 |
// +------------------------------------------------------------------------------------------------------+
|
|
|
36 |
*/
|
|
|
37 |
|
|
|
38 |
// +------------------------------------------------------------------------------------------------------+
|
|
|
39 |
// | ENTETE du PROGRAMME |
|
|
|
40 |
// +------------------------------------------------------------------------------------------------------+
|
1292 |
neiluj |
41 |
|
1428 |
alexandre_ |
42 |
|
679 |
alexandre_ |
43 |
include_once 'configuration/bottin.config.inc.php';
|
1428 |
alexandre_ |
44 |
|
448 |
ddelon |
45 |
include_once INS_CHEMIN_APPLI.'bibliotheque/annuaire_backoffice.fonct.php';
|
679 |
alexandre_ |
46 |
include_once INS_CHEMIN_APPLI.'bibliotheque/inscription.class.php';
|
|
|
47 |
include_once INS_CHEMIN_APPLI.'bibliotheque/inscription.fonct.php';
|
1428 |
alexandre_ |
48 |
include_once INS_CHEMIN_APPLI.'bibliotheque/bottin.fonct.php';
|
|
|
49 |
|
1298 |
neiluj |
50 |
$lang=INS_LANGUE_DEFAUT;
|
|
|
51 |
define ("ANN_MAIL_TOUS", 1) ;
|
|
|
52 |
define ("ANN_MAIL_TOUS_ENVOIE", 2) ;
|
1292 |
neiluj |
53 |
|
1428 |
alexandre_ |
54 |
// Action pour valider une demande d inscription
|
|
|
55 |
define ('ANN_ACTION_VALIDER_INSCRIPTION', 3);
|
|
|
56 |
|
|
|
57 |
// Action pour supprimer une demande d inscription
|
|
|
58 |
define ('ANN_ACTION_SUPPRIMER_DEMANDE_INSCRIPTION', 4);
|
|
|
59 |
|
|
|
60 |
// Action pour supprimer un inscrit
|
|
|
61 |
define ('ANN_ACTION_SUPPRIMER_INSCRIT', 5);
|
|
|
62 |
|
|
|
63 |
// TODO: Nom de la variable action, a modifier dans le programme
|
|
|
64 |
define ('ANN_VARIABLE_ACTION', 'action');
|
|
|
65 |
define ('INS_VARIABLE_ID_DEMANDEUR', 'id_demandeur');
|
|
|
66 |
define ('INS_VARIABLE_ID_INSCRIT', 'id_inscrit');
|
|
|
67 |
|
1298 |
neiluj |
68 |
// Recherche parametres menu actif : ils ne sont pas present dans le contexte, quel dommage !
|
|
|
69 |
$requete_menu = 'SELECT gm_application_arguments '.
|
|
|
70 |
'FROM gen_menu '.
|
|
|
71 |
'WHERE gm_id_menu = '.$_GET['menu'];
|
|
|
72 |
$resultat_menu = $GLOBALS['_GEN_commun']['pear_db']->query($requete_menu);
|
|
|
73 |
$info_menu = $resultat_menu->fetchRow(DB_FETCHMODE_OBJECT);
|
|
|
74 |
$resultat_menu->free();
|
|
|
75 |
if (isset($info_menu->gm_application_arguments)) {
|
|
|
76 |
$arguments = explode(' ', $info_menu->gm_application_arguments);
|
|
|
77 |
for ($i = 0; $i < count($arguments); $i++) {
|
|
|
78 |
$attr = explode('=', $arguments[$i]);
|
|
|
79 |
if ($attr[0] != '') {
|
|
|
80 |
$info_application->$attr[0] = (isset($attr[1]) ? $attr[1] : '');
|
|
|
81 |
}
|
|
|
82 |
}
|
1292 |
neiluj |
83 |
}
|
1298 |
neiluj |
84 |
//cas de l'annuaire admin papyrus, on modifie certaines constantes
|
1428 |
alexandre_ |
85 |
if (isset ($info_application->type_annuaire) && $info_application->type_annuaire==1) {
|
1298 |
neiluj |
86 |
include_once INS_CHEMIN_APPLI.'configuration/annuaire_backoffice.config.inc.php';
|
1292 |
neiluj |
87 |
}
|
1428 |
alexandre_ |
88 |
// recuperation de la configuration
|
|
|
89 |
include_once INS_CHEMIN_APPLI.'bibliotheque/bottin.class.php';
|
|
|
90 |
$GLOBALS['ins_config'] = inscription::getConfig();
|
1292 |
neiluj |
91 |
|
1428 |
alexandre_ |
92 |
// +------------------------------------------------------------------------------------------------------+
|
|
|
93 |
// | CORPS du PROGRAMME |
|
|
|
94 |
// +------------------------------------------------------------------------------------------------------+
|
448 |
ddelon |
95 |
function afficherContenuCorps () {
|
1428 |
alexandre_ |
96 |
$res = '';
|
448 |
ddelon |
97 |
if (!$GLOBALS['AUTH']->getAuth()) {
|
1428 |
alexandre_ |
98 |
$res .= AUTH_formulaire_login() ;
|
448 |
ddelon |
99 |
} else {
|
679 |
alexandre_ |
100 |
if (isset($_REQUEST[INS_CHAMPS_ID])) {
|
|
|
101 |
include_once (INS_CHEMIN_APPLI.'bibliotheque/edition_fiche.php');
|
|
|
102 |
$GLOBALS['ins_url']->addQueryString (INS_CHAMPS_ID, $_REQUEST[INS_CHAMPS_ID]) ;
|
448 |
ddelon |
103 |
return putFrame() ;
|
|
|
104 |
}
|
1428 |
alexandre_ |
105 |
|
|
|
106 |
// Les actions 1 => envoie d un mail a tous
|
|
|
107 |
// 2 => valider une demande d inscription
|
|
|
108 |
// 3 => supprimer une demande d inscription
|
|
|
109 |
// 5 => supprimer un inscrit
|
|
|
110 |
if (isset ($_GET[ANN_VARIABLE_ACTION])) {
|
|
|
111 |
switch ($_GET[ANN_VARIABLE_ACTION]) {
|
|
|
112 |
case ANN_MAIL_TOUS :
|
|
|
113 |
case ANN_MAIL_TOUS_ENVOIE :
|
|
|
114 |
include_once (INS_CHEMIN_APPLI.'bibliotheque/mail_tous.php') ;
|
|
|
115 |
return putFrame() ;
|
|
|
116 |
break;
|
|
|
117 |
case ANN_ACTION_VALIDER_INSCRIPTION : $res .= inscription::validerInscription();
|
|
|
118 |
break;
|
|
|
119 |
case ANN_ACTION_SUPPRIMER_DEMANDE_INSCRIPTION: $res .= inscription::supprimerDemandeInscription();
|
|
|
120 |
break;
|
|
|
121 |
case ANN_ACTION_SUPPRIMER_INSCRIT : $res .= inscription::supprimerInscription();
|
|
|
122 |
break;
|
|
|
123 |
}
|
448 |
ddelon |
124 |
}
|
679 |
alexandre_ |
125 |
if (isset($_REQUEST['ajouter'])) {
|
|
|
126 |
return ajouterInscrit() ;
|
|
|
127 |
}
|
1428 |
alexandre_ |
128 |
$res .= "<div>".mkengine()."</div>\n" ;
|
|
|
129 |
|
|
|
130 |
// Liste des inscrits en attente de moderation
|
|
|
131 |
$res .= '<h1>'.INS_EN_ATTENTE_DE_MODERATION.'</h1>';
|
|
|
132 |
//$res .= print_r(inscription::getInscritEnAttenteModeration(), true);
|
|
|
133 |
$res .= inscription::getTableauEnAttente((inscription::getInscritEnAttenteModeration()));
|
|
|
134 |
|
448 |
ddelon |
135 |
}
|
|
|
136 |
return $res ;
|
|
|
137 |
}
|
|
|
138 |
|
|
|
139 |
?>
|