X-Git-Url: http://git.polytechnique.org/?a=blobdiff_plain;f=include%2Fgoogleapps.inc.php;h=f23403ee9e65252497ead7846c094f6dccc7cae9;hb=86ab1c8f496429e2dfed2d0ffe9afd20531abf5b;hp=bb7882336f163e578b57bfad5db74560776e66da;hpb=684195f33b11e3067200dd3a9e14304bd7d04463;p=platal.git diff --git a/include/googleapps.inc.php b/include/googleapps.inc.php index bb78823..f23403e 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))) { @@ -193,7 +193,6 @@ class GoogleAppsAccount // validation queue. private function load_pending_validations() { - require_once('validations.inc.php'); $this->pending_validation_unsuspend = Validate::get_typed_requests_count($this->user->id(), 'gapps-unsuspend'); } @@ -341,7 +340,6 @@ class GoogleAppsAccount } if (!$this->pending_update_suspension && !$this->pending_validation_unsuspend) { - require_once('validations.inc.php'); $unsuspend = new GoogleAppsUnsuspendReq($this->user); $unsuspend->submit(); $this->pending_validation_unsuspend = true; @@ -376,13 +374,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.