From: splidge Date: Sat, 20 Feb 2010 21:04:36 +0000 (+0000) Subject: Merge - fixed conflicts in chanserv/authcmds/authhistory.c. X-Git-Url: https://jfr.im/git/irc/quakenet/newserv.git/commitdiff_plain/063c7d263a4e744b801148a0e7fd425782713d11 Merge - fixed conflicts in chanserv/authcmds/authhistory.c. --- 063c7d263a4e744b801148a0e7fd425782713d11 diff --cc chanserv/authcmds/authhistory.c index ac3f8fd9,1816a037..44f32a27 --- a/chanserv/authcmds/authhistory.c +++ b/chanserv/authcmds/authhistory.c @@@ -110,33 -119,29 +119,42 @@@ int csa_doauthhistory(void *source, in if (!(rup=getreguserfromnick(sender))) return CMD_ERROR; - if (cargc >= 1) { - if (!(trup=findreguser(sender, cargv[0]))) + if (cargc) { + if (!ircd_strcmp(cargv[0], "-a")) { + if (UHasOperPriv(rup)) + limit=0; + + arg++; + } + } + + if (cargc > arg) { + if (!(trup=findreguser(sender, cargv[arg]))) return CMD_ERROR; - /* don't allow non-opers to view oper auth history, but allow helpers to view non-oper history */ - if ((trup != rup) && ((UHasOperPriv(trup) && !UHasOperPriv(rup)) || !UHasHelperPriv(rup))) { - chanservstdmessage(sender, QM_NOACCESSONUSER, "authhistory", cargv[arg]); - return CMD_ERROR; + /* if target != command issuer */ + if (trup != rup) { + /* only opers and helpers can view authhistory of other users */ + if (!UHasHelperPriv(rup)) { - chanservstdmessage(sender, QM_NOACCESSONUSER, "authhistory", cargv[0]); ++ chanservstdmessage(sender, QM_NOACCESSONUSER, "authhistory", cargv[arg]); + return CMD_ERROR; + } + + /* and only opers can view opers history */ + if (UHasOperPriv(trup) && !UHasOperPriv(rup)) { + chanservwallmessage("%s (%s) just FAILED using AUTHHISTORY on %s", sender->nick, rup->username, trup->username); - chanservstdmessage(sender, QM_NOACCESSONUSER, "authhistory", cargv[0]); ++ chanservstdmessage(sender, QM_NOACCESSONUSER, "authhistory", cargv[arg]); + return CMD_ERROR; + } + + /* checks passed */ - + chanservwallmessage("%s (%s) used AUTHHISTORY on %s", sender->nick, rup->username, trup->username); } } else { trup=rup; } - csdb_retreiveauthhistory(sender, trup, 10); - ++ + csdb_retreiveauthhistory(sender, trup, limit); return CMD_OK; }