*
* x3 is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
- * the Free Software Foundation; either version 2 of the License, or
+ * the Free Software Foundation; either version 3 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
#endif
hi = dict_find(nickserv_handle_dict, argv[1], NULL);
pw_arg = 2;
+#ifdef notdef
} else if (argc == 2) {
if (nickserv_conf.disable_nicks) {
if (!(hi = get_handle_info(user->nick))) {
hi = ni->owner;
}
pw_arg = 1;
+#endif
} else {
reply("MSG_MISSING_PARAMS", argv[0]);
svccmd_send_help_brief(user, nickserv, cmd);
}
#ifdef WITH_LDAP
if( ( nickserv_conf.ldap_enable && ldap_result == LDAP_INVALID_CREDENTIALS ) ||
- ( !nickserv_conf.ldap_enable && !checkpass(passwd, hi->passwd) ) ) {
+ ( (!nickserv_conf.ldap_enable) && (!checkpass(passwd, hi->passwd)) ) ) {
#else
if (!checkpass(passwd, hi->passwd)) {
#endif
rc = ldap_add2group(target->handle, nickserv_conf.ldap_oper_group_dn);
else
rc = ldap_delfromgroup(target->handle, nickserv_conf.ldap_oper_group_dn);
- if(rc != LDAP_SUCCESS) {
+ if(rc != LDAP_SUCCESS && rc != LDAP_TYPE_OR_VALUE_EXISTS && rc != LDAP_NO_SUCH_ATTRIBUTE) {
send_message(user, bot, "NSMSG_LDAP_FAIL", ldap_err2string(rc));
return 0;
}
} else {
reply("MSG_INVALID_CRITERIA", cmp);
}
+#ifdef WITH_LDAP
} else if (nickserv_conf.ldap_enable && !irccasecmp(argv[i], "inldap")) {
i++;
if(true_string(argv[i])) {
else {
reply("MSG_INVALID_BINARY", argv[i]);
}
+#endif
} else {
reply("MSG_INVALID_CRITERIA", argv[i]);
goto fail;
search_add2ldap_func (struct userNode *source, struct handle_info *match)
{
#ifdef WITH_LDAP
- int rc = ldap_do_add(match->handle, match->passwd, match->email_addr);
- if(rc != LDAP_SUCCESS) {
- send_message(source, nickserv, "NSMSG_LDAP_FAIL_ADD", match->handle, ldap_err2string(rc));
+ int rc;
+ if(match->email_addr && match->passwd && match->handle) {
+ rc = ldap_do_add(match->handle, match->passwd, match->email_addr);
+ if(rc != LDAP_SUCCESS) {
+ send_message(source, nickserv, "NSMSG_LDAP_FAIL_ADD", match->handle, ldap_err2string(rc));
+ }
}
#endif
}