Add support for quota information
This commit is contained in:
parent
73a434dfd2
commit
a9cdb71630
|
@ -21,9 +21,17 @@ class LdapAccount extends LdapDomain {
|
||||||
$this->courier = ($object['courieractive'][0] == 'TRUE') ? true : false;
|
$this->courier = ($object['courieractive'][0] == 'TRUE') ? true : false;
|
||||||
$this->webmail = ($object['webmailactive'][0] == 'TRUE') ? true : false;
|
$this->webmail = ($object['webmailactive'][0] == 'TRUE') ? true : false;
|
||||||
$this->authsmtp = ($object['authsmtpactive'][0] == 'TRUE') ? true : false;
|
$this->authsmtp = ($object['authsmtpactive'][0] == 'TRUE') ? true : false;
|
||||||
//$this->quota = getquota($this->domain->getName(),'user');
|
|
||||||
$this->aliases = array_filter($object['mailacceptinggeneralid'], "is_string");
|
$this->aliases = array_filter($object['mailacceptinggeneralid'], "is_string");
|
||||||
$this->redirections = array_filter($object['maildrop'], "is_string");
|
$this->redirections = array_filter($object['maildrop'], "is_string");
|
||||||
|
|
||||||
|
$quota_file = '/home/evoadmin-mail/quota/'.$this->domain->domain.'.csv';
|
||||||
|
if (file_exists($quota_file)) {
|
||||||
|
$short_uid = explode("@", $this->uid)[0];
|
||||||
|
if(preg_match("/^".$short_uid.";([^;]*);(.*)/m", file_get_contents($quota_file), $matches)) {
|
||||||
|
$this->quota = $matches[1]." / ".$matches[2];
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
} else {
|
} else {
|
||||||
throw new Exception("Ce compte n'existe pas !");
|
throw new Exception("Ce compte n'existe pas !");
|
||||||
}
|
}
|
||||||
|
|
|
@ -35,7 +35,12 @@ class LdapDomain extends LdapServer {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
//$this->quota = getquota($this->domain,'group');
|
$quota_file = '/home/evoadmin-mail/quota/all.csv';
|
||||||
|
if (file_exists($quota_file)) {
|
||||||
|
if(preg_match("/^".$this->domain.";([^;]*);(.*)/m", file_get_contents($quota_file), $matches)) {
|
||||||
|
$this->quota = $matches[1]." / ".$matches[2];
|
||||||
|
}
|
||||||
|
}
|
||||||
} else {
|
} else {
|
||||||
throw new Exception("Ce domaine n'existe pas !");
|
throw new Exception("Ce domaine n'existe pas !");
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue