]> jfr.im git - irc/evilnet/x3.git/commitdiff
make lowercaseing accounts optional
authorrubin <redacted>
Mon, 12 Feb 2007 19:22:46 +0000 (19:22 +0000)
committerrubin <redacted>
Mon, 12 Feb 2007 19:22:46 +0000 (19:22 +0000)
ChangeLog
src/nickserv.c
src/nickserv.h
x3.conf.example

index 4fa94d92b189a5c3df401c31a3d6d71b4778d620..fade82cd1b59b5511989e59bfc83a147896cbfb3 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,6 +1,14 @@
 /***********************************************************************
 X3 ChangeLog
 
+2007-02-12  Alex Schumann  <rubin@afternet.org>
+
+       * src/nickserv.h: lowercase account name setting
+
+       * x3.conf.example: lowercase account name setting
+
+       * src/nickservc: only lowercase account names if the option is set.
+
 2007-02-12  Alex Schumann  <rubin@afternet.org>
 
        * src/tools.c: adding ircd_strtolower() func
index 2f87c703d0936a0e4d05e673ef0e7563367df09c..bc5a2810468446698a3851f7b1f877c5e48101f6 100644 (file)
 #define KEY_NOTE_NOTE "note"
 #define KEY_NOTE_SETTER "setter"
 #define KEY_NOTE_DATE "date"
+#define KEY_FORCE_HANDLES_LOWERCASE "force_handles_lowercase"
 
 #define KEY_LDAP_ENABLE "ldap_enable"
 
@@ -1293,7 +1294,8 @@ static NICKSERV_FUNC(cmd_register)
 
     NICKSERV_MIN_PARMS((unsigned)3 + nickserv_conf.email_required);
 
-    irc_strtolower(argv[1]);
+    if(nickserv_conf.force_handles_lowercase)
+        irc_strtolower(argv[1]);
     if (!is_valid_handle(argv[1])) {
         reply("NSMSG_BAD_HANDLE", argv[1]);
         return 0;
@@ -1424,7 +1426,8 @@ static NICKSERV_FUNC(cmd_oregister)
    
     account = argv[1];
     pass = argv[2];
-    irc_strtolower(account);
+    if(nickserv_conf.force_handles_lowercase)
+        irc_strtolower(account);
     if (nickserv_conf.email_required) {
         NICKSERV_MIN_PARMS(4);
         email = argv[3];
@@ -1828,7 +1831,8 @@ static NICKSERV_FUNC(cmd_rename_handle)
     unsigned int nn;
 
     NICKSERV_MIN_PARMS(3);
-    irc_strtolower(argv[2]);
+    if(nickserv_conf.force_handles_lowercase)
+        irc_strtolower(argv[2]);
     if (!(hi = get_victim_oper(cmd, user, argv[1])))
         return 0;
     if (!is_valid_handle(argv[2])) {
@@ -4172,7 +4176,8 @@ nickserv_db_read_handle(char *handle, dict_t obj)
         authed_users = NULL;
         channels = NULL;
     }
-    irc_strtolower(handle);
+    if(nickserv_conf.force_handles_lowercase)
+        irc_strtolower(handle);
     hi = register_handle(handle, str, id);
     if (authed_users) {
         hi->users = authed_users;
@@ -4571,6 +4576,10 @@ nickserv_conf_read(void)
 
     str = database_get_data(conf_node, KEY_LDAP_ENABLE, RECDB_QSTRING);
     nickserv_conf.ldap_enable = str ? strtoul(str, NULL, 0) : 0;
+
+    str = database_get_data(conf_node, KEY_FORCE_HANDLES_LOWERCASE, RECDB_QSTRING);
+    nickserv_conf.force_handles_lowercase = str ? strtol(str, NULL, 0) : 0;
+
 #ifndef WITH_LDAP
     if(nickserv_conf.ldap_enable > 0) {
         /* ldap is enabled but not compiled in - error out */
index 84adeabcc47ee99bfb2022afb4517bd5a29d5441..650227a62e2a087538678937150df7368a1d18fe 100644 (file)
@@ -182,6 +182,7 @@ struct nickserv_config {
     const char *auto_admin;
     char default_style;
     struct string_list *denied_fakehost_words;
+    unsigned int force_handles_lowercase;
     unsigned int ldap_enable;
 #ifdef WITH_LDAP
     const char *ldap_host;
index 1d2f59c50e2d9273c715f3820ca5aec8d0ccc31e..86a1896321f79f34eac3631d05e114160a81c906 100644 (file)
         // Whats a valid hostname look like for fakehosts?
         "valid_fakehost_regex" "^[-_a-zA-Z0-9.]+$";
 
+        // Force account names to lowercase? 1=yes 0=no
+        //   WARNING: this will convert when reading them from the db, too.
+        "force_handles_lowercase" "0";
+
         // "Nickserv" networks, set this to 0. "Authserv" networks,
         // set it to 1.
         "disable_nicks" "1";