34 |
|
#include "send.h" |
35 |
|
#include "msg.h" |
36 |
|
#include "parse.h" |
37 |
– |
#include "hook.h" |
37 |
|
#include "modules.h" |
38 |
|
#include "irc_string.h" |
39 |
|
|
47 |
|
{mr_admin, m_admin, ms_admin, m_ignore, ms_admin, m_ignore} |
48 |
|
}; |
49 |
|
|
51 |
– |
static struct Callback *admin_cb; |
50 |
|
const char *_version = "$Revision$"; |
51 |
|
|
54 |
– |
static void * |
55 |
– |
va_admin(va_list args) |
56 |
– |
{ |
57 |
– |
do_admin(va_arg(args, struct Client *)); |
58 |
– |
return NULL; |
59 |
– |
} |
60 |
– |
|
52 |
|
void |
53 |
|
_modinit(void) |
54 |
|
{ |
64 |
– |
admin_cb = register_callback("doing_admin", va_admin); |
55 |
|
mod_add_cmd(&admin_msgtab); |
56 |
|
} |
57 |
|
|
59 |
|
_moddeinit(void) |
60 |
|
{ |
61 |
|
mod_del_cmd(&admin_msgtab); |
72 |
– |
uninstall_hook(admin_cb, va_admin); |
62 |
|
} |
63 |
|
|
64 |
|
/*! \brief ADMIN command handler (called by unregistered, |
91 |
|
|
92 |
|
last_used = CurrentTime; |
93 |
|
|
94 |
< |
execute_callback(admin_cb, source_p, parc, parv); |
94 |
> |
do_admin(source_p); |
95 |
|
} |
96 |
|
|
97 |
|
/*! \brief NICK command handler (called by already registered, |
128 |
|
parc, parv) != HUNTED_ISME) |
129 |
|
return; |
130 |
|
|
131 |
< |
execute_callback(admin_cb, source_p, parc, parv); |
131 |
> |
do_admin(source_p); |
132 |
|
} |
133 |
|
|
134 |
|
/*! \brief ADMIN command handler (called by operators and |
149 |
|
ms_admin(struct Client *client_p, struct Client *source_p, |
150 |
|
int parc, char *parv[]) |
151 |
|
{ |
152 |
< |
if (hunt_server(client_p, source_p, ":%s ADMIN :%s", 1, parc, parv) |
153 |
< |
!= HUNTED_ISME) |
152 |
> |
if (hunt_server(client_p, source_p, ":%s ADMIN :%s", 1, |
153 |
> |
parc, parv) != HUNTED_ISME) |
154 |
|
return; |
155 |
|
|
156 |
|
if (IsClient(source_p)) |
157 |
< |
execute_callback(admin_cb, source_p, parc, parv); |
157 |
> |
do_admin(source_p); |
158 |
|
} |
159 |
|
|
160 |
|
/*! \brief Sends administrative information about this server. |
167 |
|
const char *me_name; |
168 |
|
const char *nick; |
169 |
|
|
170 |
+ |
sendto_realops_flags(UMODE_SPY, L_ALL, |
171 |
+ |
"ADMIN requested by %s (%s@%s) [%s]", |
172 |
+ |
source_p->name, source_p->username, |
173 |
+ |
source_p->host, source_p->servptr->name); |
174 |
+ |
|
175 |
|
me_name = ID_or_name(&me, source_p->from); |
176 |
|
nick = ID_or_name(source_p, source_p->from); |
177 |
|
|