Subversion Repositories Sites.obs-saisons.fr

Rev

Go to most recent revision | Details | Last modification | View Log | RSS feed

Rev Author Line No. Line
1 aurelien 1
<?php
2
// +----------------------------------------------------------------------------+
3
// |car_config.inc.php                                                            |
4
// +----------------------------------------------------------------------------+
5
// | Copyright (c) 2004 Tela Botanica                                            |
6
// +----------------------------------------------------------------------------+
7
// | Le module d'inscription amélioré, configuration                            |
8
// +----------------------------------------------------------------------------+
9
// | Auteur : Alexandre Granier <alexandre@tela-botanica.org>                     |
10
// +----------------------------------------------------------------------------+
11
//
12
// $Id: car_config.inc.php,v 1.1 2004/11/30 13:37:13 tam Exp $
13
 
14
// Paramêtres indiquant que l'on est en français pourpermettre la mise en majuscule des caractères accentués
15
setlocale(LC_CTYPE, "fr_FR");
16
 
17
//chemin relatif d'acces a la carto
18
define ('CAR_CHEMIN_APPLI', 'modules'.DIRECTORY_SEPARATOR);
19
 
20
//bouh! c'est pas propre! c'est a cause de PEAR et de ses includes
21
set_include_path(CAR_CHEMIN_APPLI.'configuration/'.PATH_SEPARATOR.get_include_path());
22
 
23
//librairies PEAR
24
require_once CAR_CHEMIN_APPLI.'configuration/DB.php' ;
25
require_once CAR_CHEMIN_APPLI.'configuration/URL.php' ;
26
include_once CAR_CHEMIN_APPLI.'configuration/Auth.php' ;
27
 
28
//langues
29
if (isset($lang)) {
30
    include_once CAR_CHEMIN_APPLI.'langues/car_langue_$lang.inc.php' ;
31
} else {
32
    include_once CAR_CHEMIN_APPLI.'langues/car_langue_fr.inc.php' ;
33
}
34
 
35
//url du chemin de la librairie de fichier php
36
define("CAR_CHEMIN_LIBRAIRIE", 'http://obs-saisons.fr/modules/bibliotheque/');
37
//define("CAR_CHEMIN_LIBRAIRIE", 'http://localhost/david/ods/modules/bibliotheque/');
38
 
39
//url de l'inscription
40
define("CAR_CHEMIN_INSCRIPTION","http://obs-saisons.fr/article.php3?id_article=1");
41
//define("CAR_CHEMIN_INSCRIPTION","http://localhost/david/ods/article.php3?id_article=1");
42
 
43
/**
44
//=========================DEFINITION DE VARIABLES =================================
45
* Définition des variables globales
46
//==================================================================================
47
*/
48
 
49
//==================================== LES URLS ====================================
50
 
51
/** Variable globale contenant l'objet d'accès à l'URL de base de l'application, un objet Net_URL*/
52
//$GLOBALS['car_url'] = new Net_URL('http://obs-saisons.fr/article.php3?id_article='.$_GET['id_article']);
53
//$GLOBALS['car_url'] = new Net_URL('http://localhost/david/ods/article.php3?id_article='.$_GET['id_article']);
54
 
55
$GLOBALS['car_url'] = new Net_URL($_SERVER['REQUEST_URI']);
56
 
57
//=============================== LA BASE DE DONNEES ===============================
58
// Connection a la base de donnee
59
 
60
$dsn='mysql://'.$login.':'.$pass.'@'.$hote.'/'.$db;
61
$GLOBALS['car_db'] =& DB::connect($dsn) ;
62
 
63
//=============================== AUTHENTIFICATION =================================
64
 
65
// Fonction d'identification par PEAR Auth
66
function loginFunction($username = null, $status = null, $auth = null)
67
{
68
	$url = $GLOBALS['car_url'];
69
	if (isset($GLOBALS['historique_cartes'])) $url->addQueryString('historique_cartes', $GLOBALS['historique_cartes']);
70
 
71
 
72
 
73
    $res  = "<h3 class=\"titre2_cartographie\">".CAR_TEXTE_IDENTIFICATION_1."</h3>";
74
    $res .= "<form method=\"post\" action=\"".$GLOBALS['car_url']->getURL()."\">\n";
75
    $res .= "<table border=\"0\">";
76
	$res .= "<tr><td colspan=\"2\">&nbsp;</td></tr>";
77
	$res .= "<tr><td colspan=\"2\">&nbsp;</td></tr>";
78
	$res .= "<tr><td>Identifiant</td><td><input type=\"text\" name=\"username\"></td></tr>";
79
	$res .= "<tr><td>Mot de passe &nbsp;</td><td><input type=\"password\" name=\"password\"></td></tr>";
80
	$res .= "<tr><td colspan=\"2\" align=\"right\"><input type=\"submit\" class=\"submit\" value=\"Je me connecte\"></td></tr>";
81
	$res .= "<tr><td colspan=\"2\"><a href=\"".$GLOBALS['car_url']->getURL()."\">J'ai oublié mon mot de passe</a></td></tr>";
82
	$res .= "<tr><td><a href=\"inscription\">S'inscrire</a></td></tr>";
83
	$res .= "</form>\n";
84
 
85
 
86
	return $res;
87
}
88
 
