correction page d'administration

master
karchnu 8 years ago
parent e94224b6f2
commit 167133ebcd

@ -4,6 +4,8 @@ use configuration ':all';
use app;
use utf8;
use Data::Dump qw( dump );
use Exporter 'import';
# what we want to export eventually
our @EXPORT_OK = qw/rt_admin/;
@ -32,7 +34,7 @@ sub rt_admin {
$$res{template} = 'administration';
$$res{params} = {
login => $$session{login}
, admin => 1 # we know it, or we couldn't reach this
, admin => $$user{admin}
, domains => $domains
, alldomains => $alldomains
, allusers => $allusers
@ -40,6 +42,7 @@ sub rt_admin {
$app->disconnect();
};
$res
}

@ -15,17 +15,17 @@
<th>supprimer utilisateur</th>
</tr>
<% FOREACH pair IN alldomains.pairs %>
<% FOREACH d IN alldomains %>
<tr>
<td><% pair.key %></td>
<td><% pair.value %></td>
<td><% d.domain %></td>
<td><% d.login %></td>
<td>
<a href="/domain/del/<% pair.key %>"><button type="button" class="btn btn-danger">Supprimer le domaine</button></a>
<a href="/domain/del/<% d.domain %>"><button type="button" class="btn btn-danger">Supprimer le domaine</button></a>
</td>
<td>
<a href="/user/del/<% pair.value %>"><button type="button" class="btn btn-danger">Supprimer l'utilisateur</button></a>
<a href="/user/del/<% d.login %>"><button type="button" class="btn btn-danger">Supprimer l'utilisateur</button></a>
</td>
</tr>
@ -44,17 +44,17 @@
<th>administrateur</th>
</tr>
<% FOREACH pair IN allusers.pairs %>
<% FOREACH u IN allusers %>
<tr>
<td><% pair.key %></td>
<td><% u.login %></td>
<td>
<a href="/user/del/<% pair.key %>"><button type="button" class="btn btn-danger">Supprimer l'utilisateur</button></a>
<a href="/user/del/<% u.login %>"><button type="button" class="btn btn-danger">Supprimer l'utilisateur</button></a>
</td>
<td>
<a href="/user/toggleadmin/<% pair.key %>">
<% IF pair.value == 1 %>
<a href="/user/toggleadmin/<% u.login %>">
<% IF u.admin == 1 %>
<button type="button" class="btn btn-danger">Passer utilisateur</button>
<% ELSE %>
<button type="button" class="btn btn-primary">Passer administrateur</button>

Loading…
Cancel
Save