added User RDN setting for LDAP auth
This commit is contained in:
parent
2c0d7e3b13
commit
c4830a3641
2 changed files with 6 additions and 3 deletions
|
|
@ -112,7 +112,7 @@ sub registrationFormSave {
|
|||
$ldap->bind;
|
||||
my $search = $ldap->search (base => $uri->dn, filter => $session{setting}{ldapId}."=".$session{form}{'authLDAP.ldapId'});
|
||||
if (defined $search->entry(0)) {
|
||||
$connectDN = $search->entry(0)->get_value("cn");
|
||||
$connectDN = $search->entry(0)->get_value($session{setting}{ldapUserRDN});
|
||||
}
|
||||
$ldap->unbind;
|
||||
WebGUI::Authentication::saveParams($uid,'LDAP',
|
||||
|
|
@ -130,7 +130,7 @@ sub registrationFormValidate {
|
|||
if ($ldap->bind) {
|
||||
$search = $ldap->search (base=>$uri->dn,filter=>$session{setting}{ldapId}."=".$session{form}{'authLDAP.ldapId'});
|
||||
if (defined $search->entry(0)) {
|
||||
$connectDN = $search->entry(0)->get_value("cn");
|
||||
$connectDN = $search->entry(0)->get_value($session{setting}{ldapUserRDN});
|
||||
$ldap->unbind;
|
||||
$ldap = Net::LDAP->new($uri->host, (port=>$uri->port)) or $error .= WebGUI::International::get(2,'Auth/LDAP');
|
||||
$auth = $ldap->bind(dn=>$connectDN, password=>$session{form}{'authLDAP.ldapPassword'});
|
||||
|
|
@ -163,6 +163,7 @@ sub settingsForm {
|
|||
my $f;
|
||||
$f = WebGUI::HTMLForm->new;
|
||||
$f->readOnly('<b>'.optionsLabel().'</b>');
|
||||
$f->url("ldapUserRDN",WebGUI::International::get(9,'Auth/LDAP'),$session{setting}{ldapUserRDN});
|
||||
$f->url("ldapURL",WebGUI::International::get(5,'Auth/LDAP'),$session{setting}{ldapURL});
|
||||
$f->text("ldapId",WebGUI::International::get(6,'Auth/LDAP'),$session{setting}{ldapId});
|
||||
$f->text("ldapIdName",WebGUI::International::get(7,'Auth/LDAP'),$session{setting}{ldapIdName});
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue