Line 6... |
Line 6... |
6 |
* Utilisation: http://www.tela-botanica.org/widget:reseau:remarques
|
6 |
* Utilisation: http://www.tela-botanica.org/widget:reseau:remarques
|
7 |
* Paramètres GET (optionnels):
|
7 |
* Paramètres GET (optionnels):
|
8 |
* pageSource : URL de la page depuis laquelle l'utilisateur a cliqué sur "nous contacter"
|
8 |
* pageSource : URL de la page depuis laquelle l'utilisateur a cliqué sur "nous contacter"
|
9 |
* (exemple: http://www.tela-botanica.org/appli:cel)
|
9 |
* (exemple: http://www.tela-botanica.org/appli:cel)
|
10 |
* service : service à l'adresse duquel envoyer le rapport, par défaut webmestre,
|
10 |
* service : service à l'adresse duquel envoyer le rapport, par défaut webmestre,
|
11 |
* limité aux clefs de la liste self::$servicesAutorises
|
11 |
* limité aux clefs de la liste $this->servicesAutorises
|
12 |
* (exemple: cel)
|
12 |
* (exemple: cel)
|
13 |
* email (DÉPRÉCIÉ) : adresse à laquelle envoyer le rapport, par défaut webmestre@tela-botanica.org,
|
13 |
* email (DÉPRÉCIÉ) : adresse à laquelle envoyer le rapport, par défaut webmestre@tela-botanica.org,
|
14 |
* limité aux valeurs de la liste self::$servicesAutorises
|
14 |
* limité aux valeurs de la liste $this->servicesAutorises
|
15 |
* (exemple: cel_remarques@tela-botanica.org)
|
15 |
* (exemple: cel_remarques@tela-botanica.org)
|
16 |
* lang : langage (un squelette correspondant doit exister)
|
16 |
* lang : langage (un squelette correspondant doit exister)
|
17 |
* (exemple: en)
|
17 |
* (exemple: en)
|
18 |
*
|
18 |
*
|
19 |
* @author Mathias Chouet <mathias@tela-botanica.org>
|
19 |
* @author Mathias Chouet <mathias@tela-botanica.org>
|
Line 30... |
Line 30... |
30 |
* service de destination par défaut, si un service ou une adresse non autorisés sont spécifiés,
|
30 |
* service de destination par défaut, si un service ou une adresse non autorisés sont spécifiés,
|
31 |
* ou si aucun service ni adresse n'est spécifié
|
31 |
* ou si aucun service ni adresse n'est spécifié
|
32 |
*/
|
32 |
*/
|
33 |
const SERVICE_PAR_DEFAUT = 'webmestre';
|
33 |
const SERVICE_PAR_DEFAUT = 'webmestre';
|
Line 34... |
Line -... |
34 |
|
- |
|
35 |
/**
|
34 |
|
36 |
* liste des adresses de destination autorisées
|
- |
|
37 |
*/
|
35 |
/** liste des adresses de destination autorisées (à régler dans la config) */
|
38 |
private static $servicesAutorises = array(
|
- |
|
39 |
'eflore' => 'eflore_remarques@tela-botanica.org',
|
- |
|
40 |
'pictoflora' => 'pictoflora_remarques@tela-botanica.org',
|
- |
|
41 |
'identiplante' => 'identiplante_remarques@tela-botanica.org',
|
- |
|
42 |
'cel' => 'cel_remarques@tela-botanica.org',
|
- |
|
43 |
'coel' => 'coel_remarques@tela-botanica.org',
|
- |
|
44 |
'webmestre' => 'webmestre@tela-botanica.org',
|
- |
|
45 |
'accueil' => 'accueil@tela-botanica.org',
|
- |
|
46 |
'smartflore' => 'smartflore@tela-botanica.org'
|
- |
|
Line 47... |
Line 36... |
47 |
);
|
36 |
protected $servicesAutorises;
|
48 |
|
37 |
|
49 |
protected $cheminLog;
|
38 |
protected $cheminLog;
|
50 |
protected $pageSource;
|
39 |
protected $pageSource;
|
Line 61... |
Line 50... |
61 |
protected $coordonnees;
|
50 |
protected $coordonnees;
|
Line 62... |
Line 51... |
62 |
|
51 |
|
63 |
public function __construct($config, $parametres) {
|
52 |
public function __construct($config, $parametres) {
|
Line -... |
Line 53... |
- |
|
53 |
parent::__construct($config, $parametres);
|
- |
|
54 |
|
64 |
parent::__construct($config, $parametres);
|
55 |
$this->servicesAutorises = $this->config['remarques-services'];
|
65 |
|
56 |
|
66 |
$this->pageSource = 'inconnue';
|
57 |
$this->pageSource = 'inconnue';
|
67 |
$this->serviceDestination = self::SERVICE_PAR_DEFAUT;
|
58 |
$this->serviceDestination = self::SERVICE_PAR_DEFAUT;
|
Line 68... |
Line 59... |
68 |
$this->emailDestination = self::$servicesAutorises[self::SERVICE_PAR_DEFAUT];
|
59 |
$this->emailDestination = $this->servicesAutorises[self::SERVICE_PAR_DEFAUT];
|
69 |
$this->action = null;
|
60 |
$this->action = null;
|
70 |
|
61 |
|
Line 122... |
Line 113... |
122 |
if (isset($_GET['lang']) && $_GET['lang'] != '') {
|
113 |
if (isset($_GET['lang']) && $_GET['lang'] != '') {
|
123 |
$this->langue = $_GET['lang'];
|
114 |
$this->langue = $_GET['lang'];
|
124 |
} else {
|
115 |
} else {
|
125 |
$this->langue = $this->langueDefaut;
|
116 |
$this->langue = $this->langueDefaut;
|
126 |
}
|
117 |
}
|
127 |
if (isset($_GET['service']) && in_array($_GET['service'], array_keys(self::$servicesAutorises))) {
|
118 |
if (isset($_GET['service']) && in_array($_GET['service'], array_keys($this->servicesAutorises))) {
|
128 |
$this->serviceDestination = $_GET['service'];
|
119 |
$this->serviceDestination = $_GET['service'];
|
129 |
$this->emailDestination = self::$servicesAutorises[$_GET['service']];
|
120 |
$this->emailDestination = $this->servicesAutorises[$_GET['service']];
|
130 |
} else {
|
121 |
} else {
|
131 |
// Rétrocompatibilité (déprécié)
|
122 |
// Rétrocompatibilité (déprécié)
|
132 |
if (isset($_GET['email']) && in_array($_GET['email'], self::$servicesAutorises)) {
|
123 |
if (isset($_GET['email']) && in_array($_GET['email'], $this->servicesAutorises)) {
|
133 |
$this->emailDestination = $_GET['email'];
|
124 |
$this->emailDestination = $_GET['email'];
|
134 |
$this->serviceDestination = array_search($_GET['email'], self::$servicesAutorises);
|
125 |
$this->serviceDestination = array_search($_GET['email'], $this->servicesAutorises);
|
135 |
}
|
126 |
}
|
136 |
}
|
127 |
}
|
137 |
if (isset($_POST['action']) && $_POST['action'] != '') {
|
128 |
if (isset($_POST['action']) && $_POST['action'] != '') {
|
138 |
$this->action = $_POST['action'];
|
129 |
$this->action = $_POST['action'];
|
139 |
}
|
130 |
}
|