Add basic params to LdapAccount

This commit is contained in:
Victor LABORIE 2017-12-15 22:55:51 +01:00
parent 531e08c14d
commit 5ca91fe7ae

View file

@ -1,7 +1,7 @@
<?php
class LdapAccount extends LdapDomain {
protected $domain,$uid,$name,$active=false;
protected $domain,$uid,$name,$active=false,$admin=false,$courier=false,$authsmtp=false;
public function __construct($domain, $uid) {
$this->conn = $domain->conn;
@ -12,12 +12,24 @@ class LdapAccount extends LdapDomain {
$objects = ldap_get_entries($this->conn, $sr);
$object = $objects[0];
$this->name = $object['cn'][0];
$this->active = ($object['isactive'][0] == 'TRUE') ? true : false;
$this->admin = ($object['isadmin'][0] == 'TRUE') ? true : false;
$this->courier = ($object['courieractive'][0] == 'TRUE') ? true : false;
$this->authsmtp = ($object['authsmtpactive'][0] == 'TRUE') ? true : false;
//$this->quota = getquota($this->domain,'user');
} else {
throw new Exception("Ce compte n'existe pas !");
}
}
public function isActive() {
return $this->active;
}
public function isAdmin() {
return $this->admin;
}
public function getUid() {
return $this->uid;
}
@ -26,6 +38,22 @@ class LdapAccount extends LdapDomain {
return $this->name;
}
public function getAliases() {
return array();
}
public function getRedirections() {
return array();
}
public function isCourier() {
return $this->courier;
}
public function isAuthSmtp() {
return $this->authsmtp;
}
public function __destruct() {
return true;
}