Subversion Repositories eFlore/Applications.cel

Rev

Rev 1280 | Rev 1386 | Go to most recent revision | Show entire file | Ignore whitespace | Details | Blame | Last modification | View Log | RSS feed

Rev 1280 Rev 1338
Line 521... Line 521...
521
	protected function recupererUtilisateursIdentite(Array $courriels) {
521
	protected function recupererUtilisateursIdentite(Array $courriels) {
522
		// Récupération des données au format Json
522
		// Récupération des données au format Json
523
		$service = "utilisateur/identite-par-courriel/".implode(',', $courriels);
523
		$service = "utilisateur/identite-par-courriel/".implode(',', $courriels);
524
		$url = sprintf($this->config['settings']['baseURLServicesAnnuaireTpl'], $service);
524
		$url = sprintf($this->config['settings']['baseURLServicesAnnuaireTpl'], $service);
525
		$json = file_get_contents($url);
525
		$json = file_get_contents($url);
526
		$utilisateurs = json_decode($json);
526
		$utilisateurs = json_decode($json, true);
527
		$noms = array();
527
		$noms = array();
528
		foreach ($courriels as $courriel) {
528
		foreach ($courriels as $courriel) {
-
 
529
			$courriel = strtolower($courriel);
529
			$info = array('id' => null, 'intitule' => '');
530
			$info = array('id' => null, 'intitule' => '');
530
			if (isset($utilisateurs->$courriel)) {
531
			if (isset($utilisateurs[$courriel])) {
531
				$info['intitule'] = $utilisateurs->$courriel->intitule;
532
				$info['intitule'] = $utilisateurs[$courriel]['intitule'];
532
				$info['id'] = $utilisateurs->$courriel->id;
533
				$info['id'] = $utilisateurs[$courriel]['id'];
533
			} else {
534
			} else {
534
				$info['intitule'] = $this->tronquerCourriel($courriel);
535
				$info['intitule'] = $this->tronquerCourriel($courriel);
535
			}
536
			}
536
			$noms[$courriel] = $info;
537
			$noms[$courriel] = $info;
537
		}
538
		}