#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)
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 {
opserv_bad_channel(const char *name)
{
unsigned int found;
+ int present;
- dict_find(opserv_exempt_channels, name, &found);
- if (found)
+ dict_find(opserv_exempt_channels, name, &present);
+ if (present)
return 0;
if (gline_find(name))
alert->discrim->reason = strdup(name);
alert->reaction = reaction;
dict_insert(opserv_user_alerts, name_dup, alert);
- if (alert->discrim->channel)
+ /* Stick the alert into the appropriate additional alert dict(s).
+ * For channel alerts, we only use channels and min_channels;
+ * max_channels would have to be checked on /part, which we do not
+ * yet do, and which seems of questionable value.
+ */
+ if (alert->discrim->channel || alert->discrim->min_channels)
dict_insert(opserv_channel_alerts, name_dup, alert);
- else if (alert->discrim->mask_nick)
+ if (alert->discrim->mask_nick)
dict_insert(opserv_nick_based_alerts, name_dup, alert);
return alert;
}
} 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);
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 */