public function page_ldap() {
$this->deniedUnless($this->perm >= self::READ);
- require_once(NB_ROOT.'/lib/php/ldap.php');
- #debug($GLOBALS['DBQ_LDAP']);
+ require_once(NB_ROOT.'/lib/php/ldap.php'); #debug($GLOBALS['DBQ_LDAP']);
$ldap = new Ldap($GLOBALS['DBQ_LDAP']);
if ($this->params['table'] == 'add') {
- #debug($this->params);
+ $this->deniedUnless($this->perm >= self::WRITE);
$rows = (int)$ldap->add($this->params['action'],$_POST);
- #bye($_POST);
$this->page($rows);
} elseif ($this->params['table'] == 'update') {
+ $this->deniedUnless($this->perm >= self::WRITE);
$rows = (int)$ldap->update($this->params['action'],$_POST);
$this->page($rows);
} elseif ($this->params['table'] == 'rm') {
+ $this->deniedUnless($this->perm >= self::DELETE);
$rows = (int)$ldap->delete($this->params['action'],$_POST);
$this->page($rows);
- } else {
-
+ } else { // Search
$filter = ($this->params['table'] ? $this->params['table'] : '');
$attrs = ($this->params['action'] ? explode(',',$this->params['action']) : []);