diff -r -u 0.7.0.4/bin/thinclient 0.7.1.1/bin/thinclient --- 0.7.0.4/bin/thinclient 2006-09-01 00:32:14.000000000 +0900 +++ 0.7.1.1/bin/thinclient 2006-11-20 21:28:21.000000000 +0900 @@ -18,7 +18,7 @@ # gather information about this machine WLMAC=$( ifconfig $wifi_ifname|grep HWaddr|sed -e "s/^.*HWaddr //" |sed -e "s/ //g" ) WLMAC2=$( ifconfig $lan_ifname|grep HWaddr|sed -e "s/^.*HWaddr //" |sed -e "s/ //g" ) -ETMAC=$( ifconfig $wan_ifname|grep HWaddr|sed -e "s/^.*HWaddr //" |sed -e "s/ //g" ) +ETMAC=$( ifconfig eth0|grep HWaddr|sed -e "s/^.*HWaddr //" |sed -e "s/ //g" ) FONREV="$(cat /etc/fon_revision)" FIRMWARE="$(cat /etc/fon_version)" diff -r -u 0.7.0.4/etc/banner 0.7.1.1/etc/banner --- 0.7.0.4/etc/banner 2006-09-13 02:41:30.000000000 +0900 +++ 0.7.1.1/etc/banner 2006-11-22 04:07:20.000000000 +0900 @@ -4,7 +4,7 @@ | | |_______||__| |__| |___| - Fonera Firmware (Version 0.7.0 rev 4) ------------- + Fonera Firmware (Version 0.7.1 rev 1) ------------- * * Based on OpenWrt - http://openwrt.org * Powered by FON - http://www.fon.com diff -r -u 0.7.0.4/etc/fon_revision 0.7.1.1/etc/fon_revision --- 0.7.0.4/etc/fon_revision 2006-09-12 06:43:42.000000000 +0900 +++ 0.7.1.1/etc/fon_revision 2006-11-16 05:08:40.000000000 +0900 @@ -1 +1 @@ -4 +1 diff -r -u 0.7.0.4/etc/fon_version 0.7.1.1/etc/fon_version --- 0.7.0.4/etc/fon_version 2006-09-01 00:32:14.000000000 +0900 +++ 0.7.1.1/etc/fon_version 2006-11-16 05:08:40.000000000 +0900 @@ -1 +1 @@ -0.7.0 +0.7.1 diff -r -u 0.7.0.4/etc/functions.sh 0.7.1.1/etc/functions.sh --- 0.7.0.4/etc/functions.sh 2006-09-01 00:32:14.000000000 +0900 +++ 0.7.1.1/etc/functions.sh 2006-11-15 02:44:26.000000000 +0900 @@ -112,3 +112,18 @@ esac } +# +# This functions forwards a port. The next args are required: +# $1 = WAN interface +# $2 = Origin Port +# $3 = Destination IP +# $4 = Destination Port +# $5 = protocol used +# +# Example: open_port $WAN 8080 192.168.1.2 80 tcp +# +open_port() { + iptables -t nat -A prerouting_rule -i $1 -p $5 --dport $2 -j DNAT --to-destination $3:$4 + pdots=`echo $4 | sed 's/-/:/g'` + iptables -A forwarding_rule -i $1 -p $5 --dport $pdots -d $3 -j ACCEPT +} diff -r -u 0.7.0.4/etc/init.d/S45firewall 0.7.1.1/etc/init.d/S45firewall --- 0.7.0.4/etc/init.d/S45firewall 2006-09-01 01:30:55.000000000 +0900 +++ 0.7.1.1/etc/init.d/S45firewall 2006-11-17 22:12:29.000000000 +0900 @@ -105,3 +105,7 @@ } # check if the connection is already up and add WAN_HOOK rules automatically env -i ACTION=ifup INTERFACE=wan /bin/sh /etc/hotplug.d/iface/20-firewall +# +# Forwarded ports +# +/etc/config/openports $WAN diff -r -u 0.7.0.4/etc/init.d/rcS 0.7.1.1/etc/init.d/rcS --- 0.7.0.4/etc/init.d/rcS 2006-09-12 22:16:13.000000000 +0900 +++ 0.7.1.1/etc/init.d/rcS 2006-11-15 02:44:26.000000000 +0900 @@ -21,13 +21,24 @@ done while :; do + lock -w /var/run/restart-services + + # just in case + lock -u /var/run/network-connection + killall lock + + # grab the locks again lock /var/run/restart-services + lock /var/run/network-connection + killall N50chillispot killall chilli killall dnsmasq ifup lan_noinet ifup wan /etc/init.d/S45firewall + + lock -w /var/run/network-connection for i in /etc/init.d/N*; do $i start 2>&1 done diff -r -u 0.7.0.4/etc/sysctl.conf 0.7.1.1/etc/sysctl.conf --- 0.7.0.4/etc/sysctl.conf 2006-09-01 00:32:14.000000000 +0900 +++ 0.7.1.1/etc/sysctl.conf 2006-11-08 03:04:39.000000000 +0900 @@ -6,3 +6,4 @@ net.ipv4.tcp_keepalive_time=120 net.ipv4.tcp_timestamps=0 net.ipv4.tcp_vegas_cong_avoid=1 +net.ipv4.ip_local_port_range=4096 8192 diff -r -u 0.7.0.4/usr/lib/webif/advanced.sh 0.7.1.1/usr/lib/webif/advanced.sh --- 0.7.0.4/usr/lib/webif/advanced.sh 2006-09-01 00:32:13.000000000 +0900 +++ 0.7.1.1/usr/lib/webif/advanced.sh 2006-11-15 02:44:26.000000000 +0900 @@ -1,22 +1,32 @@ ADV_SUBMENU=" - Internet Connection + @TR<> - Network Settings + @TR<> - Wireless Settings + @TR<> + + + + @TR<> + + + - Firmware Upgrade + @TR<> + " + + diff -r -u 0.7.0.4/usr/lib/webif/form.awk 0.7.1.1/usr/lib/webif/form.awk --- 0.7.0.4/usr/lib/webif/form.awk 2006-09-01 00:32:13.000000000 +0900 +++ 0.7.1.1/usr/lib/webif/form.awk 2006-11-17 21:48:32.000000000 +0900 @@ -25,7 +25,7 @@ FS="|" } -# trim leading whitespaces +# trim leading whitespaces { gsub(/^[ \t]+/,"",$1) } @@ -41,7 +41,139 @@ $1 ~ /^infotext/ { close_field() - print "

