Ver código fonte

* Fixed cmd_mns_host using multiple hosts

svn: 1251
Bryan Drewery 22 anos atrás
pai
commit
ef188a81a7
3 arquivos alterados com 14 adições e 4 exclusões
  1. 1 0
      doc/UPDATES
  2. 1 1
      misc/help.txt
  3. 12 3
      src/cmds.c

+ 1 - 0
doc/UPDATES

@@ -38,6 +38,7 @@ This is a summary of ChangeLog basically.
 * Ignores are now checked before host is checked for access for telnet
 * cmd_mop no longer ops users without a pass set.
 * Alphabetized config list
+* cmd_mns_host now accepts multiple hosts
 
 1.1.9
 

+ 1 - 1
misc/help.txt

@@ -99,7 +99,7 @@ See also: exempts, +exempt, stick, unstick
 ###  %b-host%b <hostmask>
    Removes a host from your handle.
 %{+m|m}
-###  %b-host%b <handle> <hostmask>
+###  %b-host%b <handle> <hostmask> [anotherhost] ...
    Removes a hostmask from a user's user record.
 %{-}
  

+ 12 - 3
src/cmds.c

@@ -3524,7 +3524,7 @@ static void cmd_mns_host(struct userrec *u, int idx, char *par)
 
   putlog(LOG_CMDS, "*", "#%s# -host %s", dcc[idx].nick, par);
   if (!par[0]) {
-    dprintf(idx, "Usage: -host [handle] <hostmask>\n");
+    dprintf(idx, "Usage: -host [handle] <hostmask> [anotherhost] ...\n");
     return;
   }
   handle = newsplit(&par);
@@ -3578,11 +3578,20 @@ static void cmd_mns_host(struct userrec *u, int idx, char *par)
     }
   }
   if (delhost_by_handle(handle, host)) {
-    dprintf(idx, "Removed '%s' from %s.\n", host, handle);
+    dprintf(idx, "Removed host '%s' from %s.\n", host, handle);
     update_mod(handle, dcc[idx].nick, "-host", host);
+
+    while (par[0]) {
+      host = newsplit(&par);
+      addhost_by_handle(handle, host);
+      if (delhost_by_handle(handle, host)) {
 #ifdef LEAF
-    check_this_user(handle, 2, host);
+        check_this_user(handle, 2, host);
 #endif /* LEAF */
+        dprintf(idx, "Removed host '%s' from %s.\n", host, handle);
+      }
+    }
+
 #ifdef HUB
     write_userfile(idx);
 #endif /* HUB */