X-Git-Url: https://jfr.im/git/irc/evilnet/x3.git/blobdiff_plain/b1bf690d5e16c7f79d3ec308ffdc705e007ce6e5..5a1daaaba65bb61921c1274fd8672cb91bae4268:/src/opserv.c diff --git a/src/opserv.c b/src/opserv.c index 9951f3b..6c8cd14 100644 --- a/src/opserv.c +++ b/src/opserv.c @@ -76,6 +76,7 @@ #define KEY_BLOCK_GLINE_DURATION "block_gline_duration" #define KEY_ISSUER "issuer" #define KEY_ISSUED "issued" +#define KEY_ADMIN_LEVEL "admin_level" #define IDENT_FORMAT "%s [%s@%s/%s]" #define IDENT_DATA(user) user->nick, user->ident, user->hostname, inet_ntoa(user->ip) @@ -203,7 +204,8 @@ static const struct message_entry msgtab[] = { { "OSMSG_USER_SEARCH_RESULTS", "The following users were found:" }, { "OSMSG_USER_SEARCH_HEADER", "Nick User@Host (Account)" }, { "OSMSG_USER_SEARCH_BAR", "-------------------------------------------" }, - { "OSMSG_USER_SEARCH_COUNT", "------------ Found %4u matches -----------" }, + { "OSMSG_USER_SEARCH_COUNT", "There were %4u matches" }, + { "OSMSG_USER_SEARCH_COUNT_BAR", "------------ Found %4u matches -----------" }, { "OSMSG_CHANNEL_SEARCH_RESULTS", "The following channels were found:" }, { "OSMSG_GLINE_SEARCH_RESULTS", "The following glines were found:" }, { "OSMSG_LOG_SEARCH_RESULTS", "The following log entries were found:" }, @@ -303,6 +305,7 @@ static struct { unsigned long purge_lock_delay; unsigned long join_flood_moderate; unsigned long join_flood_moderate_threshold; + unsigned long admin_level; } opserv_conf; struct trusted_host { @@ -3568,7 +3571,7 @@ static MODCMD_FUNC(cmd_trace) if (action == trace_print_func) { - reply("OSMSG_USER_SEARCH_RESULTS"); + reply("OSMSG_USER_SEARCH_RESULTS"); reply("OSMSG_USER_SEARCH_BAR"); reply("OSMSG_USER_SEARCH_HEADER"); reply("OSMSG_USER_SEARCH_BAR"); @@ -3590,9 +3593,14 @@ static MODCMD_FUNC(cmd_trace) dict_foreach(das.dict, opserv_show_hostinfo, &das); if (matches) - reply("OSMSG_USER_SEARCH_COUNT", matches); + { + if(action == trace_print_func) + reply("OSMSG_USER_SEARCH_COUNT_BAR", matches); + else + reply("OSMSG_USER_SEARCH_COUNT", matches); + } else - reply("MSG_NO_MATCHES"); + reply("MSG_NO_MATCHES"); if (das.discrim->channel) UnlockChannel(das.discrim->channel); @@ -4143,6 +4151,10 @@ opserv_conf_read(void) } else { opserv_conf.staff_auth_channel = NULL; } + + str = database_get_data(conf_node, KEY_ADMIN_LEVEL, RECDB_QSTRING); + opserv_conf.admin_level = str ? strtoul(str, NULL, 0): 800; + str = database_get_data(conf_node, KEY_UNTRUSTED_MAX, RECDB_QSTRING); opserv_conf.untrusted_max = str ? strtoul(str, NULL, 0) : 5; str = database_get_data(conf_node, KEY_PURGE_LOCK_DELAY, RECDB_QSTRING); @@ -4181,6 +4193,13 @@ opserv_conf_read(void) dict_foreach(child, set_policer_param, pp); } +/* lame way to export opserv_conf value to nickserv.c ... */ +unsigned int +opserv_conf_admin_level() +{ + return(opserv_conf.admin_level); +} + static void opserv_db_init(void) { /* set up opserv_trusted_hosts dict */