@TR<<" $2 ">>

" + print "

@TR<<" $2 ">>

" +} + + +# +# Table issues +# + +$1 ~/^infotable/ { + close_field() + print "

@TR<<" $2 ">>

" +} + +# +# $2: the summary of the table. +# + +$1 ~ /^start_table/ { + close_field() + print "" +} + +$1 ~ /^start_border_table/ { + close_field() + print " " +} + +$1 ~ /^end_table/ { + close_field() + print "
" + print " " + print " " + print "
" + print " " +} + +$1 ~ /^end_border_table/ { + close_field() + print "
" + print "
" + print "
" +} + +# +# $2: The title of the table +# +$1 ~ /^table_caption/ { + close_field() + print "" $2 "" +} + +# +# Begins a new row to the table +# +$1 ~ /^add_row/ { + close_field() + print "" +} + + +$1 ~ /^end_row/ { + close_field() + print "" +} +# +# Add a cell to the row: +# $2: height of the row +# $3: width of the row +# $4: text of the row +$1 ~ /^add_title_cell/ { + close_field() + print "@TR<<" $2 ">>" +} + +$1 ~ /^add_normal_cell/ { + close_field() + print "" $2 "" +} + +$1 ~ /^add_label_cell/ { + close_field() + print "" $2 "" +} + +$1 ~ /^add_pass_cell/ { + close_field + print "" + print "" $5 + print "" +} + +$1 ~ /^start_select_cell/ { + opts = "" + if (onchange != "") opts = opts " onChange=\"" onchange "()\"" + print "" + print "" +} + +$1 ~ /^add_input_cell/ { + print "" + print "" $5 + print "" + +} + +$1 ~ /^add_button_cell/ { + close_field() + print "" + print "" + print "" + +} + +$1 ~ /^add_check_cell/ { + opts="" + if (onchange != "") opts = opts " onClick=\"" onchange "()\" onChange=\"" onchange "()\"" + print ""$3 + print "" + print "" +} + +# Draw a line +$1 ~ /^draw_line/ { + close_field() + print "
" } $1 ~ /^start_div/ { @@ -73,7 +205,7 @@ } $1 ~ /^select/ { opts = "" - if (onchange != "") opts = opts " onClick=\"" onchange "()\" onChange=\"" onchange "()\"" + if (onchange != "") opts = opts " onChange=\"" onchange "()\"" print "" $4 } $1 ~ /^password/ { print "" $4 } -$1 ~ /^submit/ { +$1 ~ /^submit/ { close_field() - print "" + print "" } ($1 ~ /^checkbox/) || ($1 ~ /^radio/) { @@ -103,3 +235,5 @@ END { close_field() } + + diff -r -u 0.7.0.4/usr/lib/webif/validate.awk 0.7.1.1/usr/lib/webif/validate.awk --- 0.7.0.4/usr/lib/webif/validate.awk 2006-09-01 00:32:13.000000000 +0900 +++ 0.7.1.1/usr/lib/webif/validate.awk 2006-11-18 03:01:48.000000000 +0900 @@ -8,14 +8,20 @@ output="" } -{ - valid_type = 0 - valid = 1 - # XXX: weird hack, but it works... - n = split($0, param, "|") - value = param[5] - for (i = 6; i <= n; i++) value = value FS param[i] - verr = "" +{ + valid_type = 0 + valid = 1 + if ( $0 ~ /[\\`\"\']/ ) { + valid = 0 + verr = "@TR<>" + } + else { + # XXX: weird hack, but it works... + n = split($0, param, "|") + value = param[5] + for (i = 6; i <= n; i++) value = value FS param[i] + verr = "" + } } $1 == "int" { @@ -36,20 +42,21 @@ if ((ipaddr[i] < 0) || (ipaddr[i] > 255)) valid = 0 if ((ipaddr[i] == 255) && ($2 != "FORM_netmask")) counter++ } - if (counter == 4) valid = 0 + if (counter == 4) valid = 0 } if (valid == 0) verr = "@TR<>" } } + $1 == "wep" { valid_type = 1 if (value !~ /^[0-9A-Fa-f]*$/) { valid = 0 - verr = "@TR<>" + verr = "@TR<>" } else if ((length(value) != 0) && (length(value) != 10) && (length(value) != 26)) { valid = 0 - verr = "Invalid key length" + verr = "@TR<>" } } @@ -69,7 +76,7 @@ } } $1 == "user" { - valid_type = 1 + valid_type = 1 if (value ~ /[\<\>\&|;]/) { valid = 0 verr = "@TR<>" @@ -97,6 +104,10 @@ valid = 0 verr = "@TR<>" } + if (value > 65535) { + valid = 0 + verr = "@TR<>" + } } $1 == "ports" { @@ -114,15 +125,15 @@ valid_type = 1 if (length(value) > 64) { valid = 0 - verr = "String too long" + verr = "@TR<>" } if ((length(value) != 0) && (length(value) < 8)) { valid = 0 - verr = "String too short" + verr = "@TR<>" } if ((length(value) == 64) && (value ~ /[^0-9a-fA-F]/)) { valid = 0 - verr = "Invalid hex key" + verr = "@TR<>" } } @@ -132,24 +143,24 @@ n = split($4, options, " ") for (i = 1; (valid == 1) && (i <= n); i++) { if (options[i] == "required") { - if (value == "") { valid = 0; verr = "No value entered" } + if (value == "") { valid = 0; verr = "@TR<>" } } else if ((options[i] ~ /^min=/) && (value != "")) { min = options[i] sub(/^min=/, "", min) min = int(min) if ($1 == "int") { - if (value < min) { valid = 0; verr = "Value too small (minimum: " min ")" } + if (value < min) { valid = 0; verr = "@TR<>" min ")" } } else if ($1 == "string") { - if (length(value) < min) { valid = 0; verr = "Value too small (minimum length: " min ")"} + if (length(value) < min) { valid = 0; verr = "@TR<>" min ")"} } } else if ((options[i] ~ /^max=/) && (value != "")) { max = options[i] sub(/^max=/, "", max) max = int(max) if ($1 == "int") { - if (value > max) { valid = 0; verr = "@TR<> (@TR<>: " max ")" } + if (value > max) { valid = 0; verr = "@TR<> (@TR<>: " max ")" } } else if ($1 == "string") { - if (length(value) > max) { valid = 0; verr = "@TR<> (@TR<>: " max ")" } + if (length(value) > max) { valid = 0; verr = "@TR<> (@TR<>: " max ")" } } } else if ((options[i] == "nodots") && ($1 == "hostname")) { if (value ~ /\./) { @@ -162,7 +173,7 @@ valid_type == 1 { if (valid == 1) output = output $2 "=\"" value "\";\n" - else error = error "Error in " $3 ": " verr "
" + else error = error "@TR<> " $3 ": " verr "
" } END { @@ -170,3 +181,5 @@ if (error == "") print "return 0" else print "return 255" } + + diff -r -u 0.7.0.4/usr/lib/webif/webif.sh 0.7.1.1/usr/lib/webif/webif.sh --- 0.7.0.4/usr/lib/webif/webif.sh 2006-09-01 00:32:13.000000000 +0900 +++ 0.7.1.1/usr/lib/webif/webif.sh 2006-11-15 02:44:26.000000000 +0900 @@ -42,7 +42,7 @@ header() { local title="$1" - + empty "$ERROR" && { _saved_title="${SAVED:+: @TR<>}" } || { @@ -72,98 +72,108 @@
- - - +
+ + + + + + +
- +
+ +

@@ -238,7 +248,7 @@ export cfgfile="${cfg##*config-}" export updatestr= . $cfg - + lock /tmp/.webif/update-$cfgfile awk \ -v cfgfile="/etc/config/$cfgfile" \ @@ -257,3 +267,5 @@ lock -u /tmp/.webif/update-$cfgfile done )} + + diff -r -u 0.7.0.4/www/cgi-bin/splash.sh 0.7.1.1/www/cgi-bin/splash.sh --- 0.7.0.4/www/cgi-bin/splash.sh 2006-09-01 00:32:13.000000000 +0900 +++ 0.7.1.1/www/cgi-bin/splash.sh 2006-11-15 02:44:25.000000000 +0900 @@ -1,11 +1,11 @@ #!/usr/bin/webif-page -@TR<>

