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 |
// +------------------------------------------------------------------------------------------------------+
|
1467 |
alexandre_ |
22 |
// CVS : $Id: annuaire_backoffice.php,v 1.8 2007-06-25 09:59:03 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
|
1467 |
alexandre_ |
34 |
*@version $Revision: 1.8 $
|
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();
|
1467 |
alexandre_ |
91 |
// Template du formulaire
|
|
|
92 |
$GLOBALS['ins_config']['ic_inscription_template'] = inscription::getTemplate(INS_TEMPLATE_FORMULAIRE,
|
|
|
93 |
$GLOBALS['ins_config']['ic_id_inscription']);
|
1292 |
neiluj |
94 |
|
1428 |
alexandre_ |
95 |
// +------------------------------------------------------------------------------------------------------+
|
|
|
96 |
// | CORPS du PROGRAMME |
|
|
|
97 |
// +------------------------------------------------------------------------------------------------------+
|
448 |
ddelon |
98 |
function afficherContenuCorps () {
|
1428 |
alexandre_ |
99 |
$res = '';
|
448 |
ddelon |
100 |
if (!$GLOBALS['AUTH']->getAuth()) {
|
1428 |
alexandre_ |
101 |
$res .= AUTH_formulaire_login() ;
|
448 |
ddelon |
102 |
} else {
|
679 |
alexandre_ |
103 |
if (isset($_REQUEST[INS_CHAMPS_ID])) {
|
|
|
104 |
include_once (INS_CHEMIN_APPLI.'bibliotheque/edition_fiche.php');
|
|
|
105 |
$GLOBALS['ins_url']->addQueryString (INS_CHAMPS_ID, $_REQUEST[INS_CHAMPS_ID]) ;
|
448 |
ddelon |
106 |
return putFrame() ;
|
|
|
107 |
}
|
1428 |
alexandre_ |
108 |
|
|
|
109 |
// Les actions 1 => envoie d un mail a tous
|
|
|
110 |
// 2 => valider une demande d inscription
|
|
|
111 |
// 3 => supprimer une demande d inscription
|
|
|
112 |
// 5 => supprimer un inscrit
|
|
|
113 |
if (isset ($_GET[ANN_VARIABLE_ACTION])) {
|
|
|
114 |
switch ($_GET[ANN_VARIABLE_ACTION]) {
|
|
|
115 |
case ANN_MAIL_TOUS :
|
|
|
116 |
case ANN_MAIL_TOUS_ENVOIE :
|
|
|
117 |
include_once (INS_CHEMIN_APPLI.'bibliotheque/mail_tous.php') ;
|
|
|
118 |
return putFrame() ;
|
|
|
119 |
break;
|
|
|
120 |
case ANN_ACTION_VALIDER_INSCRIPTION : $res .= inscription::validerInscription();
|
|
|
121 |
break;
|
|
|
122 |
case ANN_ACTION_SUPPRIMER_DEMANDE_INSCRIPTION: $res .= inscription::supprimerDemandeInscription();
|
|
|
123 |
break;
|
|
|
124 |
case ANN_ACTION_SUPPRIMER_INSCRIT : $res .= inscription::supprimerInscription();
|
|
|
125 |
break;
|
|
|
126 |
}
|
448 |
ddelon |
127 |
}
|
679 |
alexandre_ |
128 |
if (isset($_REQUEST['ajouter'])) {
|
|
|
129 |
return ajouterInscrit() ;
|
|
|
130 |
}
|
1428 |
alexandre_ |
131 |
$res .= "<div>".mkengine()."</div>\n" ;
|
|
|
132 |
|
|
|
133 |
// Liste des inscrits en attente de moderation
|
|
|
134 |
$res .= '<h1>'.INS_EN_ATTENTE_DE_MODERATION.'</h1>';
|
|
|
135 |
//$res .= print_r(inscription::getInscritEnAttenteModeration(), true);
|
|
|
136 |
$res .= inscription::getTableauEnAttente((inscription::getInscritEnAttenteModeration()));
|
|
|
137 |
|
448 |
ddelon |
138 |
}
|
|
|
139 |
return $res ;
|
|
|
140 |
}
|
|
|
141 |
|
|
|
142 |
?>
|