From: Michael Poole Date: Sun, 25 Feb 2007 14:32:41 +0000 (+0000) Subject: Author: Jeannot Langlois X-Git-Url: http://git.pk910.de/?p=ircu2.10.12-pk.git;a=commitdiff_plain;h=f3e9ec2fae92670731ddfa83ef46247553c3dfce Author: Jeannot Langlois 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 --- diff --git a/ChangeLog b/ChangeLog index c0f94cf..231e4ae 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,19 @@ +2007-01-27 Jeannot Langlois + + * 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 * ircd/ircd_reply.c (protocol_violation): Avoid reusing the diff --git a/doc/example.conf b/doc/example.conf index 99ab662..a5d57bc 100644 --- a/doc/example.conf +++ b/doc/example.conf @@ -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 diff --git a/doc/readme.features b/doc/readme.features index 07a405c..de1b332 100644 --- a/doc/readme.features +++ b/doc/readme.features @@ -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 diff --git a/include/ircd_features.h b/include/ircd_features.h index 737ffc9..f4b3330 100644 --- a/include/ircd_features.h +++ b/include/ircd_features.h @@ -154,6 +154,7 @@ enum Feature { /* Misc. random stuff */ FEAT_NETWORK, FEAT_URL_CLIENTS, + FEAT_URLREG, FEAT_LAST_F }; diff --git a/ircd/ircd_features.c b/ircd/ircd_features.c index fa33160..fad403a 100644 --- a/ircd/ircd_features.c +++ b/ircd/ircd_features.c @@ -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 diff --git a/ircd/m_join.c b/ircd/m_join.c index 33d857f..26d9c2d 100644 --- a/ircd/m_join.c +++ b/ircd/m_join.c @@ -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; } diff --git a/ircd/s_err.c b/ircd/s_err.c index 6beece8..dd36800 100644 --- a/ircd/s_err.c +++ b/ircd/s_err.c @@ -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 */