Line 453... |
Line 453... |
453 |
protected function recupererUtilisateursIdentite(Array $courriels) {
|
453 |
protected function recupererUtilisateursIdentite(Array $courriels) {
|
454 |
// Récupération des données au format Json
|
454 |
// Récupération des données au format Json
|
455 |
$service = "utilisateur/identite-par-courriel/".implode(',', $courriels);
|
455 |
$service = "utilisateur/identite-par-courriel/".implode(',', $courriels);
|
456 |
$url = sprintf($this->config['settings']['baseURLServicesAnnuaireTpl'], $service);
|
456 |
$url = sprintf($this->config['settings']['baseURLServicesAnnuaireTpl'], $service);
|
457 |
$json = file_get_contents($url);
|
457 |
$json = file_get_contents($url);
|
458 |
$utilisateurs = json_decode($json);
|
458 |
$utilisateurs = json_decode($json, true);
|
459 |
$noms = array();
|
459 |
$noms = array();
|
460 |
foreach ($courriels as $courriel) {
|
460 |
foreach ($courriels as $courriel) {
|
- |
|
461 |
$courriel = strtolower($courriel);
|
461 |
$info = array('id' => null, 'intitule' => '');
|
462 |
$info = array('id' => null, 'intitule' => '');
|
462 |
if (isset($utilisateurs->$courriel)) {
|
463 |
if (isset($utilisateurs[$courriel])) {
|
463 |
$info['intitule'] = $utilisateurs->$courriel->intitule;
|
464 |
$info['intitule'] = $utilisateurs[$courriel]['intitule'];
|
464 |
$info['id'] = $utilisateurs->$courriel->id;
|
465 |
$info['id'] = $utilisateurs[$courriel]['id'];
|
465 |
} else {
|
466 |
} else {
|
466 |
$info['intitule'] = $this->tronquerCourriel($courriel);
|
467 |
$info['intitule'] = $this->tronquerCourriel($courriel);
|
467 |
}
|
468 |
}
|
468 |
$noms[$courriel] = $info;
|
469 |
$noms[$courriel] = $info;
|
469 |
}
|
470 |
}
|
Line 473... |
Line 474... |
473 |
protected function recupererUtilisateursNomPrenom(array $courriels) {
|
474 |
protected function recupererUtilisateursNomPrenom(array $courriels) {
|
474 |
// Récupération des données au format Json
|
475 |
// Récupération des données au format Json
|
475 |
$service = "utilisateur/prenom-nom-par-courriel/".implode(',', $courriels);
|
476 |
$service = "utilisateur/prenom-nom-par-courriel/".implode(',', $courriels);
|
476 |
$url = sprintf($this->config['settings']['baseURLServicesAnnuaireTpl'], $service);
|
477 |
$url = sprintf($this->config['settings']['baseURLServicesAnnuaireTpl'], $service);
|
477 |
$json = file_get_contents($url);
|
478 |
$json = file_get_contents($url);
|
478 |
$utilisateurs = json_decode($json);
|
479 |
$utilisateurs = json_decode($json, true);
|
479 |
foreach ($courriels as $courriel) {
|
480 |
foreach ($courriels as $courriel) {
|
- |
|
481 |
$courriel = strtolower($courriel);
|
480 |
if (isset($utilisateurs->$courriel)) {
|
482 |
if (isset($utilisateurs[$courriel])) {
|
481 |
$noms[$courriel] = $utilisateurs->$courriel->prenom.' '.$utilisateurs->$courriel->nom;
|
483 |
$noms[$courriel] = $utilisateurs[$courriel]['prenom'].' '.$utilisateurs[$courriel]['nom'];
|
482 |
} else {
|
484 |
} else {
|
483 |
$noms[$courriel] = $this->tronquerCourriel($courriel);
|
485 |
$noms[$courriel] = $this->tronquerCourriel($courriel);
|
484 |
}
|
486 |
}
|
485 |
}
|
487 |
}
|
486 |
return $noms;
|
488 |
return $noms;
|