+2005-10-12 Perry Lorier <isomer@undernet.org>
+
+ * include/s_stats.h: Add new "Local" only flag to /stats.
+
+ * ircd/m_stats.c: Consult it.
+
+ * ircd/s_stats.c: Use the flag.
+
2004-01-04 Kevin L Mitchell <klmitch@mit.edu>
* ircd/s_numeric.c (do_numeric): fix a crash when a numeric is
#define STAT_FLAG_OPERONLY 0x01 /**< Oper-only stat */
#define STAT_FLAG_OPERFEAT 0x02 /**< Oper-only if the feature is true */
-#define STAT_FLAG_CASESENS 0x04 /**< Flag is case-sensitive */
-#define STAT_FLAG_VARPARAM 0x08 /**< May have an extra parameter */
+#define STAT_FLAG_LOCONLY 0x04 /**< Local user only */
+#define STAT_FLAG_CASESENS 0x08 /**< Flag is case-sensitive */
+#define STAT_FLAG_VARPARAM 0x10 /**< May have an extra parameter */
extern void stats_init(void);
const struct StatDesc *stats_find(const char *name_or_char);
((sd->sd_flags & STAT_FLAG_OPERFEAT) && feature_bool(sd->sd_control))))
return send_reply(cptr, ERR_NOPRIVILEGES);
+ /* Check if they are a local user */
+ if ((sd->sd_flags & STAT_FLAG_LOCONLY) && !MyUser(cptr))
+ return send_reply(cptr, ERR_NOPRIVILEGES);
+
/* Check for extra parameter */
if ((sd->sd_flags & STAT_FLAG_VARPARAM) && parc > 3 && !EmptyString(parv[3]))
param = parv[3];
/** Contains information about all statistics. */
struct StatDesc statsinfo[] = {
- { 'a', "nameservers", STAT_FLAG_OPERFEAT, FEAT_HIS_STATS_a,
+ { 'a', "nameservers", STAT_FLAG_OPERFEAT|STAT_FLAG_LOCONLY, FEAT_HIS_STATS_a,
report_dns_servers, 0,
"DNS servers." },
{ 'c', "connect", STAT_FLAG_OPERFEAT, FEAT_HIS_STATS_c,