-

@TR<Fonera was not able to configure itself to your home network settings. This can be due to many different reasons:>>


+

@TR<Fonera was not able to configure itself to your home network settings. This can be due to many different reasons:>>


@@ -42,3 +42,5 @@ EOF footer ?> + + diff -r -u 0.7.0.4/www/cgi-bin/status.sh 0.7.1.1/www/cgi-bin/status.sh --- 0.7.0.4/www/cgi-bin/status.sh 2006-09-01 00:32:13.000000000 +0900 +++ 0.7.1.1/www/cgi-bin/status.sh 2006-11-15 02:44:25.000000000 +0900 @@ -37,27 +37,28 @@ version="$(cat /etc/fon_version) r$(cat /etc/fon_revision)" cat < -

Configuration summary

-Firmware Version:$version + + + - - - - - + + + + + - - - - - + + + + +

@TR<>

@TR<>:$version


Internet connection

Connection type:$mode
IP Address:${wan_ip:-N/A}
Gateway address:${wan_gw:-N/A}
DNS Server:${wan_ns:-N/A}

@TR<>

@TR<>:$mode
@TR<>:${wan_ip:-N/A}
@TR<>:${wan_gw:-N/A}
@TR<>:${wan_ns:-N/A}

WiFi Settings

Public SSID:FON_$pubssid
Private SSID:$privssid
Encryption:${encryption:-none}
IP Address:${priv_ip:-N/A}

