]> jfr.im git - irc/rqf/shadowircd.git/blobdiff - modules/m_set.c
mkpasswd: Default to MD5-based crypt instead of SHA-based.
[irc/rqf/shadowircd.git] / modules / m_set.c
index 066fdb29d50ec8ae75dee74610c806ef8f326fac..f803f727798e40d4d0396ce10e519a8f7e91bbf6 100644 (file)
@@ -21,7 +21,6 @@
  *  Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307
  *  USA
  *
- *  $Id: m_set.c 3406 2007-04-13 19:06:53Z jilles $
  */
 
 /* rewritten by jdc */
@@ -36,6 +35,7 @@
 #include "common.h"
 #include "channel.h"
 #include "s_conf.h"
+#include "s_user.h"
 #include "s_newconf.h"
 #include "msg.h"
 #include "parse.h"
@@ -71,6 +71,7 @@ static void quote_floodcount(struct Client *, const char *, int);
 static void quote_identtimeout(struct Client *, const char *, int);
 static void quote_max(struct Client *, const char *, int);
 static void quote_operstring(struct Client *, const char *, int);
+static void quote_operhost(struct Client *, const char *, int);
 static void quote_spamnum(struct Client *, const char *, int);
 static void quote_spamtime(struct Client *, const char *, int);
 static void quote_splitmode(struct Client *, const char *, int);
@@ -98,6 +99,7 @@ static struct SetStruct set_cmd_table[] = {
        {"IDENTTIMEOUT", quote_identtimeout,    0,      1       },
        {"MAX",         quote_max,              0,      1       },
        {"MAXCLIENTS",  quote_max,              0,      1       },
+       {"OPERHOST",    quote_operhost,         1,      0       },
        {"OPERSTRING",  quote_operstring,       1,      0       },
        {"SPAMNUM",     quote_spamnum,          0,      1       },
        {"SPAMTIME",    quote_spamtime,         0,      1       },
@@ -247,6 +249,29 @@ quote_max(struct Client *source_p, const char *arg, int newval)
        }
 }
 
+/* SET OPERHOST */
+static void
+quote_operhost(struct Client *source_p, const char *arg, int newval)
+{
+       if(EmptyString(arg))
+       {
+               sendto_one_notice(source_p, ":OPERHOST is currently '%s'", GlobalSetOptions.operhost);
+       }
+       else if(!valid_hostname(arg))
+       {
+               sendto_one_notice(source_p, "Invalid hostmask.");
+       }
+       else
+       {
+               rb_strlcpy(GlobalSetOptions.operhost, arg,
+                       sizeof(GlobalSetOptions.operhost));
+               
+               sendto_realops_snomask(SNO_GENERAL, L_ALL,
+                                    "%s has changed OPERHOST to '%s'",
+                                    get_oper_name(source_p), arg);
+       }
+}
+
 /* SET OPERSTRING */
 static void
 quote_operstring(struct Client *source_p, const char *arg, int newval)
@@ -379,6 +404,7 @@ quote_splitmode(struct Client *source_p, const char *charval, int intval)
                        splitchecking = 0;
 
                        rb_event_delete(check_splitmode_ev);
+                       check_splitmode_ev = NULL;
                }
                /* ON */
                else if(newval == 1)
@@ -392,6 +418,7 @@ quote_splitmode(struct Client *source_p, const char *charval, int intval)
 
                        /* we might be deactivating an automatic splitmode, so pull the event */
                        rb_event_delete(check_splitmode_ev);
+                       check_splitmode_ev = NULL;
                }
                /* AUTO */
                else if(newval == 2)