89
$params = array(
90
"dsn" => $dsn ,
91
"table" => 'PARTICIPANT' ,
92
"usernamecol" => 'PARTICIPANT_PSEUDO' ,
93
"passwordcol" => 'PARTICIPANT_MOTDEPASSE',
94
"cryptType" => 'none',
95
"db_fields"=>'*'
96
);
97
 
98
if (isset($_GET['act']) && $_GET['act'] == "login") {
99
     $optional = true;
100
} else {
101
     $optional = false;
102
}
103
$GLOBALS['car_auth'] = new Auth("DB", $params, "loginFunction", $optional);
104
 
105
 
106
/**
107
//==================================== CONSTANTES ==================================
108
* Constantes des noms de tables et de champs dans l'annuaire
109
//==================================================================================
110
*/
111
define ("CAR_ANNUAIRE", "PARTICIPANT") ;
112
define ("CAR_CHAMPS_NOM", "PARTICIPANT_NOM") ;                   // Nom du champs nom
113
define ("CAR_CHAMPS_MAIL", "PARTICIPANT_EMAIL") ;                  // Nom du champs mail
114
define ("CAR_CHAMPS_PRENOM", "PARTICIPANT_PRENOM") ;             // Nom du champs prénom
115
define ("CAR_CHAMPS_CE_PAYS", "PAYS_ID") ;
116
define ("CAR_CHAMPS_DPT", " DEPARTEMENT_ID") ;
117
define ("CAR_CHAMPS_ID", "PARTICIPANT_ID") ;
118
define ("CAR_CHAMPS_DATE_INS", "PARTICIPANT_DATE_INSCRIPTION") ;
119
define ("CAR_CHAMPS_CODE_POSTAL", "PARTICIPANT_CODE_POSTAL") ;
120
define ("CAR_CHAMPS_VILLE", "PARTICIPANT_VILLE") ;
121
define ("CAR_CHAMPS_ADRESSE", "PARTICIPANT_ADRESSE") ;
122
define ('CAR_CHAMPS_LETTRE', 'PARTICIPANT_RECEVOIR_NEWSLETTER');
123
define ('CAR_CHAMPS_VISIBLE', 'PARTICIPANT_NOM_PRENOM_VISIBLE');
124
define ("CAR_TABLE_DPT", "carto_DEPARTEMENT") ;           // Nom de la table département
125
define ('CAR_CHAMPS_CARTO_DEP', 'CD_ID_Departement');
126
define ('CAR_CHAMPS_NOM_DEP', 'CD_Intitule_departement');
127
define ("CAR_TABLE_PAYS", "carto_PAYS") ;             // Nom de la table pays
128
define ("CAR_CHAMPS_ID_PAYS", "CP_ID_Pays");
129
define ("CAR_CHAMPS_NOM_PAYS", "CP_Intitule_pays");
130
/**
131
//==================================== CONSTANTES ==================================
132
* Constantes
133
//==================================================================================
134
**/
135
/** Constante de préfixe des mails envoyés */
136
define('CAR_PREFIXE_MAIL','[Observatoire des Saisons] ');
137
/** Variable définissant la lettre par défaut du parcour alphabétique.*/
138
define('CAR_LETTRE_DEFAUT', 'a') ;// une lettre de l'aphabet ou "tous"
139
/** Variable définissant si oui ou non on affiche l'entrée "tous" dans le parcour alphabétique.*/
140
define('CAR_TOUS_BOOL', true) ;// true ou false
141
 
142
/** Variable definissant le niveau de zoom de depart */
143
 
144
define('CAR_ECHELLE_DEPART', "continent*europe*france") ;// ex : continent ou continent*europe ou continent*europe*france
145
 
146
/** Tableau global contenant les mails des administrateurs. */
147
// Liste des personne recevant le mail après envoie de courriel par l'annuaire
148
$GLOBALS['mail_admin'] = array ('david.delon@clapas.net, carto@obs-saisons.fr');
149
 
150
 
151
 
152
// Liste des personne pouvant se connecter à l'annuaire general
153
$GLOBALS['pseudo_annu'] = array ('david.delon','violette');
154
 
155
 
156
/** Constante spécifique à l'ODS : choisir entre inscription adulte et inscription junior. */
157
// Pour l'ODS : les participants sont'ils des adultes (1) ou des enfants (0)
158
define ('PARTICIPANT_EST_ADULTE',1);
159
 
160
/** Requete personnalisée supplémentaire pour l'annuaire et la carto. */
161
// Bout supplémentaire de requète MySQL pour préciser des options pour l'affichage
162
define ('SQL_SUPPLEMENTAIRE',' PARTICIPANT_ADULTE='.PARTICIPANT_EST_ADULTE.' ');
163
 
164
?>