57
if(style == DisplayIfTwo && got_n_entries < 2){
58
if(got_n_entries == 0){
62
for(a = ldap_first_attribute(tmp_rl->ld, tmp_e, &ber);
64
a = ldap_next_attribute(tmp_rl->ld, tmp_e, ber)){
65
if(strcmp(a, tmp_rl->info_used->mailattr) == 0){
66
mail = ldap_get_values(tmp_rl->ld, tmp_e, a);
70
if(mail && mail[0] && mail[0][0]){
74
(LDAP_CHOOSE_S *)fs_get(sizeof(LDAP_CHOOSE_S));
75
(*result)->ld = tmp_rl->ld;
76
(*result)->selected_entry = tmp_e;
77
(*result)->info_used = tmp_rl->info_used;
78
(*result)->serv = tmp_rl->serv;
57
if(got_n_entries == 1){
58
for(a = ldap_first_attribute(tmp_rl->ld, tmp_e, &ber);
60
a = ldap_next_attribute(tmp_rl->ld, tmp_e, ber)){
61
if(strcmp(a, tmp_rl->info_used->mailattr) == 0){
62
mail = ldap_get_values(tmp_rl->ld, tmp_e, a);
66
if(mail && mail[0] && mail[0][0]){
70
(LDAP_CHOOSE_S *)fs_get(sizeof(LDAP_CHOOSE_S));
71
(*result)->ld = tmp_rl->ld;
72
(*result)->selected_entry = tmp_e;
73
(*result)->info_used = tmp_rl->info_used;
74
(*result)->serv = tmp_rl->serv;
86
else if(got_n_entries == 0)
89
WPLDAPRES_S *new_ldap_sl, *tmp_ldap_sl;
91
new_ldap_sl = (WPLDAPRES_S *)fs_get(sizeof(WPLDAPRES_S));
92
new_ldap_sl->next = NULL;
93
new_ldap_sl->reslist = ac->res_head;
94
new_ldap_sl->str = cpystr(srchstr);
95
if(wpldap_global->ldap_search_list == NULL){
96
wpldap_global->ldap_search_list = new_ldap_sl;
99
for(tmp_ldap_sl = wpldap_global->ldap_search_list;
100
tmp_ldap_sl->next; tmp_ldap_sl = tmp_ldap_sl->next);
101
tmp_ldap_sl->next = new_ldap_sl;
105
dprint((7, "calling ldap_addr_select, returning(%d)", retval));