From 4029afb0c13e8dc362d7d9a1385514ea5293000b Mon Sep 17 00:00:00 2001
From: =?utf8?q?St=C3=A9phane=20Jacob?=
Date: Thu, 24 Jun 2010 15:14:14 +0200
Subject: [PATCH] Adds links to new created accounts (Closes #1128).
MIME-Version: 1.0
Content-Type: text/plain; charset=utf8
Content-Transfer-Encoding: 8bit
Signed-off-by: Stéphane Jacob
---
modules/admin.php | 5 +++++
templates/admin/add_accounts.tpl | 11 +++++++++++
2 files changed, 16 insertions(+)
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 :
+
+ {foreach from=$newAccounts key=hruid item=name}
+ - {$name}
+ {/foreach}
+
+
+{/if}
+
{if !$add_type}