List active/inactive domain on superadmin.php
This commit is contained in:
parent
40deaef708
commit
c6683eabc6
|
@ -17,7 +17,7 @@ class LdapDomain extends LdapServer {
|
|||
foreach($objects as $object) {
|
||||
if (!empty($object['objectclass'])) {
|
||||
if (in_array("postfixDomain",$object['objectclass'])) {
|
||||
$this->active = $object['isactive'][0];
|
||||
$this->active = ($object['isactive'][0] == "TRUE") ? true : false;
|
||||
}
|
||||
if (in_array("posixAccount",$object['objectclass'])) {
|
||||
array_push($this->posix_accounts,$object['uid'][0]);
|
||||
|
@ -112,6 +112,10 @@ class LdapDomain extends LdapServer {
|
|||
return $this->domain;
|
||||
}
|
||||
|
||||
public function isActive() {
|
||||
return $this->active;
|
||||
}
|
||||
|
||||
public function getNbAccounts() {
|
||||
return count($this->posix_accounts)+count($this->mail_alias);
|
||||
}
|
||||
|
|
|
@ -41,6 +41,7 @@ if (!empty($_POST['delete'])) {
|
|||
<thead>
|
||||
<tr>
|
||||
<th>Nom du domaine</th>
|
||||
<th width="80px">Actif</th>
|
||||
<th>Nombre de comptes</th>
|
||||
<th>dont comptes mail</th>
|
||||
<th>Nombre d'alias mail</th>
|
||||
|
@ -54,12 +55,18 @@ if (!empty($_POST['delete'])) {
|
|||
$domains = $server->getDomains();
|
||||
foreach ($domains as $domain) {
|
||||
print '<tr><td style="text-align:left;"><a href="admin.php?domain='.$domain->getName(). '">' .$domain->getName(). '</a></td>';
|
||||
if ($domain->isActive()) {
|
||||
print '<td>Oui</td>';
|
||||
} else {
|
||||
print '<td>Non</td>';
|
||||
}
|
||||
print '<td><b>' .$domain->getNbAccounts(). '</b></td>';
|
||||
print '<td><b>' .$domain->getNbMailAccounts(). '</b></td>';
|
||||
//print '<td><b>' .$domain->getNbSmbAccounts(). '</b></td>';
|
||||
print '<td><b>' .$domain->getNbMailAlias(). '</b></td>';
|
||||
print '<td>' .$domain->getQuota(). '</td>';
|
||||
print '<td><button type="submit" name="domain" value="'.$domain->getName().'"><span class="glyphicon glyphicon-trash"></span></button></td></tr>';
|
||||
print '<td><button type="submit" name="domain" value="'.$domain->getName().'"><span class="glyphicon glyphicon-trash"></span></button></td>';
|
||||
print '</tr>';
|
||||
}
|
||||
?>
|
||||
</tbody>
|
||||
|
|
Loading…
Reference in a new issue