#include "gline.h"
#include "global.h"
#include "nickserv.h"
+#include "chanserv.h"
#include "modcmd.h"
#include "opserv.h"
#include "timeq.h"
#define KEY_EXPIRES "expires"
#define KEY_STAFF_AUTH_CHANNEL "staff_auth_channel"
#define KEY_STAFF_AUTH_CHANNEL_MODES "staff_auth_channel_modes"
+#define KEY_STAFF_AUTH_FORCE_OPS "staff_auth_force_opers"
#define KEY_CLONE_GLINE_DURATION "clone_gline_duration"
#define KEY_BLOCK_GLINE_DURATION "block_gline_duration"
#define KEY_ISSUER "issuer"
struct chanNode *debug_channel;
struct chanNode *alert_channel;
struct chanNode *staff_auth_channel;
+ int staff_auth_force;
struct policer_params *join_policer_params;
struct policer new_user_policer;
unsigned long untrusted_max;
return dict_find(opserv_devnull_classes, name, NULL);
}
+void operpart(struct chanNode *chan, struct userNode *user)
+{
+ if(opserv_conf.alert_channel && opserv_conf.staff_auth_force > 0 &&
+ !(irccasecmp(chan->name,opserv_conf.alert_channel->name))) {
+ struct mod_chanmode *change;
+ change = find_matching_bans(&chan->banlist, user, NULL); //don't join them if they're banned (exceptions from forced join)
+ if(change)
+ return;
+ irc_svsjoin(opserv,user,chan);
+ }
+}
+
+void operadd(struct userNode *user)
+{
+ if(opserv_conf.alert_channel && opserv_conf.staff_auth_force > 0)
+ irc_svsjoin(opserv,user,opserv_conf.alert_channel);
+}
+
+void operdel(struct userNode *user)
+{
+ if(opserv_conf.alert_channel && opserv_conf.staff_auth_force == 2)
+ irc_kick(opserv, user, opserv_conf.alert_channel, "mode -o");
+}
+
static void
opserv_conf_read(void)
{
str2 = "+timns";
opserv_conf.staff_auth_channel = AddChannel(str, now, str2, NULL);
AddChannelUser(opserv, opserv_conf.staff_auth_channel)->modes |= MODE_CHANOP;
+ str2 = database_get_data(conf_node, KEY_STAFF_AUTH_FORCE_OPS, RECDB_QSTRING);
+ opserv_conf.staff_auth_force = str2 ? atoi(str2) : 0;
} else {
opserv_conf.staff_auth_channel = NULL;
+ opserv_conf.staff_auth_force = 0;
}
str = database_get_data(conf_node, KEY_UNTRUSTED_MAX, RECDB_QSTRING);
opserv_conf.untrusted_max = str ? strtoul(str, NULL, 0) : 5;