Bladeren bron

* Added var 'auth-chan' which allows disabling auth cmds in all channels.

svn: 2341
Bryan Drewery 21 jaren geleden
bovenliggende
commit
6a456c2fbf
5 gewijzigde bestanden met toevoegingen van 23 en 19 verwijderingen
  1. 1 0
      doc/UPDATES
  2. 1 0
      misc/help.txt
  3. 18 18
      src/mod/irc.mod/chan.c
  4. 2 0
      src/set.c
  5. 1 1
      src/set.h

+ 1 - 0
doc/UPDATES

@@ -17,6 +17,7 @@ Lines prefixed with '-' were disabled before release and are not finished, or ar
 * Booting a su'd user now returns the user to their original connection. (Problem when removing +i)
 * (eggdrop1.6) Fixed bot not requesting topic after reseting channel.
 * Fixed hubs not updating NODENAME/OS/USERNAME, which broke updating on new nets.
+* Added var 'auth-chan' which allows disabling auth cmds in all channels.
 
 1.2.6
 * (REVERTED FROM 1.2.3) Disabled all memory allocations after a segfault (Fixes CPU spinning)

+ 1 - 0
misc/help.txt

@@ -1509,6 +1509,7 @@ See also: reload, backup
 [S]  $bchanset$b         List of default options for when a channel is added. Same format 
                           as 'chanset'.
 [N]  $bserver-port$b     Default port to use for server connections.
+[B]  $bauth-chan$b       Allows disabling auth channel cmds for all channels.
 [S]  $bauth-key$b        The authkey used during authing.G ive to users if they need to auth. 
                           (can be bot specific)
 [C]  $bauth-prefix$b     The prefix character used for msg cmds, ie: $u!$uop or $u.$uop

+ 18 - 18
src/mod/irc.mod/chan.c

@@ -3004,26 +3004,26 @@ static int gotmsg(char *from, char *msg)
     
     if (!(chan = findchan(realto)))
       return 0;
-    my_msg = my_ptr = strdup(msg);
-
-    fword = newsplit(&my_msg);		/* take out first word */
-    
-    /* the first word is a wildcard match to our nick. */
-    botmatch = wild_match(fword, botname);
-    if (botmatch && strcmp(fword, "*"))	
-      fword = newsplit(&my_msg);	/* now this will be the command */
-    /* is it a cmd? */
-    if (fword && fword[0] && fword[1] && ((botmatch && fword[0] != auth_prefix[0]) || (fword[0] == auth_prefix[0]))) {
-      Auth *auth = Auth::Find(uhost);
-
-      if (auth && auth->Authed()) {
-        if (fword[0] == auth_prefix[0])
-          fword++;
-        auth->atime = now;
-        check_bind_authc(fword, auth, chan->dname, my_msg);
+    if (auth_chan) {
+      my_msg = my_ptr = strdup(msg);
+      fword = newsplit(&my_msg);		/* take out first word */
+      /* the first word is a wildcard match to our nick. */
+      botmatch = wild_match(fword, botname);
+      if (botmatch && strcmp(fword, "*"))	
+        fword = newsplit(&my_msg);	/* now this will be the command */
+      /* is it a cmd? */
+      if (fword && fword[0] && fword[1] && ((botmatch && fword[0] != auth_prefix[0]) || (fword[0] == auth_prefix[0]))) {
+        Auth *auth = Auth::Find(uhost);
+
+        if (auth && auth->Authed()) {
+          if (fword[0] == auth_prefix[0])
+            fword++;
+          auth->atime = now;
+          check_bind_authc(fword, auth, chan->dname, my_msg);
+        }
       }
+      free(my_ptr);
     }
-    free(my_ptr);
     irc_log(chan, "%s<%s> %s", to[0] == '@' ? "@" : "", nick, msg);
     update_idle(chan->dname, nick);
   }

+ 2 - 0
src/set.c

@@ -21,6 +21,7 @@
 int set_noshare = 0;
 int dcc_autoaway = 1800;
 bool auth_obscure = 0;
+bool auth_chan = 1;
 char alias[1024] = "bc botcmd,bl botcmd ?,+list set +,-list set -,list set list";
 char auth_key[51] = "";
 char auth_prefix[2] = "";
@@ -51,6 +52,7 @@ bool manop_warn = 1;
 
 static variable_t vars[] = {
  {"alias",		alias,			sizeof(alias),			VAR_STRING|VAR_LIST|VAR_NOLOC|VAR_PERM, NULL, NULL},
+ {"auth-chan",		&auth_chan,		0,				VAR_INT|VAR_BOOL|VAR_NOLHUB, NULL, NULL},
  {"auth-key",		auth_key,		sizeof(auth_key),		VAR_STRING|VAR_PERM, NULL, NULL},
  {"auth-prefix",	auth_prefix,		sizeof(auth_prefix),		VAR_STRING|VAR_NOLHUB|VAR_PERM, NULL, NULL},
  {"auth-obscure",	&auth_obscure,		0,				VAR_INT|VAR_BOOL, NULL, NULL},

+ 1 - 1
src/set.h

@@ -52,7 +52,7 @@ typedef struct rate_b {
 
 extern char		auth_key[], auth_prefix[2], motd[], *def_chanset, alias[],
 			msgident[], msginvite[], msgop[], msgpass[], process_list[];
-extern bool		dccauth, auth_obscure, offensive_bans, manop_warn;
+extern bool		dccauth, auth_obscure, offensive_bans, manop_warn, auth_chan;
 extern int		cloak_script, fight_threshold, fork_interval, in_bots, set_noshare, dcc_autoaway,
 			kill_threshold, lag_threshold, op_bots, badprocess, hijack, login, promisc, trace;
 extern rate_t		op_requests, close_threshold;