From: Jochen Meesters Date: Sun, 22 Jun 2003 13:22:38 +0000 (+0000) Subject: Author: beware X-Git-Url: http://git.pk910.de/?p=ircu2.10.12-pk.git;a=commitdiff_plain;h=8d4572b605cb3ba163465aae64269d62995ac8d1 Author: beware Log message: Added OPLEVELS feature, which makes it possible to disable the +Au/oplevels stuff. git-svn-id: file:///home/klmitch/undernet-ircu/undernet-ircu-svn/ircu2/trunk@952 c9e4aea6-c8fd-4c43-8297-357d70d61c8c --- diff --git a/ChangeLog b/ChangeLog index 7fe9487..4abcfb4 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,9 @@ +2003-06-22 Bas Steendijk + + * include/ircd_features.h, ircd/channel.c, ircd/ircd_features.c, + ircd/m_kick.c, doc/example.conf: Added OPLEVELS feature, which + makes it possible to disable the +Au/oplevels functions. + 2003-06-17 Alex Badea * ircd/res_adns.c: included sys/types.h, for non-Linux diff --git a/doc/example.conf b/doc/example.conf index 3fec2e3..a35f8d9 100644 --- a/doc/example.conf +++ b/doc/example.conf @@ -761,6 +761,7 @@ features # "LOCOP_SEE_IN_SECRET_CHANNELS" = "FALSE"; # "LOCOP_WIDE_GLINE" = "FALSE"; # "LOCOP_LIST_CHAN" = "FALSE"; +# "OPLEVELS" = "TRUE"; }; # Well, you have now reached the end of this sample configuration diff --git a/include/ircd_features.h b/include/ircd_features.h index eea764b..024d458 100644 --- a/include/ircd_features.h +++ b/include/ircd_features.h @@ -49,6 +49,7 @@ enum Feature { FEAT_HIDDEN_IP, FEAT_AUTOHIDE, FEAT_CONNEXIT_NOTICES, + FEAT_OPLEVELS, /* features that probably should not be touched */ FEAT_KILLCHASETIMELIMIT, diff --git a/ircd/channel.c b/ircd/channel.c index 80030bb..fbbf535 100644 --- a/ircd/channel.c +++ b/ircd/channel.c @@ -218,10 +218,13 @@ int sub1_from_channel(struct Channel* chptr) * who then will educate them on the use of Apass/upass. */ + if (feature_bool(FEAT_OPLEVELS)) { if (TStime() - chptr->creationtime < 172800) /* Channel younger than 48 hours? */ schedule_destruct_event_1m(chptr); /* Get rid of it in approximately 4-5 minutes */ else schedule_destruct_event_48h(chptr); /* Get rid of it in approximately 48 hours */ + } else + destruct_channel(chptr); return 0; } @@ -2796,6 +2799,7 @@ mode_process_clients(struct ParseState *state) continue; } + if (feature_bool(FEAT_OPLEVELS)) { /* don't allow to deop members with an op level that is <= our own level */ if (state->sptr != state->cli_change[i].client /* but allow to deop oneself */ && state->member @@ -2810,6 +2814,7 @@ mode_process_clients(struct ParseState *state) } } } + } /* set op-level of member being opped */ if ((state->cli_change[i].flag & (MODE_ADD | MODE_CHANOP)) == @@ -2974,10 +2979,12 @@ mode_parse(struct ModeBuf *mbuf, struct Client *cptr, struct Client *sptr, break; case 'A': /* deal with Admin passes */ + if (feature_bool(FEAT_OPLEVELS)) mode_parse_apass(&state, flag_p); break; case 'u': /* deal with user passes */ + if (feature_bool(FEAT_OPLEVELS)) mode_parse_upass(&state, flag_p); break; diff --git a/ircd/ircd_features.c b/ircd/ircd_features.c index 47b6818..507e811 100644 --- a/ircd/ircd_features.c +++ b/ircd/ircd_features.c @@ -255,6 +255,7 @@ static struct FeatureDesc { F_S(HIDDEN_IP, 0, "127.0.0.1", 0), F_B(AUTOHIDE, 0, 1, 0), F_B(CONNEXIT_NOTICES, 0, 0, 0), + F_B(OPLEVELS, 0, 1, 0), /* features that probably should not be touched */ F_I(KILLCHASETIMELIMIT, 0, 30, 0), diff --git a/ircd/m_kick.c b/ircd/m_kick.c index 86d966c..97b59e4 100644 --- a/ircd/m_kick.c +++ b/ircd/m_kick.c @@ -91,6 +91,7 @@ #include "numeric.h" #include "numnicks.h" #include "send.h" +#include "ircd_features.h" #include @@ -141,7 +142,7 @@ int m_kick(struct Client *cptr, struct Client *sptr, int parc, char *parv[]) return send_reply(sptr, ERR_USERNOTINCHANNEL, cli_name(who), chptr->chname); /* Don't allow to kick member with a higher or equal op-level */ - if (OpLevel(member) <= OpLevel(member2)) + if ((OpLevel(member) <= OpLevel(member2)) && feature_bool(FEAT_OPLEVELS)) return send_reply(sptr, ERR_NOTLOWEROPLEVEL, cli_name(who), chptr->chname, OpLevel(member2), OpLevel(member), "kick", OpLevel(member) == OpLevel(member2) ? "the same" : "a higher");