X-Git-Url: http://git.polytechnique.org/?a=blobdiff_plain;f=include%2Fgoogleapps.inc.php;h=bb7882336f163e578b57bfad5db74560776e66da;hb=2998edf118b3d6243171dd3294247ad1324ac343;hp=d107e5ecb4fa7b896c51a5037a747a23406aa8c3;hpb=2db80ab6f7d054ec274c66f7ba983f49596b81cf;p=platal.git diff --git a/include/googleapps.inc.php b/include/googleapps.inc.php index d107e5e..bb78823 100644 --- a/include/googleapps.inc.php +++ b/include/googleapps.inc.php @@ -1,6 +1,6 @@ g_status == 'disabled'; } + // Loads and returns the list of nicknames for the user. + public function nicknames() + { + if ($this->nicknames == null) { + $res = XDB::query( + "SELECT g_nickname + FROM gapps_nicknames + WHERE g_account_name = {?} + ORDER BY g_nickname", + $this->g_account_name); + $this->nicknames = $res->fetchColumn(); + } + return $this->nicknames; + } + // Changes the GoogleApps password. public function set_password($password) { @@ -339,17 +357,7 @@ class GoogleAppsAccount if (!$this->pending_update_suspension) { if ($this->sync_password) { - $res = XDB::query( - "SELECT password - FROM accounts - WHERE uid = {?}", $this->user->id()); - $password = ($res->numRows() > 0 ? $res->fetchOneCell() : false); - } else { - $password = false; - } - - if ($password) { - $this->create_queue_job('u_update', array('suspended' => false, 'password' => $password)); + $this->create_queue_job('u_update', array('suspended' => false, 'password' => $this->user->password())); } else { $this->create_queue_job('u_update', array('suspended' => false)); }