Author: Jeannot Langlois
authorMichael Poole <mdpoole@troilus.org>
Sun, 25 Feb 2007 14:32:41 +0000 (14:32 +0000)
committerMichael Poole <mdpoole@troilus.org>
Sun, 25 Feb 2007 14:32:41 +0000 (14:32 +0000)
Make ERR_NEEDREGGEDNICK more informative at the raw protocol level.

git-svn-id: file:///home/klmitch/undernet-ircu/undernet-ircu-svn/ircu2/branches/u2_10_12_branch@1763 c9e4aea6-c8fd-4c43-8297-357d70d61c8c

ChangeLog
doc/example.conf
doc/readme.features
include/ircd_features.h
ircd/ircd_features.c
ircd/m_join.c
ircd/s_err.c

index c0f94cf85127b48e2acd8237318ce6ba75616fff..231e4ae6e4949b7ca89fe543e96056dda82f0bea 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,19 @@
+2007-01-27  Jeannot Langlois <jeannot12@linuxmail.org>
+
+       * doc/example.conf (Features): Illustrate URLREG feature.
+
+       * doc/readme.features (URLREG): Define new feature.
+
+       * include/ircd_features.h (Feature): Add FEAT_URLREG.
+
+       * ircd/ircd_features.c (features): Set the default value.
+
+       * ircd/m_join.c (m_join): For ERR_NEEDREGGEDNICK, include the
+       URLREG value as a format argument.
+
+       * ircd/s_err.c (replyTable): Update ERR_NEEDREGGEDNICK
+       appropriately.
+
 2007-02-03  Michael Poole <mdpoole@troilus.org>
 
        * ircd/ircd_reply.c (protocol_violation): Avoid reusing the
index 99ab66288a5e5b2c70ea23f66ea6122bc289b458..a5d57bc67cfc89ec2c67ee9cfeb6b1373e6e8286 100644 (file)
@@ -866,6 +866,7 @@ features
 #  "HIS_SERVERNAME" = "*.undernet.org";
 #  "HIS_SERVERINFO" = "The Undernet Underworld";
 #  "HIS_URLSERVERS" = "http://www.undernet.org/servers.php";
+#  "URLREG" = "http://cservice.undernet.org/live/";
 };
 
 # Well, you have now reached the end of this sample configuration
index 07a405c6a785b5b5a7a7aecacad385e3e9310545..de1b33276cf3769e9bea5e8de4cbfb6c062926cd 100644 (file)
@@ -765,6 +765,14 @@ URL_CLIENTS
 
 This defines a URL that users may visit to find compatible IRC clients.
 
+URLREG
+ * Type: string
+ * Default: "http://cservice.undernet.org/live/"
+
+This defines a URL that is used in server response 477 (ERR_NEEDREGGEDNICK) to
+let users know which website they must visit to obtain a proper account for
+authentication.
+
 NICKLEN
  * Type: integer
  * Default: 12
index 737ffc92a7e4a3879614cffece8c677f55e8b145..f4b3330dbc91a463d9208845628a83008b27cd5d 100644 (file)
@@ -154,6 +154,7 @@ enum Feature {
   /* Misc. random stuff */
   FEAT_NETWORK,
   FEAT_URL_CLIENTS,
+  FEAT_URLREG,
 
   FEAT_LAST_F
 };
index fa33160228642ac355535688eada3f35bd4e1094..fad403a55eddf3189fe5531950986d0cf492946c 100644 (file)
@@ -407,6 +407,7 @@ static struct FeatureDesc {
   /* Misc. random stuff */
   F_S(NETWORK, 0, "UnderNet", 0),
   F_S(URL_CLIENTS, 0, "ftp://ftp.undernet.org/pub/irc/clients", 0),
+  F_S(URLREG, 0, "http://cservice.undernet.org/live/", 0),
 
 #undef F_S
 #undef F_B
index 33d857fa9ad67a18893e54539522b235baea8cfa..26d9c2deb04f6caec3836e6daf409bc9d4a09bb1 100644 (file)
@@ -239,7 +239,17 @@ int m_join(struct Client *cptr, struct Client *sptr, int parc, char *parv[])
 
       /* Is there some reason the user may not join? */
       if (err) {
-        send_reply(sptr, err, chptr->chname);
+        switch(err) {
+          case ERR_NEEDREGGEDNICK:
+            send_reply(sptr, 
+                       ERR_NEEDREGGEDNICK, 
+                       chptr->chname, 
+                       feature_str(FEAT_URLREG));            
+            break;
+          default:
+            send_reply(sptr, err, chptr->chname);
+            break;
+        }
         continue;
       }
 
index 6beece82f3ee02644f56bb0fefa4e7eb644f4d74..dd36800845d709e77fb43536303c7cd23e05ea99 100644 (file)
@@ -986,7 +986,7 @@ static Numeric replyTable[] = {
 /* 476 */
   { ERR_BADCHANMASK, "%s :Bad Channel Mask", "476" },
 /* 477 */
-  { ERR_NEEDREGGEDNICK, "%s :Cannot join channel (+r)", "477" },
+  { ERR_NEEDREGGEDNICK, "%s :Cannot join channel (+r): this channel requires authentication -- you can obtain an account from %s", "477" },
 /* 478 */
   { ERR_BANLISTFULL, "%s %s :Channel ban/ignore list is full", "478" },
 /* 479 */