@TR<>

@TR<>:FON_$pubssid
@TR<>:$privssid
@TR<>:${encryption:-none}
@TR<>:${priv_ip:-N/A}


EOF + footer ?> diff -r -u 0.7.0.4/www/cgi-bin/webif/adv_net.sh 0.7.1.1/www/cgi-bin/webif/adv_net.sh --- 0.7.0.4/www/cgi-bin/webif/adv_net.sh 2006-09-12 22:16:13.000000000 +0900 +++ 0.7.1.1/www/cgi-bin/webif/adv_net.sh 2006-11-23 20:54:21.000000000 +0900 @@ -1,7 +1,17 @@ #!/usr/bin/webif-page ->||$FORM_submit +EOF + +if [ "$?" != "0" ] +then + FORM_submit="" +fi + + config_load fon if empty "$FORM_submit"; then get_default ipaddr lan ipaddr @@ -11,10 +21,16 @@ get_default hs_lan access hotspot_lan get_default hs_wan access hotspot_wan else - validate <>|required|$FORM_ipaddr ip|FORM_netmask|@TR<>|required|$FORM_netmask +int|FORM_dhcp|@TR<>|required|$FORM_dhcp +int|FORM_lan_wan|@TR<WAN>>|required|$FORM_lan_wan +int|FORM_hs_lan|@TR<Private>>|required|$FORM_hs_lan +int|FORM_hs_wan|@TR<WAN>>|required|$FORM_hs_wan EOF + equal "$?" 0 && { save_setting fon lan ipaddr "$FORM_ipaddr" save_setting fon lan netmask "$FORM_netmask" @@ -24,44 +40,68 @@ save_setting fon access hotspot_wan "$FORM_hs_wan" commit_settings lock -u /var/run/restart-services + lock -u /var/run/network-connection SAVED=1 } fi - + sel_net=1 . /usr/lib/webif/advanced.sh header "Advanced Network Settings" display_form <Private -select|hs_lan|$FORM_hs_lan -option|1|Allow -option|0|Deny - -field|Public->WAN -select|hs_wan|$FORM_hs_wan -option|1|Allow -option|0|Deny - -field|Private->WAN -select|lan_wan|$FORM_lan_wan -option|1|Allow -option|0|Deny - -submit|submit|Submit + infotable|Private Wireless IP Settings + start_table|0|10|5 + add_row + add_label_cell|@TR<> + add_input_cell|ipaddr|$FORM_ipaddr|tableTextButton + end_row + add_row + add_label_cell|@TR<> + add_input_cell|netmask|$FORM_netmask|tableTextButton + end_row + add_row + add_label_cell|@TR<> + start_select_cell|dhcp|$FORM_dhcp|tableTextSelect + option|1|@TR<> + option|0|@TR<> + end_select_cell + end_row + end_table + + infotable|Firewall settings + infotable|FirewallInfo#Here you can configure the access policies between your different networks. + start_table|0|10|5 + add_row + add_label_cell|@TR<Private>> + start_select_cell|hs_lan|$FORM_hs_lan|tableTextSelect + option|1|@TR<> + option|0|@TR<> + end_select_cell + end_row + add_row + add_label_cell|@TR<WAN>> + start_select_cell|hs_wan|$FORM_hs_wan|tableTextSelect + option|1|@TR<> + option|0|@TR<> + end_select_cell + end_row + add_row + add_label_cell|@TR<WAN>> + start_select_cell|lan_wan|$FORM_lan_wan|tableTextSelect + option|1|@TR<> + option|0|@TR<> + end_select_cell + end_row + end_table + start_table|0|10|5 + add_row + add_button_cell|submit|@TR<>|tableTextButton + end_row + end_table EOF footer ?> + + diff -r -u 0.7.0.4/www/cgi-bin/webif/adv_wifi.sh 0.7.1.1/www/cgi-bin/webif/adv_wifi.sh --- 0.7.0.4/www/cgi-bin/webif/adv_wifi.sh 2006-09-01 00:32:13.000000000 +0900 +++ 0.7.1.1/www/cgi-bin/webif/adv_wifi.sh 2006-11-23 20:54:21.000000000 +0900 @@ -1,31 +1,52 @@ #!/usr/bin/webif-page ->||$FORM_submit +EOF + +if [ "$?" != "0" ] +then + FORM_submit="" +fi + sel_wifi=1 . /usr/lib/webif/advanced.sh config_load fon if empty "$FORM_submit"; then - get_default wifimode advanced bgmode + get_default bgmode advanced bgmode get_default channel advanced channel else - save_setting fon advanced bgmode "$FORM_wifimode" +validate <>|required|$FORM_bgmode +user|FORM_bgmode|@TR<>|required|$FORM_bgmode +string|FORM_channel|@TR<>|required|$FORM_channel +EOF + equal "$?" 0 && { + if [ "$FORM_bgmode" == "b" ] + then + save_setting fon advanced bgmode "mixed" + else + save_setting fon advanced bgmode "$FORM_bgmode" + fi save_setting fon advanced channel "$FORM_channel" commit_settings - ( + ( ifconfig ath0 down ifconfig ath1 down ifup lan ifconfig ath0 up ) >/dev/null 2>/dev/null & SAVED=1 + } fi header "Advanced Wireless Settings" channels= -for ch in $(iwlist ath1 freq | grep 'Channel ' | awk '{print $2}'); do +for ch in $(iwlist ath1 freq | grep 'Channel ' | grep -v "reque" | awk '{print $2}'); do channels="${channels:+$channels$N}option|$ch|$ch" done @@ -44,19 +65,30 @@ option|11|11}" display_form <> + start_select_cell|channel|$FORM_channel|tableTextSelect + option|auto|@TR<> + $channels + end_select_cell + end_row + add_row + add_label_cell|@TR<> + start_select_cell|bgmode|$FORM_bgmode|tableTextSelect + option|mixed|@TR<> + option|g|@TR<> + option|b|@TR<> + end_select_cell + end_row + add_row + add_button_cell|submit|@TR<>|tableTextButton + end_row + end_table EOF footer ?> + + diff -r -u 0.7.0.4/www/cgi-bin/webif/connection.sh 0.7.1.1/www/cgi-bin/webif/connection.sh --- 0.7.0.4/www/cgi-bin/webif/connection.sh 2006-09-12 22:16:13.000000000 +0900 +++ 0.7.1.1/www/cgi-bin/webif/connection.sh 2006-11-23 20:54:21.000000000 +0900 @@ -1,7 +1,16 @@ #!/usr/bin/webif-page >||$FORM_submit +EOF + +if [ "$?" != "0" ] +then + FORM_submit="" +fi + load_settings fon if empty "$FORM_submit"; then get_default mode wan mode @@ -13,6 +22,12 @@ get_default password wan password get_default pptp_server wan server else + FORM_mode=$(echo -e "$FORM_mode" |sed s/\`//g|sed s/\"//g |sed s/\'//g) + FORM_ip=$(echo -e "$FORM_ip" |sed s/\`//g|sed s/\"//g |sed s/\'//g) + FORM_netmask=$(echo -e "$FORM_netmask" |sed s/\`//g|sed s/\"//g |sed s/\'//g) + FORM_gateway=$(echo -e "$FORM_gateway" |sed s/\`//g|sed s/\"//g |sed s/\'//g) + FORM_dns=$(echo -e "$FORM_dns" |sed s/\`//g|sed s/\"//g |sed s/\'//g) + FORM_pptp_server=$(echo -e "$FORM_pptp_server" |sed s/\`//g|sed s/\"//g |sed s/\'//g) case "$FORM_mode" in static) V_S="required" @@ -25,9 +40,9 @@ V_PPTP="required" ;; esac - FORM_username=$(echo -e "$FORM_username" |sed s/\`//g|sed s/\"//g) - FORM_password=$(echo -e "$FORM_password" |sed s/\`//g|sed s/\"//g) + validate <>||$FORM_mode ip|FORM_ip|@TR<>|$V_S|$FORM_ip ip|FORM_netmask|@TR<>|$V_S|$FORM_netmask ip|FORM_dns|@TR<>|$V_S|$FORM_dns @@ -61,6 +76,7 @@ esac commit_settings lock -u /var/run/restart-services + lock -u /var/run/network-connection SAVED=1 } fi @@ -81,46 +97,78 @@ } --> - -

