ViewVC Help
View File | Revision Log | Show Annotations | Download File
/cvs/cvsroot/ermyth/modules/operserv/inject.C
Revision: 1.5
Committed: Tue Aug 28 17:08:11 2007 UTC (19 years, 1 month ago) by pippijn
Content type: text/plain
Branch: MAIN
Changes since 1.4: +14 -22 lines
Log Message:
- changed name
- updated the example config to the new system
- added more documentation
- enhanced documentation generators
- added a link to the pdf to the website
- added an RSS feed generator
- transitioned hooks to c++ callbacks
- did various merges with upstream along the way
- added const where appropriate
- removed the old block allocator
- fixed most memory leaks
- transitioned some dictionaries to std::map
- transitioned some lists to std::vector
- made some free functions members where appropriate
- renamed string to dynstr and added a static string ststr
- use NOW instead of time (NULL) if possible
- completely reworked database backends, crypto handlers and protocol handlers
  to use an object factory
- removed the old module system. ermyth does not do any dynamic loading anymore
- fixed most of the build system
- reworked how protocol commands work

File Contents

# User Rev Content
1 pippijn 1.1 /*
2 pippijn 1.5 * Copyright © 2003-2004 E. Will et al.
3     * Copyright © 2005-2006 Atheme Development Group
4 pippijn 1.2 * Rights to this code are documented in doc/pod/license.pod.
5 pippijn 1.1 *
6 pippijn 1.5 * This file contains functionality which implements the OperServ INJECT command.
7 pippijn 1.1 *
8 pippijn 1.5 * $Id: inject.C,v 1.4 2007-07-22 18:38:43 pippijn Exp $
9 pippijn 1.1 */
10    
11     #include "atheme.h"
12 pippijn 1.5 #include <ermyth/module.h>
13 pippijn 1.1 #include "uplink.h"
14    
15 pippijn 1.5 static char const rcsid[] = "$Id: inject.C,v 1.4 2007-07-22 18:38:43 pippijn Exp $";
16 pippijn 1.1
17 pippijn 1.5 REGISTER_MODULE ("operserv/inject", false, "The Ermyth Team <http://ermyth.schmorp.de>");
18 pippijn 1.1
19     static void os_cmd_inject (sourceinfo_t *si, int parc, char *parv[]);
20    
21 pippijn 1.5 command_t const os_inject = { "INJECT", N_("Fakes data from the uplink (debugging tool)."), PRIV_ADMIN, 1, os_cmd_inject };
22 pippijn 1.1
23 pippijn 1.5 E cmdvec os_cmdtree;
24     E helpvec os_helptree;
25 pippijn 1.1
26 pippijn 1.5 bool
27     _modinit (module *m)
28 pippijn 1.1 {
29     os_cmdtree << os_inject;
30 pippijn 1.4 help_addentry (os_helptree, "INJECT", "help/operserv/inject", NULL);
31 pippijn 1.5
32     return true;
33 pippijn 1.1 }
34    
35     void
36     _moddeinit ()
37     {
38     os_cmdtree >> os_inject;
39     help_delentry (os_helptree, "INJECT");
40     }
41    
42     static void
43     os_cmd_inject (sourceinfo_t *si, int parc, char *parv[])
44     {
45     char *inject;
46     static bool injecting = false;
47     inject = parv[0];
48    
49     if (!config_options.raw)
50     return;
51    
52     if (!inject)
53     {
54     command_fail (si, fault_needmoreparams, STR_INSUFFICIENT_PARAMS, "INJECT");
55     command_fail (si, fault_needmoreparams, _("Syntax: INJECT <parameters>"));
56     return;
57     }
58    
59     logcommand (si, CMDLOG_ADMIN, "INJECT %s", inject);
60    
61     /* looks like someone INJECT'd an INJECT command.
62     * this is probably a bad thing.
63     */
64     if (injecting == true)
65     {
66     command_fail (si, fault_noprivs, _("You cannot inject an INJECT command."));
67     return;
68     }
69    
70     injecting = true;
71     irc_parse (inject);
72     injecting = false;
73     }
74    
75     /* vim:cinoptions=>s,e0,n0,f0,{0,}0,^0,=s,ps,t0,c3,+s,(2s,us,)20,*30,gs,hs
76     * vim:ts=8
77     * vim:sw=8
78     * vim:noexpandtab
79     */