Index: openacs-4/packages/auth-ldap/lib/search.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/auth-ldap/lib/search.tcl,v diff -u -N -r1.4 -r1.5 --- openacs-4/packages/auth-ldap/lib/search.tcl 7 Oct 2019 11:34:49 -0000 1.4 +++ openacs-4/packages/auth-ldap/lib/search.tcl 7 Oct 2019 11:48:04 -0000 1.5 @@ -5,12 +5,16 @@ # ADP level # should get authority_id, return_url passed in. -ad_form -name user-search -export {authority_id object_id} -html {id "user-search"} -has_submit 1 -form { +ad_form -name user-search \ + -export {authority_id object_id} \ + -html {id "user-search"} \ + -has_submit 1 -form { {search_text:text(text),optional {label "Search"} } {search_btn:text(button) {label ""} {value "Search"} {html {onclick {document.getElementById('searchform').style.display='';document.getElementById('user-search').submit()}}}} } + if {![info exists orderby]} { set orderby "" } @@ -55,7 +59,7 @@ if {[llength $search_terms]} { set matches [auth::ldap::search::Search $search_terms $auth_search_parameters] - set user_info_impl_id [auth::authority::get_element -authority_id $authority_id -element "user_info_impl_id"] + set user_info_impl_id [auth::authority::get_element -authority_id $authority_id -element "user_info_impl_id"] set user_info_parameters [auth::driver::get_parameter_values \ -authority_id $authority_id \ -impl_id $user_info_impl_id] Index: openacs-4/packages/auth-ldap/tcl/auth-ldap-procs.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/auth-ldap/tcl/auth-ldap-procs.tcl,v diff -u -N -r1.19 -r1.20 --- openacs-4/packages/auth-ldap/tcl/auth-ldap-procs.tcl 7 Oct 2019 11:29:30 -0000 1.19 +++ openacs-4/packages/auth-ldap/tcl/auth-ldap-procs.tcl 7 Oct 2019 11:48:04 -0000 1.20 @@ -93,11 +93,8 @@ ad_proc -private auth::ldap::before_uninstall {} {} { acs_sc::impl::delete -contract_name "auth_authentication" -impl_name "LDAP" - acs_sc::impl::delete -contract_name "auth_password" -impl_name "LDAP" - acs_sc::impl::delete -contract_name "auth_registration" -impl_name "LDAP" - acs_sc::impl::delete -contract_name "auth_user_info" -impl_name "LDAP" } @@ -278,8 +275,14 @@ set lh [ns_ldap gethandle] - # First, find the user's FDN, then try an ldap bind with the FDN and supplied password - set fdn [lindex [ns_ldap search $lh -scope subtree $params(BaseDN) "($params(UsernameAttribute)=$username)" dn] 0 1] + # + # First, find the user's FDN, then try an ldap bind with the + # FDN and supplied password. + # + set ldap_search_result [ns_ldap search $lh -scope subtree \ + $params(BaseDN) \ + "($params(UsernameAttribute)=$username)" dn] + set fdn [lindex $ldap_search_result 0 1] if { $fdn ne "" && [ns_ldap bind $lh $fdn $password]} { set result(auth_status) ok } @@ -290,8 +293,10 @@ } else { # Find the user - set userPassword [auth::ldap::get_user -username $username -parameters $parameters -element "userPassword"] - + set userPassword [auth::ldap::get_user \ + -username $username \ + -parameters $parameters \ + -element "userPassword"] if { $userPassword ne "" && [auth::ldap::check_password $userPassword $password] } { set result(auth_status) ok } @@ -387,14 +392,19 @@ if { $dn ne "" && $userPassword ne "" } { set ok_to_change_password 0 - - # TODO: abstract this... + # + # TODO: abstract this... -> remove duplicated code! + # if { $params(BindAuthenticationP) ne "" && $params(BindAuthenticationP) } { set lh [ns_ldap gethandle] - - # First, find the user's FDN, then try an ldap bind with the FDN and supplied password - set fdn [lindex [ns_ldap search $lh -scope subtree $params(BaseDN) "($params(UsernameAttribute)=$username)" dn] 0 1] + # + # First, find the user's FDN, then try an ldap bind with + # the FDN and supplied password. + # + set ldap_search_result [ns_ldap search $lh -scope subtree \ + $params(BaseDN) "($params(UsernameAttribute)=$username)" dn] + set fdn [lindex $ldap_search_result 0 1] if { $fdn ne "" && [ns_ldap bind $lh $fdn $old_password]} { set ok_to_change_password 1 }