- }
-
-#endif
-#ifdef WITH_LDAP
- /* ldap libs are present but we are not using them... */
- if( !nickserv_conf.ldap_enable ) {
- if (!hi) {
- return NULL;
- }
- if (!checkpass(password, hi->passwd)) {
- return NULL;
- }
- }
- else if( (!hi) && ldap_result == LDAP_SUCCESS && nickserv_conf.ldap_autocreate) {
- /* user not found, but authed to ldap successfully..
- * create the account.
- */
- char *mask;
- int rc;
-
- /* Add a *@* mask */
- /* TODO if userhost is not null, build mask based on that. */
- if(nickserv_conf.default_hostmask)
- mask = "*@*";
- else
- return NULL; /* They dont have a *@* mask so they can't loc */
-
- if(!(hi = nickserv_register(NULL, NULL, handle, password, 0))) {
- return 0; /* couldn't add the user for some reason */
- }
-
- if((rc = ldap_get_user_info(handle, &email) != LDAP_SUCCESS))
- {
- if(nickserv_conf.email_required) {
- return 0;
+
+ if (!hi && (ldap_result == LDAP_SUCCESS) && nickserv_conf.ldap_autocreate) {
+ /* user not found, but authed to ldap successfully..
+ * create the account.
+ */
+ char *mask;
+ int rc;
+
+ /* Add a *@* mask */
+ /* TODO if userhost is not null, build mask based on that. */
+ if(nickserv_conf.default_hostmask)
+ mask = "*@*";
+ else
+ return NULL; /* They dont have a *@* mask so they can't loc */
+
+ if(!(hi = nickserv_register(NULL, NULL, handle, password, 0))) {
+ return 0; /* couldn't add the user for some reason */