From: Stéphane Jacob Date: Thu, 24 Jun 2010 13:14:14 +0000 (+0200) Subject: Adds links to new created accounts (Closes #1128). X-Git-Tag: xorg/1.0.0~46 X-Git-Url: http://git.polytechnique.org/?a=commitdiff_plain;h=4029afb0c13e8dc362d7d9a1385514ea5293000b;p=platal.git Adds links to new created accounts (Closes #1128). Signed-off-by: Stéphane Jacob --- diff --git a/modules/admin.php b/modules/admin.php index 8de0530..f606b06 100644 --- a/modules/admin.php +++ b/modules/admin.php @@ -779,6 +779,7 @@ class AdminModule extends PLModule } } else if (Env::t('add_type') == 'account') { $type = Env::t('type'); + $newAccounts = array(); foreach ($lines as $line) { if ($infos = self::formatNewUser($page, $line, $separator, $type, 4)) { $sex = self::formatSex($page, $infos[3], $line); @@ -786,9 +787,13 @@ class AdminModule extends PLModule XDB::execute('INSERT INTO accounts (hruid, type, is_admin, state, email, full_name, display_name, sex) VALUES ({?}, {?}, {?}, {?}, {?}, {?}, {?}, {?})', $infos['hrid'], $type, 0, 'active', $infos[2], $infos[1] . ' ' . $infos[0], $infos[1], $sex); + $newAccounts[$infos['hrid']] = $infos[1] . ' ' . $infos[0]; } } } + if (!empty($newAccounts)) { + $page->assign('newAccounts', $newAccounts); + } } else if (Env::t('add_type') == 'ax_id') { $type = 'x'; foreach ($lines as $line) { diff --git a/templates/admin/add_accounts.tpl b/templates/admin/add_accounts.tpl index 44323cf..b52f3e6 100644 --- a/templates/admin/add_accounts.tpl +++ b/templates/admin/add_accounts.tpl @@ -22,6 +22,17 @@

Mise à jour de l'annuaire

+{if $newAccounts} +

+ Les comptes suivants ont été ajoutés : +

+

+{/if} + {if !$add_type}