Revision: 2716
          http://ipcop.svn.sourceforge.net/ipcop/?rev=2716&view=rev
Author:   owes
Date:     2009-04-17 10:34:40 +0000 (Fri, 17 Apr 2009)

Log Message:
-----------
In case of installation give option to change RED TYPE to Modem, so only 1 NIC 
is enough.

Modified Paths:
--------------
    ipcop/trunk/langs/install.new.en.pl
    ipcop/trunk/src/installer/networking.c

Modified: ipcop/trunk/langs/install.new.en.pl
===================================================================
--- ipcop/trunk/langs/install.new.en.pl 2009-04-17 05:16:14 UTC (rev 2715)
+++ ipcop/trunk/langs/install.new.en.pl 2009-04-17 10:34:40 UTC (rev 2716)
@@ -80,6 +80,7 @@
 'TR_NO_GREEN_INTERFACE' => 'No GREEN interface assigned.',
 'TR_NO_HARDDISK_MODPROBE' => 'No hard disk found. You can now either Rescan 
drives, enter a modulename for manual Modprobe or Cancel installation.',
 'TR_NO_PASSWORD_ECHO' => '\t\tNo echo from keyboard for password input.',
+'TR_NO_RED_INTERFACE_RESET_TYPE' => 'No RED interface assigned. Do you want to 
change RED type to Analog Modem?',
 'TR_NOT_USED' => 'Not used',
 'TR_OK' => 'Ok',
 'TR_PASSWORDS' => 'Passwords',

Modified: ipcop/trunk/src/installer/networking.c
===================================================================
--- ipcop/trunk/src/installer/networking.c      2009-04-17 05:16:14 UTC (rev 
2715)
+++ ipcop/trunk/src/installer/networking.c      2009-04-17 10:34:40 UTC (rev 
2716)
@@ -606,7 +606,10 @@
 }
 
 
-/* Detect cards, list cards and assign colours to them. */
+/* Detect cards, list cards and assign colours to them.
+ * There is currently no escape if there are no network cards since
+ * a firewall is pretty useless without networking.
+ * When installing allow to change RED type in case there are not enough 
network cards. */
 static void cardlist(void)
 {
     int i, count;
@@ -654,6 +657,7 @@
                 }
             }
             if (!count) {
+                /* We will always need at least 1 green NIC */
                 errorbox(gettext("TR_NO_GREEN_INTERFACE"));
                 break;
             }
@@ -665,10 +669,29 @@
                         count++;
                     }
                 }
-                if (!count) {
+                if (!count && !flag_installer) {
                     errorbox(gettext("TR_NO_RED_INTERFACE"));
                     break;
                 }
+                if (!count) {
+                    rc = newtWinChoice(ipcop_gettext("TR_TITLE_DISK"),
+                           ipcop_gettext("TR_CANCEL"), ipcop_gettext("TR_OK"),
+                           ipcop_gettext("TR_NO_RED_INTERFACE_RESET_TYPE"));
+
+                    if (rc == 2) {
+                        /* Bail out by resetting RED type to analog */
+                        strcpy(kv_red_type, "ANALOG");
+                        update_kv(&eth_kv, "RED_1_TYPE", kv_red_type);
+                        update_kv(&eth_kv, "RED_1_DEV", "");
+                        update_kv(&eth_kv, "RED_COUNT", "0");
+
+                        changed_config = 1;
+                        changed_type = 1;
+                    }
+                    else {
+                        break;
+                    }
+                }
             }
 
             if (changed_config) {


This was sent by the SourceForge.net collaborative development platform, the 
world's largest Open Source development site.

------------------------------------------------------------------------------
Stay on top of everything new and different, both inside and 
around Java (TM) technology - register by April 22, and save
$200 on the JavaOne (SM) conference, June 2-5, 2009, San Francisco.
300 plus technical and hands-on sessions. Register today. 
Use priority code J9JMT32. http://p.sf.net/sfu/p
_______________________________________________
Ipcop-svn mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/ipcop-svn

Reply via email to