added cmd_oauthlog and fixed cmd_authlog to be user reachable
authorpk910 <philipp@zoelle1.de>
Wed, 11 Jan 2012 14:53:41 +0000 (15:53 +0100)
committerpk910 <philipp@zoelle1.de>
Wed, 11 Jan 2012 14:53:41 +0000 (15:53 +0100)
src/nickserv.c

index bc507adf659b2be8c7e871ce4c1dbce8e10f2a0c..8632fa8312d3cb8668cd76fb6a5863b452a26e95 100644 (file)
@@ -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);