X-Git-Url: http://git.polytechnique.org/?a=blobdiff_plain;f=include%2Fgoogleapps.inc.php;h=5cf6eb6158d9c8ea5e416aadb68f5e0fe7360f9d;hb=bf52ec4e8de2e1c22020f7fffbf543ab4ee7f41a;hp=bb7882336f163e578b57bfad5db74560776e66da;hpb=684195f33b11e3067200dd3a9e14304bd7d04463;p=platal.git diff --git a/include/googleapps.inc.php b/include/googleapps.inc.php index bb78823..5cf6eb6 100644 --- a/include/googleapps.inc.php +++ b/include/googleapps.inc.php @@ -23,7 +23,7 @@ function post_queue_u_create($job) { global $globals; - // Retrieves the user parameters (GoogleApps username and user_id). + // Retrieves the user parameters (GoogleApps username and uid). $parameters = json_decode($job['j_parameters'], true); $username = isset($parameters['username']) ? $parameters['username'] : null; if (!($user = User::getSilent($username))) { @@ -376,13 +376,12 @@ class GoogleAppsAccount if (!$this->pending_create) { // Retrieves information on the new account. - // TODO: retreive first_name and last_name from the profile. - if (!$user->hasProfile()) { - $prenom = $user->displayName(); - $nom = $user->fullName(); + if (!$this->user->hasProfile()) { + $prenom = $this->user->displayName(); + $nom = $this->user->fullName(); } else { - $prenom = $user->profile()->firstName(); - $nom = $user->profile()->lastName(); + $prenom = $this->user->profile()->firstName(); + $nom = $this->user->profile()->lastName(); } // Adds an 'unprovisioned' entry in the gapps_accounts table.