From c6683eabc60291b098cda7a0813771e54e558b3c Mon Sep 17 00:00:00 2001 From: Victor LABORIE Date: Fri, 15 Dec 2017 15:38:41 +0100 Subject: [PATCH] List active/inactive domain on superadmin.php --- htdocs/lib/class.ldapdomain.php | 6 +++++- htdocs/superadmin.php | 9 ++++++++- 2 files changed, 13 insertions(+), 2 deletions(-) diff --git a/htdocs/lib/class.ldapdomain.php b/htdocs/lib/class.ldapdomain.php index c841f5d..191b9ca 100644 --- a/htdocs/lib/class.ldapdomain.php +++ b/htdocs/lib/class.ldapdomain.php @@ -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); } diff --git a/htdocs/superadmin.php b/htdocs/superadmin.php index 89c9288..c75a20a 100644 --- a/htdocs/superadmin.php +++ b/htdocs/superadmin.php @@ -41,6 +41,7 @@ if (!empty($_POST['delete'])) { Nom du domaine + Actif Nombre de comptes dont comptes mail Nombre d'alias mail @@ -54,12 +55,18 @@ if (!empty($_POST['delete'])) { $domains = $server->getDomains(); foreach ($domains as $domain) { print '' .$domain->getName(). ''; + if ($domain->isActive()) { + print 'Oui'; + } else { + print 'Non'; + } print '' .$domain->getNbAccounts(). ''; print '' .$domain->getNbMailAccounts(). ''; //print '' .$domain->getNbSmbAccounts(). ''; print '' .$domain->getNbMailAlias(). ''; print '' .$domain->getQuota(). ''; - print ''; + print ''; + print ''; } ?>