mirror of
https://bitbucket.org/jsuto/piler.git
synced 2025-06-13 02:57:04 +02:00
added support for multiple AD
This commit is contained in:
37
webui/controller/ldap/test.php
Normal file
37
webui/controller/ldap/test.php
Normal file
@ -0,0 +1,37 @@
|
||||
<?php
|
||||
|
||||
|
||||
class ControllerLdapTest extends Controller {
|
||||
private $error = array();
|
||||
|
||||
public function index(){
|
||||
|
||||
$this->id = "content";
|
||||
$this->template = "ldap/list.tpl";
|
||||
$this->layout = "common/layout";
|
||||
|
||||
|
||||
$request = Registry::get('request');
|
||||
$db = Registry::get('db');
|
||||
$lang = Registry::get('language');
|
||||
|
||||
$ldap = new LDAP($this->request->post['ldap_host'], $this->request->post['ldap_bind_dn'], $this->request->post['ldap_bind_pw']);
|
||||
|
||||
if($ldap->is_bind_ok()) {
|
||||
print "<span class=\"text-success\">" . $lang->data['text_connection_ok'] . "</span> ";
|
||||
|
||||
$query = $ldap->query($this->request->post['ldap_base_dn'], "(mail=*)", array());
|
||||
if($query->num_rows < 1) {
|
||||
print "<span class=\"text-error\">" . $lang->data['text_not_found_any_email_address'] . "</span> ";
|
||||
}
|
||||
}
|
||||
else {
|
||||
print "<span class=\"text-error\">" . $lang->data['text_connection_failed'] . "</span> ";
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
?>
|
Reference in New Issue
Block a user