source: tags/start/plugins/admin_flood.tcl @ 1143

Revision 2, 1.4 KB checked in by jamesoff, 9 years ago (diff)

Initial revision

  • Property svn:eol-style set to native
  • Property svn:executable set to *
  • Property svn:keywords set to Author Date Id Revision
Line 
1# bMotion: admin plugin file for flood mangement
2#
3# $Id$
4#
5
6###############################################################################
7# This is a bMotion plugin
8# Copyright (C) James Michael Seward 2000-2002
9#
10# This program is covered by the GPL, please refer the to LICENCE file in the
11# distribution; further information can be found in the headers of the scripts
12# in the modules directory.
13###############################################################################
14
15proc bMotion_plugin_admin_flood { handle idx { arg "" }} {
16  global bMotion_flood_info bMotion_flood_last bMotion_flood_lasttext bMotion_flood_undo
17 
18  #flood show <handle>
19  if [regexp -nocase {show ([^ ]+)} $arg matches handle] {
20    putidx $idx "bMotion: Flood for $handle is [bMotion_flood_get $handle]\r"
21    return 0
22  }
23
24  #flood set <handle> <n>
25  if [regexp -nocase {set ([^ ]+) (.+)} $arg matches handle value] {
26    set bMotion_flood_info($handle) $value
27    putidx $idx "bMotion: flood for $handle set to 0\r"
28    return 0
29  }
30
31
32  #status
33  if [regexp -nocase {status} $arg] {
34    set handles [array names bMotion_flood_info]
35    putidx $idx "bMotion: current flood info:\r"
36    foreach handle $handles {
37      putidx $idx "$handle: [bMotion_flood_get $handle]\r"
38    }
39    return 0
40  }
41
42  #all else fails, list help
43  putidx $idx ".bmadmin flood \[show|set|status\]\r"
44  return 0
45}
46
47# register the plugin
48bMotion_plugin_add_admin "flood" "^flood" n "bMotion_plugin_admin_flood" "any"
Note: See TracBrowser for help on using the repository browser.