]> git.ipfire.org Git - ipfire-2.x.git/commitdiff
wlanap.cgi: set channel manually if no channels are reported.
authorArne Fitzenreiter <arne_f@ipfire.org>
Sun, 24 Feb 2013 12:44:03 +0000 (13:44 +0100)
committerArne Fitzenreiter <arne_f@ipfire.org>
Sun, 24 Feb 2013 12:44:03 +0000 (13:44 +0100)
html/cgi-bin/wlanap.cgi

index 83d65dbdb478efb5f2c3baf6774ae701fc3c8b79..5eb480007b2542048256399a98bc67a911639303 100644 (file)
@@ -2,7 +2,7 @@
 ###############################################################################
 #                                                                             #
 # IPFire.org - A linux based firewall                                         #
-# Copyright (C) 2005-2012  IPFire Team  <info@ipfire.org>                     #
+# Copyright (C) 2005-2013  IPFire Team  <info@ipfire.org>                     #
 #                                                                             #
 # This program is free software: you can redistribute it and/or modify        #
 # it under the terms of the GNU General Public License as published by        #
@@ -391,16 +391,31 @@ print <<END
                <option value='wpa1+2' $selected{'ENC'}{'wpa1+2'}>WPA1+2</option>
        </select>
 </td></tr>
+END
+;
+
+#
+# If channel's found use a select dropdown if not a text inputfield.
+if ( scalar @channellist > 0 ){
+       print <<END
 <tr><td width='25%' class='base'>$Lang::tr{'wlanap channel'}:&nbsp;</td><td class='base' colspan='3'>
        <select name='CHANNEL'>
 END
 ;
-foreach $channel (@channellist){
-       print "<option $selected{'CHANNEL'}{$channel}>$channel</option>";
+       foreach $channel (@channellist){
+               print "<option $selected{'CHANNEL'}{$channel}>$channel</option>";
+       }
+       print "</select></td></tr>"
+} else {
+       print <<END
+<tr><td width='25%' class='base'>$Lang::tr{'wlanap channel'}:&nbsp;</td><td class='base' colspan='3'>
+<input type='text' name='CHANNEL' size='10' value='$wlanapsettings{'CHANNEL'}' />
+</td></tr>
+END
+;
 }
 
 print <<END
-</select></td></tr>
 <tr><td width='25%' class='base'>$Lang::tr{'wlanap country'}:&nbsp;</td><td class='base' colspan='3'>
        <select name='COUNTRY'>
 END