Subversion Repositories eFlore/Applications.del

Compare Revisions

Ignore whitespace Rev 2153 → Rev 2154

/trunk/services/bibliotheque/GestionUtilisateur.php
143,7 → 143,7
protected function decoderJeton($jeton) {
$parts = explode('.', $jeton);
$payload = $parts[1];
$payload = base64_decode($payload);
$payload = $this->urlsafeB64Decode($payload);
$payload = json_decode($payload, true);
 
return $payload;
150,6 → 150,22
}
 
/**
* Decode a string with URL-safe Base64.
* copié depuis firebase/jwt
*
* @param string $input A Base64 encoded string
* @return string A decoded string
*/
protected function urlsafeB64Decode($input) {
$remainder = strlen($input) % 4;
if ($remainder) {
$padlen = 4 - $remainder;
$input .= str_repeat('=', $padlen);
}
return base64_decode(strtr($input, '-_', '+/'));
}
 
/**
* Retourne un profil d'utilisateur non connecté (anonyme), avec un identifiant de session
* PHP qui permet de suivre son activité
*/
336,4 → 352,4
}
return $headers;
}
}
}