+
+ // Returns true if the account is currently active.
+ public function active()
+ {
+ return $this->g_status == 'active';
+ }
+
+ // Returns true if the account exists in Google Apps.
+ public function provisioned()
+ {
+ return $this->g_status == 'active' or $this->g_status == 'disabled';
+ }
+
+ // Returns true if the account exists, but cannot be used (user-requested
+ // suspension, or Google-requested suspension).
+ public function suspended()
+ {
+ 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;
+ }
+
+