Adds links to new created accounts (Closes #1128).
authorStéphane Jacob <sj@m4x.org>
Thu, 24 Jun 2010 13:14:14 +0000 (15:14 +0200)
committerStéphane Jacob <sj@m4x.org>
Thu, 24 Jun 2010 13:14:14 +0000 (15:14 +0200)
Signed-off-by: Stéphane Jacob <sj@m4x.org>
modules/admin.php
templates/admin/add_accounts.tpl

index 8de0530..f606b06 100644 (file)
@@ -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) {
index 44323cf..b52f3e6 100644 (file)
 
 <h1>Mise à jour de l'annuaire</h1>
 
+{if $newAccounts}
+<p>
+  Les comptes suivants ont été ajoutés&nbsp;:
+  <ul>
+  {foreach from=$newAccounts key=hruid item=name}
+    <li><a href="{$platal->ns}admin/user/{$hruid}">{$name}</a></li>
+  {/foreach}
+  </ul>
+</p>
+{/if}
+
 {if !$add_type}
 <form action="{$platal->pl_self()}" method="post">
 <table class="tinybicol">