15,10 → 15,6 |
* @license CECILL v2 <http://www.cecill.info/licences/Licence_CeCILL_V2-en.txt> |
* @copyright 1999-2014 Tela Botanica <accueil@tela-botanica.org> |
*/ |
/* |
* Paramètres: date.debut et date.fin (unixtime en secondes), navigation.limite (10 par défaut), navigation.depart, ordre (DESC par défaut) |
* Ne pas Oublier l'api key dans le header $_SERVER['HTTP_API_KEY'] |
*/ |
class PlantNet extends RestService { |
|
private $parametres = array(); |
66,18 → 62,9 |
$service = null; |
foreach ($chemins as $chemin) { |
if (file_exists($chemin)) { |
$authorized_key = $this->conteneur->getParametre('api.key'); |
// Vérification de la clé API (et oui je sais, c'est relou, mais il faut bien commencer à sécuriser nos webservices) |
if ($_SERVER['HTTP_API_KEY'] == $authorized_key){ |
require_once $chemin; |
$service = new $classe($this->conteneur); |
$retour = $service->consulter($this->ressources, $this->parametres); |
} else { |
$message = "Accès au service '{$this->projetNom}' refusé, veuillez vérifier votre clé API."; |
$code = RestServeur::HTTP_CODE_ERREUR; |
throw new Exception($message, $code); |
} |
|
require_once $chemin; |
$service = new $classe($this->conteneur); |
$retour = $service->consulter($this->ressources, $this->parametres); |
} |
} |
|
Property changes: |
Deleted: svn:mergeinfo |
Reverse-merged /branches/v1.7-oxygene/services/modules/0.1/Plantnet.php:r2003,2006-2007,2009-2010 |
Reverse-merged /branches/v1.3-beryllium/services/modules/0.1/Plantnet.php:r1753,1758 |
Reverse-merged /branches/v1.6-azote/services/modules/0.1/Plantnet.php:r1988 |
Reverse-merged /trunk/services/modules/0.1/Plantnet.php:r2222,2226 |
Reverse-merged /branches/v1.2-lithium/services/modules/0.1/Plantnet.php:r1676 |
Reverse-merged /branches/v1.5-carbone/services/modules/0.1/Plantnet.php:r1893-1921,1942 |
Reverse-merged /branches/v1.10-sodium/services/modules/0.1/Plantnet.php:r2096,2116,2120,2138-2139,2143,2145 |
Reverse-merged /branches/v1.0-hydrogene/services/modules/0.1/Plantnet.php:r1507 |