public $r_last_webmail;
public $reporting_date;
+ // Nicknames (aliases) registered for that user, lazily loaded.
+ public $nicknames;
+
// Pending requests in the gappsd job queue (cf. top note).
public $pending_create;
public $pending_delete;
return $this->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) {
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));
}