From 7f7039bc6843a03327351267b75112f81b64277f Mon Sep 17 00:00:00 2001 From: pk910 Date: Wed, 11 Jan 2012 15:53:41 +0100 Subject: [PATCH] added cmd_oauthlog and fixed cmd_authlog to be user reachable --- src/nickserv.c | 21 +++++++++++++++++++-- 1 file changed, 19 insertions(+), 2 deletions(-) diff --git a/src/nickserv.c b/src/nickserv.c index bc507ad..8632fa8 100644 --- a/src/nickserv.c +++ b/src/nickserv.c @@ -2010,9 +2010,25 @@ reg_allowauth_func(allowauth_func_t func) allowauth_func_list[allowauth_func_used++] = func; } +static int cmd_authlog_func(struct userNode *user, struct svccmd *cmd, struct handle_info *hi); + static MODCMD_FUNC(cmd_authlog) { - struct handle_info *hi = user->handle_info; + return cmd_authlog_func(user, cmd, user->handle_info); +} + +static MODCMD_FUNC(cmd_oauthlog) { + struct handle_info *hi; + + NICKSERV_MIN_PARMS(1); + + if (!(hi = get_victim_oper(user, argv[1]))) + return 0; + + return cmd_authlog_func(user, cmd, hi); +} + +static int cmd_authlog_func(struct userNode *user, struct svccmd *cmd, struct handle_info *hi) { struct helpfile_table tbl; struct authlogEntry *authlog; int i = 0; @@ -4911,7 +4927,8 @@ init_nickserv(const char *nick) nickserv_define_func("MERGEDB", cmd_mergedb, 999, 1, 0); nickserv_define_func("CHECKPASS", cmd_checkpass, 601, 1, 0); nickserv_define_func("CHECKEMAIL", cmd_checkemail, 0, 1, 0); - nickserv_define_func("AUTHLOG", cmd_authlog, 0, 1, 0); + nickserv_define_func("AUTHLOG", cmd_authlog, -1, 1, 0); + nickserv_define_func("OAUTHLOG", cmd_oauthlog, 0, 1, 0); /* other options */ dict_insert(nickserv_opt_dict, "INFO", opt_info); dict_insert(nickserv_opt_dict, "WIDTH", opt_width); -- 2.20.1