mirror of
https://bitbucket.org/jsuto/piler.git
synced 2025-06-13 01:27:03 +02:00
added generic ldap support
This commit is contained in:
@ -82,8 +82,10 @@ class ControllerLdapList extends Controller {
|
||||
|
||||
if ( isset($this->data['errorstring']) ) {
|
||||
// use posted values if they differ from database values (ie - form was submitted but failed validation)
|
||||
if (isset($this->request->post['ldap_type'])) { $this->data['a']['ldap_type'] = $this->request->post['ldap_type'];}
|
||||
if (isset($this->request->post['description'])) { $this->data['a']['description'] = $this->request->post['description'];}
|
||||
/*if (isset($this->request->post['ldap_type'])) { $this->data['a']['ldap_type'] = $this->request->post['ldap_type'];}
|
||||
if (isset($this->request->post['description'])) { $this->data['a']['description'] = $this->request->post['description'];}*/
|
||||
|
||||
$this->data['a'] = $this->request->post;
|
||||
}
|
||||
|
||||
}
|
||||
@ -119,6 +121,23 @@ class ControllerLdapList extends Controller {
|
||||
$this->error['ldap_bind_pw'] = $this->data['text_field_required'];
|
||||
}
|
||||
|
||||
if(isset($this->request->post['ldap_type']) && $this->request->post['ldap_type'] == LDAP_TYPE_GENERIC) {
|
||||
|
||||
if(!isset($this->request->post['ldap_mail_attr']) || strlen($this->request->post['ldap_mail_attr']) < 3) {
|
||||
$this->error['ldap_mail_attr'] = $this->data['text_field_required'];
|
||||
}
|
||||
if(!isset($this->request->post['ldap_account_objectclass']) || strlen($this->request->post['ldap_account_objectclass']) < 3) {
|
||||
$this->error['ldap_account_objectclass'] = $this->data['text_field_required'];
|
||||
}
|
||||
if(!isset($this->request->post['ldap_distributionlist_attr']) || strlen($this->request->post['ldap_distributionlist_attr']) < 3) {
|
||||
$this->error['ldap_distributionlist_attr'] = $this->data['text_field_required'];
|
||||
}
|
||||
if(!isset($this->request->post['ldap_distributionlist_objectclass']) || strlen($this->request->post['ldap_distributionlist_objectclass']) < 3) {
|
||||
$this->error['ldap_distributionlist_objectclass'] = $this->data['text_field_required'];
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
if (!$this->error) {
|
||||
return true;
|
||||
} else {
|
||||
|
Reference in New Issue
Block a user