2009-09-06 03:20:22 +02:00
|
|
|
<?php
|
|
|
|
|
2017-12-13 17:40:02 +01:00
|
|
|
// Load config and autoload class
|
|
|
|
require_once("lib/config.php");
|
|
|
|
|
2017-12-11 18:20:13 +01:00
|
|
|
// Force authentication on this page
|
|
|
|
require_once("lib/auth.php");
|
|
|
|
|
2017-12-13 23:13:47 +01:00
|
|
|
require_once("lib/common.php");
|
2009-09-06 03:20:22 +02:00
|
|
|
|
2017-12-13 23:13:47 +01:00
|
|
|
if (empty($_GET['domain'])) {
|
|
|
|
header("location: superadmin.php\n\n");
|
|
|
|
exit(1);
|
|
|
|
}
|
2009-09-06 03:20:22 +02:00
|
|
|
|
2017-12-13 23:13:47 +01:00
|
|
|
include("inc/haut.php");
|
|
|
|
include("inc/debut.php");
|
2009-09-06 03:20:22 +02:00
|
|
|
|
2017-12-15 20:50:58 +01:00
|
|
|
if (!empty($_POST['account'])) {
|
|
|
|
$account = Html::clean($_POST['account']);
|
|
|
|
|
|
|
|
print '<div class="container"><form name="del "method="post" action="admin.php?domain='.$domain->getName().'">';
|
|
|
|
print '<div class="alert alert-warning" role="alert">Voulez vous vraiment supprimer le compte '.$account.' ?</div>';
|
|
|
|
print '<div class="alert alert-warning" role="alert"><button type="submit" name="delete" value="'.$account.'">Confirmer</button> / <a href="admin.php?domain='.$domain->getName().'">Annuler</a></div>';
|
|
|
|
print '</form></div>';
|
|
|
|
}
|
|
|
|
|
2017-12-17 15:19:56 +01:00
|
|
|
if (!empty($_POST['alias'])) {
|
|
|
|
$alias = Html::clean($_POST['alias']);
|
|
|
|
|
|
|
|
print '<div class="container"><form name="del "method="post" action="admin.php?domain='.$domain->getName().'&viewonly=2">';
|
|
|
|
print '<div class="alert alert-warning" role="alert">Voulez vous vraiment supprimer l\'alias '.$alias.' ?</div>';
|
|
|
|
print '<div class="alert alert-warning" role="alert"><button type="submit" name="delalias" value="'.$alias.'">Confirmer</button> / <a href="admin.php?domain='.$domain->getName().'&viewonly=2">Annuler</a></div>';
|
|
|
|
print '</form></div>';
|
|
|
|
}
|
|
|
|
|
2017-12-15 20:50:58 +01:00
|
|
|
if (!empty($_POST['delete'])) {
|
|
|
|
$account = Html::clean($_POST['delete']);
|
|
|
|
print '<div class="container">';
|
|
|
|
print '<div class="alert alert-warning" role="alert">Suppression du compte '.$account.' ...</div>';
|
|
|
|
try {
|
|
|
|
$domain->delAccount($account);
|
|
|
|
print '<div class="alert alert-success" role="alert">Suppression effectué.</div>';
|
|
|
|
} catch (Exception $e) {
|
|
|
|
print '<div class="alert alert-danger" role="alert">'.$e->getMessage().'</div>';
|
2017-12-17 15:19:56 +01:00
|
|
|
}
|
|
|
|
print '</div>';
|
|
|
|
}
|
|
|
|
|
|
|
|
if (!empty($_POST['delalias'])) {
|
|
|
|
$alias = Html::clean($_POST['delalias']);
|
|
|
|
print '<div class="container">';
|
|
|
|
print '<div class="alert alert-warning" role="alert">Suppression de l\'alias '.$alias.' ...</div>';
|
|
|
|
try {
|
|
|
|
$domain->delAlias($alias);
|
|
|
|
print '<div class="alert alert-success" role="alert">Suppression effectué.</div>';
|
|
|
|
} catch (Exception $e) {
|
|
|
|
print '<div class="alert alert-danger" role="alert">'.$e->getMessage().'</div>';
|
2017-12-15 20:50:58 +01:00
|
|
|
}
|
|
|
|
print '</div>';
|
|
|
|
}
|
|
|
|
|
2017-12-16 18:00:54 +01:00
|
|
|
if (!empty($_POST['isactive']) && $server->isSuperAdmin()) {
|
2017-12-16 17:38:52 +01:00
|
|
|
$active = ($_POST['isactive'] == "TRUE") ? true : false;
|
|
|
|
try {
|
|
|
|
$domain->update($active);
|
|
|
|
header('Location: admin.php?domain='.$domain->getName());
|
|
|
|
} catch (Exception $e) {
|
|
|
|
print '<div class="alert alert-danger" role="alert">'.$e->getMessage().'</div>';
|
|
|
|
}
|
|
|
|
}
|
2017-12-15 20:50:58 +01:00
|
|
|
|
2017-12-13 23:13:47 +01:00
|
|
|
?>
|
|
|
|
<div class="container">
|
|
|
|
<div class="text-center">
|
2017-12-16 17:38:52 +01:00
|
|
|
<?php
|
|
|
|
print '<form name="update" method="post" action="admin.php?domain='.$domain->getName().'">';
|
2017-12-16 18:00:54 +01:00
|
|
|
if ($server->isSuperAdmin()) {
|
|
|
|
if (!$domain->isactive()) {
|
|
|
|
print '<button type="submit" name="isactive" value="TRUE" class="btn btn-primary">Activer le domaine</button> ';
|
|
|
|
} else {
|
|
|
|
print '<button type="submit" name="isactive" value="FALSE" class="btn btn-primary">Désactiver le domaine</button> ';
|
|
|
|
}
|
2017-12-16 17:38:52 +01:00
|
|
|
}
|
|
|
|
?>
|
|
|
|
<a href="compte.php?domain=<?php print $domain->getName() ?>"><button type="button" class="btn btn-primary">Ajouter un nouveau compte</button></a>
|
2009-09-06 03:20:22 +02:00
|
|
|
|
2017-12-13 23:13:47 +01:00
|
|
|
<?php
|
|
|
|
// only for mail mode
|
|
|
|
if (($conf['admin']['what'] == 1) || ($conf['admin']['what'] == 3)) {
|
2009-09-06 03:20:22 +02:00
|
|
|
|
2017-12-13 23:13:47 +01:00
|
|
|
$viewonly1= ( (isset($_GET['viewonly'])) && ($_GET['viewonly']==2) ) ? "" : "selected='selected'";
|
|
|
|
$viewonly2= ( (isset($_GET['viewonly'])) && ($_GET['viewonly']==2) ) ? "selected='selected'" : "";
|
|
|
|
?>
|
2009-09-06 03:20:22 +02:00
|
|
|
|
2017-12-16 17:38:52 +01:00
|
|
|
<a href="alias.php?domain=<?php print $domain->getName() ?>"><button type="button" class="btn btn-primary">Ajouter un nouvel alias/groupe de diffusion</button></a>
|
|
|
|
</form>
|
2017-12-13 23:13:47 +01:00
|
|
|
</div>
|
|
|
|
<hr>
|
|
|
|
<form class='center' action='admin.php' method='GET' name='listing'>
|
|
|
|
<div class="form-group">
|
|
|
|
<input type="hidden" name="domain" value="<?php print $domain->getName() ?>"/>
|
|
|
|
<select class="form-control" name='viewonly' onchange="document.listing.submit()">
|
|
|
|
<option value='1' <?php print $viewonly1; ?>>Liste des comptes</option>
|
|
|
|
<option value='2' <?php print $viewonly2; ?>>Liste des alias/groupe de diffusion</option>
|
|
|
|
</select>
|
|
|
|
</div>
|
|
|
|
</form>
|
|
|
|
<?php
|
2009-09-06 03:20:22 +02:00
|
|
|
}
|
|
|
|
|
2017-12-13 23:13:47 +01:00
|
|
|
if ( (!isset($_GET['viewonly'])) || ($_GET['viewonly']==1) ) {
|
2009-09-06 03:20:22 +02:00
|
|
|
|
2017-12-13 23:13:47 +01:00
|
|
|
?>
|
2009-09-06 03:20:22 +02:00
|
|
|
|
2017-12-17 15:02:34 +01:00
|
|
|
<h2>Liste des comptes :</h2><hr>
|
2009-09-06 03:20:22 +02:00
|
|
|
|
2017-12-17 15:02:34 +01:00
|
|
|
<form name="del" method="post" action="admin.php?domain=<?php print $domain->getName(); ?>">
|
2017-12-13 23:13:47 +01:00
|
|
|
<table class="table table-striped table-condensed">
|
|
|
|
<thead>
|
|
|
|
<tr>
|
|
|
|
<th><strong>Nom du compte</strong></th>
|
2017-12-16 00:08:06 +01:00
|
|
|
<th width="100px">Actif</th>
|
|
|
|
<th width="100px">Admin</th>
|
|
|
|
<th width="100px">POP / IMAP</th>
|
|
|
|
<th width="100px">Auth SMTP</th>
|
2017-12-13 23:13:47 +01:00
|
|
|
<th>Quota</th>
|
|
|
|
<th width="50px">Suppr</th>
|
|
|
|
</tr>
|
|
|
|
</thead>
|
|
|
|
<tbody>
|
|
|
|
|
|
|
|
<?php
|
2017-12-15 20:25:29 +01:00
|
|
|
$accounts = $domain->getAccounts();
|
|
|
|
foreach ($accounts as $account) {
|
|
|
|
print '<tr><td style="text-align:left;"><a href="compte.php?domain='.$domain->getName().'&account='.$account->getUid().'">' .$account->getName().' <'.$account->getUid().'></a></td>';
|
2017-12-15 23:00:51 +01:00
|
|
|
if ($account->isActive()) {
|
2017-12-16 00:08:06 +01:00
|
|
|
print '<td><span class="glyphicon glyphicon-ok"></span></td>';
|
2017-12-15 23:00:51 +01:00
|
|
|
} else {
|
2017-12-16 00:08:06 +01:00
|
|
|
print '<td><span class="glyphicon glyphicon-remove"></span></td>';
|
|
|
|
}
|
|
|
|
if ($account->isAdmin()) {
|
|
|
|
print '<td><span class="glyphicon glyphicon-ok"></span></td>';
|
|
|
|
} else {
|
|
|
|
print '<td><span class="glyphicon glyphicon-remove"></span></td>';
|
|
|
|
}
|
|
|
|
if ($account->isCourier()) {
|
|
|
|
print '<td><span class="glyphicon glyphicon-ok"></span></td>';
|
|
|
|
} else {
|
|
|
|
print '<td><span class="glyphicon glyphicon-remove"></span></td>';
|
|
|
|
}
|
|
|
|
if ($account->isAuthSmtp()) {
|
|
|
|
print '<td><span class="glyphicon glyphicon-ok"></span></td>';
|
|
|
|
} else {
|
|
|
|
print '<td><span class="glyphicon glyphicon-remove"></span></td>';
|
2017-12-15 23:00:51 +01:00
|
|
|
}
|
2017-12-15 20:25:29 +01:00
|
|
|
print '<td>' .getquota($account->getUid(),'user'). '</td>';
|
2017-12-15 20:50:58 +01:00
|
|
|
print '<td><button type="submit" name="account" value="'.$account->getUid().'"><span class="glyphicon glyphicon-trash"></span></button></td>';
|
|
|
|
print '</tr>';
|
2017-12-13 23:13:47 +01:00
|
|
|
}
|
2017-12-17 15:02:34 +01:00
|
|
|
print "</tbody></table></form>";
|
2017-12-13 23:13:47 +01:00
|
|
|
} elseif ( (isset($_GET['viewonly'])) && ($_GET['viewonly']==2) ) {
|
2017-02-13 17:25:07 +01:00
|
|
|
|
2017-12-13 23:13:47 +01:00
|
|
|
?>
|
2017-02-13 17:25:07 +01:00
|
|
|
|
2017-12-17 15:02:34 +01:00
|
|
|
<h2>Liste des alias/groupe de diffusion :</h2>
|
2009-09-06 03:20:22 +02:00
|
|
|
|
2017-12-17 15:02:34 +01:00
|
|
|
<form name="del" method="post" action="admin.php?domain=<?php print $domain->getName(); ?>&viewonly=2">
|
2017-12-13 23:13:47 +01:00
|
|
|
<table class="table table-striped table-condensed">
|
|
|
|
<thead>
|
|
|
|
<tr>
|
|
|
|
<th><strong>Nom de l'alias/groupe de diffusion</strong></th>
|
2017-12-17 15:02:34 +01:00
|
|
|
<th width="100px">Actif</th>
|
2017-12-13 23:13:47 +01:00
|
|
|
<th width="50px">Suppr</th>
|
|
|
|
</tr>
|
|
|
|
</thead>
|
|
|
|
<tbody>
|
2009-09-06 03:20:22 +02:00
|
|
|
|
|
|
|
|
|
|
|
<?php
|
2017-12-13 23:13:47 +01:00
|
|
|
$aliases = $domain->getAlias();
|
|
|
|
foreach ($aliases as $alias) {
|
2017-12-17 15:02:34 +01:00
|
|
|
print '<tr><td style="text-align:left;"><a href="alias.php?domain='.$domain->getName().'&alias='.$alias->getName(). '">' .$alias->getname(). '</a></td>';
|
|
|
|
if ($alias->isActive()) {
|
|
|
|
print '<td><span class="glyphicon glyphicon-ok"></span></td>';
|
|
|
|
} else {
|
|
|
|
print '<td><span class="glyphicon glyphicon-remove"></span></td>';
|
|
|
|
}
|
|
|
|
print '<td><button type="submit" name="alias" value="'.$alias->getName().'"><span class="glyphicon glyphicon-trash"></span></button></td>';
|
|
|
|
print '</tr>';
|
2009-09-06 03:20:22 +02:00
|
|
|
}
|
2017-12-17 15:02:34 +01:00
|
|
|
print "</tbody></table></form>";
|
2017-12-13 23:13:47 +01:00
|
|
|
}
|
|
|
|
?>
|
2009-09-06 03:20:22 +02:00
|
|
|
|
2017-12-13 23:13:47 +01:00
|
|
|
</div>
|
2009-09-06 03:20:22 +02:00
|
|
|
|
2017-12-13 23:13:47 +01:00
|
|
|
<?php include("inc/fin.php"); ?>
|