Project

General

Profile

« Previous | Next » 

Revision b061a3c6

Added by Matthew Smith over 9 years ago

Remove config stuff for WEP. on upgrade, disable WEP on interfaces that have it configured and disable those interfaces and generate a notice. Fixes #5123.

View differences:

src/etc/inc/globals.inc
74 74
	"disablecrashreporter" => false,
75 75
	"crashreporterurl" => "https://crashreporter.pfsense.org/crash_reporter.php",
76 76
	"debug" => false,
77
	"latest_config" => "12.3",
77
	"latest_config" => "12.4",
78 78
	"nopkg_platforms" => array("cdrom"),
79 79
	"minimum_ram_warning" => "101",
80 80
	"minimum_ram_warning_text" => "128 MB",
src/etc/inc/interfaces.inc
2639 2639
		$wlcmd[] = "-wme";
2640 2640
	}
2641 2641

  
2642
	/* set up wep if enabled */
2643
	$wepset = "";
2644
	if (isset($wlcfg['wep']['enable']) && is_array($wlcfg['wep']['key'])) {
2645
		switch ($wlcfg['wpa']['auth_algs']) {
2646
			case "1":
2647
				$wepset .= "authmode open wepmode on ";
2648
				break;
2649
			case "2":
2650
				$wepset .= "authmode shared wepmode on ";
2651
				break;
2652
			case "3":
2653
				$wepset .= "authmode mixed wepmode on ";
2654
		}
2655
		$i = 1;
2656
		foreach ($wlcfg['wep']['key'] as $wepkey) {
2657
			$wepset .= "wepkey " . escapeshellarg("{$i}:{$wepkey['value']}") . " ";
2658
			if (isset($wepkey['txkey'])) {
2659
				$wlcmd[] = "weptxkey {$i} ";
2660
			}
2661
			$i++;
2662
		}
2663
		$wlcmd[] = $wepset;
2664
	} else if (isset($wlcfg['wpa']['enable'])) {
2642
	/* Enable wpa if it's configured. No WEP support anymore. */
2643
	if (isset($wlcfg['wpa']['enable'])) {
2665 2644
		$wlcmd[] = "authmode wpa wepmode off ";
2666 2645
	} else {
2667 2646
		$wlcmd[] = "authmode open wepmode off ";
src/etc/inc/upgrade_config.inc
3981 3981
	}
3982 3982
}
3983 3983

  
3984
function upgrade_123_to_124() {
3985
	require_once("notices.inc");
3986
	global $config;
3987

  
3988
	/* Find interfaces with WEP configured. */
3989
	foreach ($config['interfaces'] as $ifname => $intf) {
3990
		if (!is_array($intf['wireless'])) {
3991
			continue;
3992
		}
3993

  
3994
		/* Generate a notice, disable interface, remove WEP settings */
3995
		if (isset($intf['wireless']['wep']['enable'])) {
3996
			file_notice("WirelessSettings", "WEP is no longer supported. It will be disabled on the {$ifname} interface and the interface will be disabled. Please reconfigure the interface.");
3997
			unset($config['interfaces'][$ifname]['wireless']['wep']); 
3998
			if (isset($intf['enable'])) {
3999
				unset($config['interfaces'][$ifname]['enable']);
4000
			}
4001
		}
4002
	}
4003
}
4004
	
4005

  
3984 4006
?>

Also available in: Unified diff