Author: beware
authorJochen Meesters <spike@undernet.org>
Sun, 22 Jun 2003 13:22:38 +0000 (13:22 +0000)
committerJochen Meesters <spike@undernet.org>
Sun, 22 Jun 2003 13:22:38 +0000 (13:22 +0000)
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

ChangeLog
doc/example.conf
include/ircd_features.h
ircd/channel.c
ircd/ircd_features.c
ircd/m_kick.c

index 7fe948758481285c95c05f76a04c4ea350b985f2..4abcfb44827b4b502b52f9c859dbfbb2aef2d2d6 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,9 @@
+2003-06-22  Bas Steendijk  <steendijk@xs4all.nl>
+
+       * 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  <vampire@p16.pub.ro>
 
        * ircd/res_adns.c: included sys/types.h, for non-Linux
index 3fec2e3101b1797807a1a7aaf3d3bec36ff78560..a35f8d949e5a7b4f7dd1ce9754059ae1bd213d4a 100644 (file)
@@ -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
index eea764b1c0194c658f5dc4c4d18d7741c7b662bd..024d4589464a23eec59b10cdf3e356de6670be11 100644 (file)
@@ -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,
index 80030bbdd7b8f7ee40de8d1d3728dd764d86a725..fbbf5358b614c3ddd826c936d02b840866e166da 100644 (file)
@@ -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;
 
index 47b6818f1c7e388d4a6786f6032504c0cab78d83..507e811e3acc8d0e3484642a03cdda569a40011e 100644 (file)
@@ -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),
index 86d966c75b3bfcffab84c98c4612d24ca3fef213..97b59e4d1b18f77d76555d5164b454175dbc28db 100644 (file)
@@ -91,6 +91,7 @@
 #include "numeric.h"
 #include "numnicks.h"
 #include "send.h"
+#include "ircd_features.h"
 
 #include <assert.h>
 
@@ -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");