evoadmin-web/tpl/webadmin-itk.tpl.php
2019-06-05 16:30:21 +02:00

66 lines
1.6 KiB
PHP

<?php
/**
* Edition d'un domaine
*
* Copyright (c) 2009 Evolix - Tous droits reserves
*
* vim: expandtab softtabstop=4 tabstop=4 shiftwidth=4 showtabline=2
*
* @author Thomas Martin <tmartin@evolix.fr>
* @version 1.0
*/
?>
<h2>Sécurité ITK</h2>
<?php
if(count($data_list) > 0) { ?>
<table id="tab-list">
<thead>
<tr>
<th>Servername</th>
<th>Utilisateur</th>
<?php if (is_superadmin()) {
print '<th>Action</th>';
} ?>
</tr>
</thead>
<tbody>
<?php
for ( $i=0; $i < count($data_list); ++$i ) {
print '<tr>';
printf('<td>%s</td>',
$data_list[$i]['servername']);
printf('<td>%s</td>',
$data_list[$i]['user']);
if (is_superadmin()) {
if (strpos($data_list[$i]['user'], 'www') !== false) {
$action = ['disable', 'Désactiver'];
} else {
$action = ['enable', 'Activer'];
}
// AssignUserID not set in the vhost, override previous action
if (empty($data_list[$i]['user'])) {
$action = ["", ""];
}
printf('<td><a href="/webadmin/%s/itk/%s/%s/">'.$action[1].'</a></td>',
$domain, $action[0], $data_list[$i]['servername']);
}
print '</tr>';
} ?>
</tbody>
</table>
<?php
} else {
print "<p>La sécurité ITK ne semble pas en place pour le domaine $domain</p>";
}
?>