Here you can configure the way your Fonera connects to the Internet. Currently there are 4 protocols available: DHCP, static IP configuration, PPPoE and PPTP. For most people DHCP should work; though, if it doesn't for you, check with your Internet provider (ISP) what protocol you must use or look at the installation reference manual or the troubleshooting manual from FON.

EOF display_form <> + start_select_cell|mode|$FORM_mode|tableTextSelect + option|dhcp|DHCP + option|static|@TR<> + option|pppoe|PPPoE + option|pptp|PPTP + end_select_cell + end_row + end_table + + start_div|static + start_table|0|10|5 + add_row + infotable|Static IP settings + end_row + add_row + add_label_cell|@TR<> + add_input_cell|ip|$FORM_ip|tableTextButton + end_row + add_row + add_label_cell|@TR<> + add_input_cell|netmask|$FORM_netmask|tableTextButton + end_row + add_row + add_label_cell|@TR<> + add_input_cell|gateway|$FORM_gateway|tableTextButton + end_row + add_row + add_label_cell|@TR<> + add_input_cell|dns|$FORM_dns|tableTextButton + end_row + end_table + end_div + + start_div|ppp + start_table|0|10|5 + add_row + infotable|PPPoE and PPTP settings + end_row + add_row + add_label_cell|@TR<> + add_input_cell|username|$FORM_username|tableTextButton + end_row + add_row + add_label_cell|@TR<> + add_input_cell|password|$FORM_password|tableTextButton + end_row + end_table + end_div ppp + + start_div|pptp + start_table|0|10|5 + add_row + infotable|PPTP Settings + end_row + add_row + add_label_cell|@TR<> + add_input_cell|pptp_server|$FORM_pptp_server|tableTextButton + end_row + end_table + end_div pptp + + start_table|0|10|5 + add_button_cell|submit|@TR<> + end_table EOF cat < + + diff -r -u 0.7.0.4/www/cgi-bin/webif/password.sh 0.7.1.1/www/cgi-bin/webif/password.sh --- 0.7.0.4/www/cgi-bin/webif/password.sh 2006-09-01 00:32:13.000000000 +0900 +++ 0.7.1.1/www/cgi-bin/webif/password.sh 2006-11-23 20:54:21.000000000 +0900 @@ -1,14 +1,25 @@ #!/usr/bin/webif-page ->||$FORM_submit +EOF + +if [ "$?" != "0" ] +then + FORM_submit="" +fi + empty "$FORM_submit" || { - validate <&1 - SAVED=1 ) - equal "$?" 0 || ERROR="
$RES
" + if [ "$?" = 0 ]; + then + SAVED=1 + else + ERROR="
$RES
" + fi } } } @@ -27,12 +42,22 @@ header "Password Change" display_form <> + add_pass_cell|pw1|tableTextButton + end_row + add_row + add_label_cell|@TR<> + add_pass_cell|pw2|tableTextButton + end_row + add_row + add_button_cell|submit|@TR<> + end_row + end_table EOF footer ?> + + diff -r -u 0.7.0.4/www/cgi-bin/webif/private.sh 0.7.1.1/www/cgi-bin/webif/private.sh --- 0.7.0.4/www/cgi-bin/webif/private.sh 2006-09-13 00:39:32.000000000 +0900 +++ 0.7.1.1/www/cgi-bin/webif/private.sh 2006-11-23 20:54:21.000000000 +0900 @@ -1,7 +1,16 @@ #!/usr/bin/webif-page >||$FORM_submit +EOF + +if [ "$?" != "0" ] +then + FORM_submit="" +fi + load_settings fon if empty "$FORM_submit"; then get_default ssid private essid @@ -33,7 +42,7 @@ eval "V_K$FORM_wepkey=required" ;; esac - FORM_ssid=$(echo -e "$FORM_ssid" |sed s/\`//g|sed s/\"//g) + validate <>|required max=28|$FORM_ssid user|FORM_ssid|@TR<>||$FORM_ssid @@ -48,6 +57,7 @@ user|FORM_key3|@TR<> 3||$FORM_key3 wep|FORM_key4|@TR<> 4|$V_K4|$FORM_key4 user|FORM_key4|@TR<> 4||$FORM_key4 +int|FORM_wepkey|@TR<>|required|$FORM_wepkey EOF equal "$?" 0 && { save_setting fon private essid "$FORM_ssid" @@ -90,52 +100,79 @@ EOF display_form <> + add_input_cell|ssid|$FORM_ssid|tableTextButton + end_row + add_row + add_label_cell|@TR<> + start_select_cell|auth|$FORM_auth|tableTextSelect + option|open|@TR<> + option|wep|WEP + option|wpa|WPA + option|wpa2|WPA2 + option|mixed|@TR<> + end_select_cell + end_row + end_table + + start_div|wpa_stuff + start_table|0|10|5 + add_row + add_label_cell|@TR<> + start_select_cell|crypto|$FORM_crypto|tableTextSelect + option|tkip+aes|@TR<> + option|tkip|TKIP + option|aes|AES + end_select_cell + end_row + add_row + add_label_cell|@TR<> + add_input_cell|psk|$FORM_psk|tableTextButton + end_row + end_table + end_div + + start_div|wep_stuff + start_table|0|10|5 + add_row + add_label_cell|@TR<> + start_select_cell|wepkey|$FORM_wepkey|tableTextSelect + option|1|1 + option|2|2 + option|3|3 + option|4|4 + end_select_cell + end_row + add_row + add_label_cell|@TR<> + add_input_cell|key1|$FORM_key1|tableTextButton + end_row + add_row + add_label_cell|@TR<> + add_input_cell|key2|$FORM_key2|tableTextButton + end_row + add_row + add_label_cell|@TR<> + add_input_cell|key3|$FORM_key3|tableTextButton + end_row + add_row + add_label_cell|@TR<> + add_input_cell|key4|$FORM_key4|tableTextButton + end_row + end_table + end_div + start_table|0|10|5 + add_row + add_button_cell|submit|@TR<> + end_row + end_table EOF - + cat <