Add default-network setting.
authorJelmer Vernooij <jelmer@samba.org>
Fri, 23 Nov 2007 15:46:08 +0000 (16:46 +0100)
committerJelmer Vernooij <jelmer@samba.org>
Fri, 23 Nov 2007 15:46:08 +0000 (16:46 +0100)
NEWS
config.default
src/settings.c

diff --git a/NEWS b/NEWS
index ede5f09..e10e384 100644 (file)
--- a/NEWS
+++ b/NEWS
@@ -11,8 +11,10 @@ Ctrlproxy 3.0.4 UNRELEASED
 
     * Announce number of clients/channels during client login. (#162)
 
-       * Add "set" command in the administration interface, including 
-         initial settings "log_level", "motd-file" and "report-time". (#6)
+    * Add "set" command in the administration interface, including 
+      initial settings "log_level", "motd-file" and "report-time". (#6)
+
+    * Add "default-network" setting.
 
   BUG FIXES
 
@@ -67,9 +69,9 @@ Ctrlproxy 3.0.4 UNRELEASED
 
     * Make connect to networks non-blocking. (#133)
 
-       * Support IRCD 005 parameter. (#160)
+    * Support IRCD 005 parameter. (#160)
 
-       * Redirect DCC messages to clients. (#163)
+    * Redirect DCC messages to clients. (#163)
 
   NEW FEATURES
 
index 6f72bab..12c3844 100644 (file)
@@ -31,6 +31,10 @@ password=
 # Set "bind" to make ctrlproxy only listen on a specific IP address:
 #bind=192.168.4.3
 
+# Network that will be used when simply connecting to ctrlproxy 
+# without using SOCKS or the CONNECT command
+default-network=admin
+
 # Override motd-file location
 #motd-file = /tmp/my-motd
 
index 9b234a3..c44bc5e 100644 (file)
@@ -179,6 +179,10 @@ static void config_save_listeners(struct ctrlproxy_config *cfg, const char *path
 
                        if (g_key_file_has_key(cfg->keyfile, "global", "ssl", NULL) || l->ssl)
                                g_key_file_set_boolean(cfg->keyfile, "global", "ssl", l->ssl);
+
+                       if (l->network != NULL)
+                               g_key_file_set_string(cfg->keyfile, "global", "default-network",
+                                                                 l->network);
                } else {
                        char *tmp;
                        empty = FALSE;
@@ -583,6 +587,8 @@ static void config_load_listeners(struct ctrlproxy_config *cfg)
                                 g_key_file_get_boolean(cfg->keyfile, "global", "ssl", NULL);
                l->is_default = TRUE;
 
+               l->network = g_key_file_get_string(cfg->keyfile, "global", "default-network", NULL);
+
                cfg->listeners = g_list_append(cfg->listeners, l);
        }