Rev 580 | Go to most recent revision | Blame | Compare with Previous | Last modification | View Log | RSS feed
<?phprequire "AuthPartner.php";/*** Permet de se connecter à l'annuaire de Tela Botanica à l'aide d'un compte Pl@ntNet / identify*/class AuthPartnerPlantnet extends AuthPartner {public function verifierAcces($login, $password) {$url = "http://identify-test.plantnet-project.org/api/security/token/create?_username=$login&_password=$password";$curl = curl_init();curl_setopt($curl, CURLOPT_URL, $url);curl_setopt($curl, CURLOPT_POST, true);curl_setopt($curl, CURLOPT_RETURNTRANSFER, true);$res = curl_exec($curl);curl_close($curl);$res = json_decode($res, true);//var_dump($res);if (!empty($res['JWT'])) {$jeton = $this->lib->decoderJetonManuellement($res['JWT']);// stockage pour traitement dans les autres méthodes$this->data = $jeton;//var_dump($jeton);if (!empty($jeton['details']['email'])) {//var_dump($jeton['details']['email']);return true;}}return false;}public function getIdentiteParCourriel() {echo "get identité par courriel<br/>";}public function formaterNomWiki() {echo "formater nom wiki<br/>";}public function getDateDerniereModifProfil() {echo "get date dernière modif profil<br/>";}}