| 1 |
/* |
| 2 |
* Copyright (c) 2010 Atheme Development Group, et al. |
| 3 |
* Rights to this code are as documented in doc/LICENSE. |
| 4 |
* |
| 5 |
* This file contains code for OS INFO |
| 6 |
* |
| 7 |
*/ |
| 8 |
|
| 9 |
#include "atheme.h" |
| 10 |
|
| 11 |
DECLARE_MODULE_V1 |
| 12 |
( |
| 13 |
"operserv/info", false, _modinit, _moddeinit, |
| 14 |
PACKAGE_STRING, |
| 15 |
VENDOR_STRING |
| 16 |
); |
| 17 |
|
| 18 |
static void os_cmd_info(sourceinfo_t *si, int parc, char *parv[]); |
| 19 |
|
| 20 |
command_t os_info = { "INFO", N_("Shows some useful information about the current settings of services."), PRIV_SERVER_AUSPEX, 1, os_cmd_info, { .path = "oservice/info" } }; |
| 21 |
|
| 22 |
void _modinit(module_t *m) |
| 23 |
{ |
| 24 |
service_named_bind_command("operserv", &os_info); |
| 25 |
} |
| 26 |
|
| 27 |
void _moddeinit(module_unload_intent_t intent) |
| 28 |
{ |
| 29 |
service_named_unbind_command("operserv", &os_info); |
| 30 |
} |
| 31 |
|
| 32 |
static void os_cmd_info(sourceinfo_t *si, int parc, char *parv[]) |
| 33 |
{ |
| 34 |
mowgli_node_t *tn, *n2; |
| 35 |
|
| 36 |
logcommand(si, CMDLOG_GET, "INFO"); |
| 37 |
|
| 38 |
command_success_nodata(si, _("How often services writes changes to the database: %d minutes"), config_options.commit_interval / 60); |
| 39 |
command_success_nodata(si, _("Default kline time: %d days"), config_options.kline_time / 86400); |
| 40 |
command_success_nodata(si, _("Will services be sending WALLOPS/GLOBOPS about various things: %s"), config_options.silent ? "no" : "yes"); |
| 41 |
command_success_nodata(si, _("How many messages before a flood is triggered, (if 0, flood protection is disabled): %d"), config_options.flood_msgs); |
| 42 |
command_success_nodata(si, _("How long before the flood counter resets: %d seconds"), config_options.flood_time); |
| 43 |
command_success_nodata(si, _("Default maximum number of clones allowed: %d"), config_options.default_clone_allowed); |
| 44 |
command_success_nodata(si, _("Number of commands used before ratelimiting starts, (if 0, ratelimiting is disabled): %d"), config_options.ratelimit_uses); |
| 45 |
command_success_nodata(si, _("How long before ratelimiting counter resets, (if 0, ratelimiting is disabled): %d seconds"), config_options.ratelimit_period); |
| 46 |
command_success_nodata(si, _("No nick ownership enabled: %s"), nicksvs.no_nick_ownership ? "yes" : "no"); |
| 47 |
command_success_nodata(si, _("Nickname expiration time: %d days"), nicksvs.expiry / 86400); |
| 48 |
command_success_nodata(si, _("Nickname enforce expiry time: %d days"), nicksvs.enforce_expiry / 86400); |
| 49 |
command_success_nodata(si, _("Default nickname enforce delay: %d seconds"), nicksvs.enforce_delay); |
| 50 |
command_success_nodata(si, _("Nickname enforce prefix: %s"), nicksvs.enforce_prefix); |
| 51 |
command_success_nodata(si, _("Maximum number of logins allowed per username: %d"), me.maxlogins); |
| 52 |
command_success_nodata(si, _("Maximum number of usernames that can be registered to one email address: %d"), me.maxusers); |
| 53 |
if (!nicksvs.no_nick_ownership) |
| 54 |
command_success_nodata(si, _("Maximum number of nicknames that one user can own: %d"), nicksvs.maxnicks); |
| 55 |
command_success_nodata(si, _("Maximum number of channels that one user can own: %d"), chansvs.maxchans); |
| 56 |
command_success_nodata(si, _("Channel expiration time: %d days"), chansvs.expiry / 86400); |
| 57 |
if (chansvs.fantasy) |
| 58 |
command_success_nodata(si, _("Default channel fantasy trigger: %s"), chansvs.trigger); |
| 59 |
command_success_nodata(si, _("Maximum number of entries allowed in a channel access list (if 0, unlimited): %d"), chansvs.maxchanacs); |
| 60 |
command_success_nodata(si, _("Maximum number of founders allowed per channel: %d"), chansvs.maxfounders); |
| 61 |
|
| 62 |
if (IS_TAINTED) |
| 63 |
{ |
| 64 |
mowgli_node_t *n; |
| 65 |
|
| 66 |
command_success_nodata(si, _("Services is presently \2TAINTED\2, no support will be given for this configuration.")); |
| 67 |
command_success_nodata(si, _("List of active taints:")); |
| 68 |
|
| 69 |
MOWGLI_ITER_FOREACH(n, taint_list.head) |
| 70 |
{ |
| 71 |
taint_reason_t *tr = n->data; |
| 72 |
|
| 73 |
command_success_nodata(si, _("Taint Condition: %s"), tr->condition); |
| 74 |
command_success_nodata(si, _("Taint Location: %s:%d"), tr->file, tr->line); |
| 75 |
command_success_nodata(si, _("Taint Explanation: %s"), tr->buf); |
| 76 |
} |
| 77 |
} |
| 78 |
|
| 79 |
MOWGLI_ITER_FOREACH(tn, nicksvs.emailexempts.head) |
| 80 |
{ |
| 81 |
command_success_nodata(si, _("Email address(es) exempt from the maximum usernames check: %s"), (char *)tn->data); |
| 82 |
} |
| 83 |
|
| 84 |
MOWGLI_ITER_FOREACH(n2, config_options.exempts.head) |
| 85 |
{ |
| 86 |
command_success_nodata(si, _("user@host mask(s) that are autokline exempt: %s"), (char *)n2->data); |
| 87 |
} |
| 88 |
|
| 89 |
hook_call_operserv_info(si); |
| 90 |
} |
| 91 |
|
| 92 |
/* vim:cinoptions=>s,e0,n0,f0,{0,}0,^0,=s,ps,t0,c3,+s,(2s,us,)20,*30,gs,hs |
| 93 |
* vim:ts=8 |
| 94 |
* vim:sw=8 |
| 95 |
* vim:noexpandtab |
| 96 |
*/ |