1 |
/** |
2 |
* raw.C: This file contains functionality which implements the OperServ RAW command. |
3 |
* |
4 |
* Copyright © 2007 Pippijn van Steenhoven / The Ermyth Team |
5 |
* Rights to this code are as documented in COPYING. |
6 |
* |
7 |
* |
8 |
* Portions of this file were derived from sources bearing the following license: |
9 |
* Copyright © 2005-2006 Atheme Development Group |
10 |
* Rights to this code are documented in doc/pod/license.pod. |
11 |
* |
12 |
* $Id: raw.C,v 1.7 2007-09-16 18:54:44 pippijn Exp $ |
13 |
*/ |
14 |
|
15 |
#include "atheme.h" |
16 |
#include <ermyth/module.h> |
17 |
#include "uplink.h" |
18 |
|
19 |
static char const rcsid[] = "$Id: raw.C,v 1.7 2007-09-16 18:54:44 pippijn Exp $"; |
20 |
|
21 |
REGISTER_MODULE ("operserv/raw", false, "The Ermyth Team <http://ermyth.xinutec.org>"); |
22 |
|
23 |
static void os_cmd_raw (sourceinfo_t *si, int parc, char *parv[]); |
24 |
|
25 |
command_t const os_raw = { "RAW", N_("Sends data to the uplink."), PRIV_ADMIN, 1, os_cmd_raw }; |
26 |
|
27 |
E cmdvec os_cmdtree; |
28 |
E helpvec os_helptree; |
29 |
|
30 |
bool |
31 |
_modinit (module *m) |
32 |
{ |
33 |
os_cmdtree << os_raw; |
34 |
help_addentry (os_helptree, "RAW", "help/operserv/raw", NULL); |
35 |
|
36 |
return true; |
37 |
} |
38 |
|
39 |
void |
40 |
_moddeinit () |
41 |
{ |
42 |
os_cmdtree >> os_raw; |
43 |
help_delentry (os_helptree, "RAW"); |
44 |
} |
45 |
|
46 |
static void |
47 |
os_cmd_raw (sourceinfo_t *si, int parc, char *parv[]) |
48 |
{ |
49 |
char *s = parv[0]; |
50 |
|
51 |
if (!config_options.raw) |
52 |
return; |
53 |
|
54 |
if (!s) |
55 |
{ |
56 |
command_fail (si, fault::needmoreparams, STR_INSUFFICIENT_PARAMS, "RAW"); |
57 |
command_fail (si, fault::needmoreparams, _("Syntax: RAW <parameters>")); |
58 |
return; |
59 |
} |
60 |
|
61 |
snoop ("RAW: \"%s\" by \2%s\2", s, get_oper_name (si)); |
62 |
logcommand (si, CMDLOG_ADMIN, "RAW %s", s); |
63 |
sts ("%s", s); |
64 |
} |
65 |
|
66 |
/* vim:cinoptions=>s,e0,n0,f0,{0,}0,^0,=s,ps,t0,c3,+s,(2s,us,)20,*30,gs,hs |
67 |
* vim:ts=8 |
68 |
* vim:sw=8 |
69 |
* vim:noexpandtab |
70 |
*/ |