-#ifdef WITH_LDAP
- if(strchr(argv[1], '<') || strchr(argv[1], '>')) {
- reply("NSMSG_NO_ANGLEBRACKETS");
- return 0;
- }
- if (!is_valid_handle(argv[1])) {
- reply("NSMSG_BAD_HANDLE", argv[1]);
- return 0;
- }
-
- if(nickserv_conf.ldap_enable) {
- ldap_result = ldap_check_auth(argv[1], argv[2]);
- /* Get the users email address and update it */
- if(ldap_result == LDAP_SUCCESS) {
- int rc;
- if((rc = ldap_get_user_info(argv[1], &email) != LDAP_SUCCESS))
- {
- if(nickserv_conf.email_required) {
- reply("NSMSG_LDAP_FAIL_GET_EMAIL", ldap_err2string(rc));
- return 0;
- }
- }
- }
- else if(ldap_result != LDAP_INVALID_CREDENTIALS) {
- reply("NSMSG_LDAP_FAIL", ldap_err2string(ldap_result));
- return 0;
- }
- }
-
-#endif
- hi = dict_find(nickserv_handle_dict, argv[1], NULL);