From 0536df807608570acf3f738ba3082de31cfa0b16 Mon Sep 17 00:00:00 2001 From: Vincent Zanotti Date: Sun, 17 May 2009 17:40:38 +0200 Subject: [PATCH] Adds the list of nicknames to the Google Apps user admin page. Signed-off-by: Vincent Zanotti --- include/googleapps.inc.php | 18 ++++++++++++++++++ templates/googleapps/admin.user.tpl | 5 +++++ 2 files changed, 23 insertions(+) diff --git a/include/googleapps.inc.php b/include/googleapps.inc.php index 71853c4..accc779 100644 --- a/include/googleapps.inc.php +++ b/include/googleapps.inc.php @@ -119,6 +119,9 @@ class GoogleAppsAccount 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; @@ -272,6 +275,21 @@ class GoogleAppsAccount 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) { diff --git a/templates/googleapps/admin.user.tpl b/templates/googleapps/admin.user.tpl index 1663dbf..4257288 100644 --- a/templates/googleapps/admin.user.tpl +++ b/templates/googleapps/admin.user.tpl @@ -71,6 +71,11 @@ Utilisation du quota d'emails{$a->r_disk_usage/1024/1024|string_format:"%.2f"}MB + + + Alias email du compte + {$a->g_account_name}{foreach from=$a->nicknames() item=nickname}
{$nickname}{/foreach} +
-- 2.1.4