X-Git-Url: https://jfr.im/git/solanum.git/blobdiff_plain/885203035d6a873457e5c5eb12bff5c501d11179..ea41b24fd4807e3565bf5f8f293e2efc4c20b62d:/modules/m_admin.c diff --git a/modules/m_admin.c b/modules/m_admin.c index 49d60f84..955ea42f 100644 --- a/modules/m_admin.c +++ b/modules/m_admin.c @@ -20,8 +20,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 * USA - * - * $Id: m_admin.c 3368 2007-04-03 10:11:06Z nenolod $ */ #include "stdinc.h" @@ -36,99 +34,93 @@ #include "hook.h" #include "modules.h" -static int m_admin(struct Client *, struct Client *, int, const char **); -static int mr_admin(struct Client *, struct Client *, int, const char **); -static int ms_admin(struct Client *, struct Client *, int, const char **); +const char admin_desc[] = + "Provides the ADMIN command to show server administrator information"; + +static void m_admin(struct MsgBuf *, struct Client *, struct Client *, int, const char **); +static void mr_admin(struct MsgBuf *, struct Client *, struct Client *, int, const char **); +static void ms_admin(struct MsgBuf *, struct Client *, struct Client *, int, const char **); static void do_admin(struct Client *source_p); static void admin_spy(struct Client *); struct Message admin_msgtab = { - "ADMIN", 0, 0, 0, MFLG_SLOW | MFLG_UNREG, + "ADMIN", 0, 0, 0, 0, {{mr_admin, 0}, {m_admin, 0}, {ms_admin, 0}, mg_ignore, mg_ignore, {ms_admin, 0}} }; int doing_admin_hook; mapi_clist_av1 admin_clist[] = { &admin_msgtab, NULL }; -mapi_hlist_av1 admin_hlist[] = { +mapi_hlist_av1 admin_hlist[] = { { "doing_admin", &doing_admin_hook }, { NULL, NULL } }; -DECLARE_MODULE_AV1(admin, NULL, NULL, admin_clist, admin_hlist, NULL, "$Revision: 3368 $"); +DECLARE_MODULE_AV2(admin, NULL, NULL, admin_clist, admin_hlist, NULL, NULL, NULL, admin_desc); /* * mr_admin - ADMIN command handler - * parv[0] = sender prefix - * parv[1] = servername + * parv[1] = servername */ -static int -mr_admin(struct Client *client_p, struct Client *source_p, int parc, const char *parv[]) +static void +mr_admin(struct MsgBuf *msgbuf_p, struct Client *client_p, struct Client *source_p, int parc, const char *parv[]) { static time_t last_used = 0L; - if((last_used + ConfigFileEntry.pace_wait) > CurrentTime) + if((last_used + ConfigFileEntry.pace_wait) > rb_current_time()) { - sendto_one(source_p, form_str(RPL_LOAD2HI), - me.name, - EmptyString(source_p->name) ? "*" : source_p->name, + sendto_one(source_p, form_str(RPL_LOAD2HI), + me.name, + EmptyString(source_p->name) ? "*" : source_p->name, "ADMIN"); - return 0; + return; } else - last_used = CurrentTime; + last_used = rb_current_time(); do_admin(source_p); - - return 0; } /* * m_admin - ADMIN command handler - * parv[0] = sender prefix * parv[1] = servername */ -static int -m_admin(struct Client *client_p, struct Client *source_p, int parc, const char *parv[]) +static void +m_admin(struct MsgBuf *msgbuf_p, struct Client *client_p, struct Client *source_p, int parc, const char *parv[]) { static time_t last_used = 0L; if(parc > 1) { - if((last_used + ConfigFileEntry.pace_wait) > CurrentTime) + if((last_used + ConfigFileEntry.pace_wait) > rb_current_time()) { sendto_one(source_p, form_str(RPL_LOAD2HI), me.name, source_p->name, "ADMIN"); - return 0; + return; } else - last_used = CurrentTime; - + last_used = rb_current_time(); + if(hunt_server(client_p, source_p, ":%s ADMIN :%s", 1, parc, parv) != HUNTED_ISME) - return 0; + return; } do_admin(source_p); - - return 0; } /* * ms_admin - ADMIN command handler, used for OPERS as well - * parv[0] = sender prefix * parv[1] = servername */ -static int -ms_admin(struct Client *client_p, struct Client *source_p, int parc, const char *parv[]) +static void +ms_admin(struct MsgBuf *msgbuf_p, struct Client *client_p, struct Client *source_p, int parc, const char *parv[]) { if(hunt_server(client_p, source_p, ":%s ADMIN :%s", 1, parc, parv) != HUNTED_ISME) - return 0; + return; do_admin(source_p); - - return 0; }