|
|
@ -12,7 +12,12 @@ class LdapAdapter{ |
|
|
|
function __construct($host, $port, $user, $pass){ |
|
|
|
$this->conn = ldap_connect($host,$port); |
|
|
|
ldap_set_option($this->conn, LDAP_OPT_PROTOCOL_VERSION, 3); |
|
|
|
ldap_bind($this->conn, $user, $pass); |
|
|
|
$this->bind_status = ldap_bind($this->conn, $user, $pass); |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
function get_bind_status(){ |
|
|
|
return $this->bind_status; |
|
|
|
} |
|
|
|
|
|
|
|
function bind($host, $port, $user, $pass){ |
|
|
@ -245,6 +250,10 @@ abstract class pippo{ |
|
|
|
$this->la=new LdapAdapter($HOST, $PORT, $LOGIN_DN, $LOGIN_PASS); |
|
|
|
} |
|
|
|
|
|
|
|
function get_bind_status(){ |
|
|
|
return $this->la->get_bind_status(); |
|
|
|
} |
|
|
|
|
|
|
|
function get_attr($attr){ |
|
|
|
foreach($this->adapters as $adapter){ |
|
|
|
$result=$adapter->get_attr($this->la, $this->id, $attr); |
|
|
@ -358,6 +367,10 @@ class LilikUser extends pippo{ |
|
|
|
return $this->status('admin'); |
|
|
|
} |
|
|
|
|
|
|
|
function is_binded(){ |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
function enable($service){ |
|
|
|
if (array_key_exists($service, $this->_flag)){ |
|
|
|
return $this->set_attr($this->_flag[$service], 'TRUE'); |
|
|
|