]> jfr.im git - irc/evilnet/x3.git/blobdiff - src/nickserv.c
Added some bits from check_ctcp into the mark version handling
[irc/evilnet/x3.git] / src / nickserv.c
index 0006546d99dd1356146cec8b1b9f5f63cfadd439..63ef9d638ab6c19b2a65cbc0c9660d4b6300e1f4 100644 (file)
@@ -5,7 +5,7 @@
  *
  * 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,
@@ -1062,10 +1062,10 @@ nickserv_register(struct userNode *user, struct userNode *settee, const char *ha
        return 0;
     }
 
-    if(strlen(handle) > 15)
+    if(strlen(handle) > 30)
     {  
         if(user)
-          send_message(user, nickserv, "NSMSG_HANDLE_TOLONG", handle, 15);
+          send_message(user, nickserv, "NSMSG_HANDLE_TOLONG", handle, 30);
         return 0;
     }
 
@@ -1874,9 +1874,9 @@ static NICKSERV_FUNC(cmd_rename_handle)
         reply("NSMSG_HANDLE_EXISTS", argv[2]);
         return 0;
     }
-    if(strlen(argv[2]) > 15)
+    if(strlen(argv[2]) > 30)
     {
-        reply("NMSG_HANDLE_TOLONG", argv[2], 15);
+        reply("NMSG_HANDLE_TOLONG", argv[2], 30);
         return 0;
     }
 #ifdef WITH_LDAP
@@ -1959,6 +1959,10 @@ struct handle_info *loc_auth(char *handle, char *password)
     }
 //    else           
 #else
+    if (!hi) {
+        return NULL;
+    }
+
     if (!checkpass(password, hi->passwd)) {
         return NULL;
     }
@@ -2089,6 +2093,7 @@ static NICKSERV_FUNC(cmd_auth)
 #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))) {
@@ -2107,6 +2112,7 @@ static NICKSERV_FUNC(cmd_auth)
             hi = ni->owner;
         }
         pw_arg = 1;
+#endif
     } else {
         reply("MSG_MISSING_PARAMS", argv[0]);
         svccmd_send_help_brief(user, nickserv, cmd);
@@ -2164,7 +2170,7 @@ static NICKSERV_FUNC(cmd_auth)
     }
 #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