Subversion Repositories eFlore/Applications.cel

Rev

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

Rev 1129 Rev 1134
Line 447... Line 447...
447
 
447
 
448
	protected function creerAuteurs(array $courriels, $pourAdmin = false) {
448
	protected function creerAuteurs(array $courriels, $pourAdmin = false) {
449
		$auteurs = ($pourAdmin) ? $courriels : $this->recupererUtilisateursNomPrenom($courriels);
449
		$auteurs = ($pourAdmin) ? $courriels : $this->recupererUtilisateursNomPrenom($courriels);
450
		return $auteurs;
450
		return $auteurs;
-
 
451
	}
-
 
452
	
-
 
453
	protected function recupererUtilisateursIdentite(Array $courriels) {
-
 
454
		// Récupération des données au format Json
-
 
455
		$service = "utilisateur/identite-par-courriel/".implode(',', $courriels);
-
 
456
		$url = sprintf($this->config['settings']['baseURLServicesAnnuaireTpl'], $service);
-
 
457
		$json = file_get_contents($url);
-
 
458
		$utilisateurs = json_decode($json);
-
 
459
		$noms = array();
-
 
460
		foreach ($courriels as $courriel) {
-
 
461
			$info = array('id' => null, 'intitule' => '');
-
 
462
			if (isset($utilisateurs->$courriel)) {
-
 
463
				$info['intitule'] = $utilisateurs->$courriel->intitule;
-
 
464
				$info['id'] = $utilisateurs->$courriel->id;
-
 
465
			} else {
-
 
466
				$info['intitule'] = $this->tronquerCourriel($courriel);
-
 
467
			}
-
 
468
			$noms[$courriel] = $info;
-
 
469
		}
-
 
470
		return $noms;
Line 451... Line 471...
451
	}
471
	}
452
 
472
 
453
	protected function recupererUtilisateursNomPrenom(array $courriels) {
473
	protected function recupererUtilisateursNomPrenom(array $courriels) {
454
		// Récupération des données au format Json
474
		// Récupération des données au format Json