Commit | Line | Data |
---|---|---|
5480a216 | 1 | {**************************************************************************} |
2 | {* *} | |
5e1513f6 | 3 | {* Copyright (C) 2003-2011 Polytechnique.org *} |
5480a216 | 4 | {* http://opensource.polytechnique.org/ *} |
5 | {* *} | |
6 | {* This program is free software; you can redistribute it and/or modify *} | |
7 | {* it under the terms of the GNU General Public License as published by *} | |
8 | {* the Free Software Foundation; either version 2 of the License, or *} | |
9 | {* (at your option) any later version. *} | |
10 | {* *} | |
11 | {* This program is distributed in the hope that it will be useful, *} | |
12 | {* but WITHOUT ANY WARRANTY; without even the implied warranty of *} | |
13 | {* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *} | |
14 | {* GNU General Public License for more details. *} | |
15 | {* *} | |
16 | {* You should have received a copy of the GNU General Public License *} | |
17 | {* along with this program; if not, write to the Free Software *} | |
18 | {* Foundation, Inc., *} | |
19 | {* 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA *} | |
20 | {* *} | |
21 | {**************************************************************************} | |
22 | ||
a7de4ef7 | 23 | <h1>Gestion des IPs surveillées</h1> |
5480a216 | 24 | |
25 | {if $action eq "list"} | |
26 | <table class="bicol"> | |
27 | <tr> | |
28 | <th>Adresse</th> | |
29 | <th>Etat</th> | |
30 | <th>Utilisateurs</th> | |
31 | <th></th> | |
32 | </tr> | |
33 | <tr class="impair"> | |
34 | <td colspan="2"> | |
a7de4ef7 | 35 | <strong>Ajouter une entrée</strong> |
5480a216 | 36 | </td> |
37 | <td colspan="2" class="right"> | |
a7de4ef7 | 38 | <strong><a href="admin/ipwatch/create">créer{icon name=add}</a></strong> |
5480a216 | 39 | </td> |
40 | </tr> | |
41 | {foreach from=$table item=ip} | |
42 | <tr class="{cycle values="pair,impair"}"> | |
43 | <td> | |
61c98f4b | 44 | <strong>{$ip.ip}/{$ip.mask}</strong><br /> |
e2c528e1 | 45 | {if $ip.host}<small>{$ip.host}</small><br />{/if} |
a7de4ef7 | 46 | Ajoutée le {$ip.detection|date_format} |
5480a216 | 47 | </td> |
48 | <td> | |
49 | {$ip.state} | |
50 | </td> | |
51 | <td class="right"> | |
52 | {foreach from=$ip.users item=user name=all} | |
53 | {if $user} | |
54 | <a href="profile/{$user}" class="popup2">{$user}</a> | |
55 | <a href="admin/user/{$user}">{icon name=wrench title=Administrer}</a> | |
56 | <a href="admin/logger/user/{$user}">{icon name=information title="Logs"}</a>{if !$smarty.foreach.all.last}<br />{/if} | |
57 | {/if} | |
58 | {/foreach} | |
59 | </td> | |
60 | <td class="right"> | |
61 | <a href="admin/ipwatch/edit/{$ip.ip}">{icon name=page_edit title="Editer"}</a> | |
e61326ed | 62 | <a href="admin/ipwatch/delete/{$ip.ip}?token={xsrf_token}">{icon name=delete title="Supprimer"}</a> |
5480a216 | 63 | </td> |
64 | </tr> | |
65 | {/foreach} | |
66 | </table> | |
67 | {elseif $action eq "create" || $action eq "edit"} | |
a7de4ef7 | 68 | [<a href="admin/ipwatch">Retour à la liste des IPs surveillées</a>]<br /><br /> |
5480a216 | 69 | <form method="post" action="admin/ipwatch"> |
e61326ed | 70 | {xsrf_token_field} |
5480a216 | 71 | <table class="tinybicol"> |
72 | <tr> | |
73 | <th colspan="2">Commenter une adresse IP</th> | |
74 | </tr> | |
75 | <tr class="impair"> | |
76 | {if $action eq "create"} | |
77 | <td class="titre">Adresse IP</td> | |
78 | <td><input type="text" name="ipN" /></td> | |
79 | {else} | |
80 | <td colspan="2"> | |
81 | <strong>{$ip.ip}</strong> ({$ip.host}) | |
82 | <input type="hidden" name="ipN" value="{$ip.ip}" /> | |
83 | </td> | |
84 | </tr> | |
85 | {foreach from=$ip.users key=i name=all item=user} | |
86 | {if $user} | |
87 | {if $i is even}<tr class="impair">{/if} | |
88 | <td> | |
89 | <a href="profile/{$user}" class="popup2">{$user}</a> | |
90 | <a href="admin/user/{$user}">{icon name=wrench title="Administrer}</a> | |
91 | <a href="admin/logger/user/{$user}">{icon name=information title="Logs"}</a>{if !$smarty.foreach.all.last}<br />{/if} | |
92 | </td> | |
93 | {if $i is even && $smarty.foreach.all.last}<td></td>{/if} | |
94 | {if $i is odd || $smarty.foreach.all.last}</tr>{/if} | |
95 | {/if} | |
96 | {/foreach} | |
97 | <tr class="pair"> | |
a7de4ef7 | 98 | <td class="titre">Date de détection</td> |
5480a216 | 99 | <td>{$ip.detection|date_format}</td> |
100 | {/if} | |
101 | </tr> | |
102 | <tr class="pair"> | |
61c98f4b FB |
103 | <td class="titre">Masque d'influence</td> |
104 | <td><input type="text" name="maskN" value="{$ip.mask}" /></td> | |
105 | </tr> | |
106 | <tr class="pair"> | |
5480a216 | 107 | <td class="titre">Danger</td> |
108 | <td> | |
109 | <select name="stateN"> | |
110 | {foreach from=$states key=state item=text} | |
111 | <option value="{$state}"{if $ip.state eq $state} selected="selected"{/if}>{$text}</option> | |
112 | {/foreach} | |
113 | </select> | |
114 | </td> | |
115 | </tr> | |
116 | <tr class="impair"> | |
117 | <td colspan="2" class="titre">Description</td> | |
118 | {if $ip.edit} | |
119 | </tr> | |
120 | <tr class="impair"> | |
121 | <td colspan="2"> | |
a7de4ef7 | 122 | <small>Dernière édition par {$ip.edit} le {$ip.last|date_format}</small> |
5480a216 | 123 | </td> |
124 | {/if} | |
125 | </tr> | |
126 | <tr class="impair"> | |
127 | <td colspan="2" class="center"> | |
128 | <textarea cols="50" rows="10" name="descriptionN">{$ip.description}</textarea> | |
129 | </td> | |
130 | </tr> | |
131 | <tr> | |
132 | <th colspan="2"> | |
133 | <input type="hidden" name="action" value="{$action}" /> | |
134 | <input type="submit" name="valid" value="Valider" /> | |
135 | </th> | |
136 | </tr> | |
137 | </table> | |
138 | </form> | |
139 | {/if} | |
140 | ||
a7de4ef7 | 141 | {* vim:set et sw=2 sts=2 sws=2 enc=utf-8: *} |