Merge branch 'mlppp'

Conflicts:
	usr/local/www/interfaces_ppp_edit.php
This commit is contained in:
gnhb 2010-06-10 00:29:47 +07:00
commit 3a7658652c
58 changed files with 10673 additions and 1797 deletions

View File

@ -140,8 +140,9 @@ function filter_configure() {
touch($g['tmp_path'] . "/filter_dirty");
}
function delete_states_for_down_gateways() {
function filter_delete_states_for_down_gateways() {
global $config;
$a_gateways = return_gateways_status();
foreach ($a_gateways as $gateway) {
if ($gateway['status'] == "down") {
@ -369,7 +370,7 @@ function filter_configure_sync() {
echo ".";
update_filter_reload_status("Processing down interface states");
delete_states_for_down_gateways();
filter_delete_states_for_down_gateways();
update_filter_reload_status("Running plugins");
@ -2084,7 +2085,7 @@ EOD;
/* if antilockout is enabled, LAN exists and has
* an IP and subnet mask assigned
*/
$lanif = $FilterIflist["lan"]['if'];
$lanif = $FilterIflist['lan']['if'];
$ipfrules .= <<<EOD
# make sure the user cannot lock himself out of the webConfigurator or SSH
anchor "anti-lockout"

View File

@ -88,7 +88,7 @@ $g = array(
"disablehelpmenu" => false,
"disablehelpicon" => false,
"debug" => false,
"latest_config" => "6.3",
"latest_config" => "6.4",
"nopkg_platforms" => array("cdrom"),
"minimum_ram_warning" => "105",
"minimum_ram_warning_text" => "128 MB",

View File

@ -243,9 +243,7 @@ EOD;
/* return the status of the apinger targets as a array */
function return_gateways_status() {
global $config;
global $g;
$gateways_arr = return_gateways_array();
global $config, $g;
$apingerstatus = array();
if (file_exists("{$g['tmp_path']}/apinger.status")) {
@ -253,28 +251,13 @@ function return_gateways_status() {
}
$status = array();
$i = 2;
/* assign a dummy IP address for dynamic interfaces in case we need it */
$monitor = array();
foreach($gateways_arr as $name => $gateway) {
if($gateway['monitor'] == "dynamic") {
$gateway['monitor'] = "127.0.0.{$i}";
$i++;
}
$status[$gateway['monitor']]['monitor'] = $gateway['monitor'];
$status[$gateway['monitor']]['interface'] = $gateway['interface'];
$status[$gateway['monitor']]['gateway'] = $gateway['gateway'];
$status[$gateway['monitor']]['name'] = $gateway['name'];
$status[$gateway['monitor']]['status'] = "down";
}
foreach($apingerstatus as $line) {
$info = explode("|", $line);
$target = $info[0];
$status[$target]['name'] = $info[1];
$status[$target]['lastcheck'] = $info[4] ? date('r', $info[4]) : date('r');
$status[$target]['delay'] = $info[5];
$status[$target]['loss'] = $info[6];
$status[$target]['delay'] = empty($info[5]) ? 0 : $info[5];
$status[$target]['loss'] = empty($info[6]) ? "0.0%" : $info[6] . "%";
$status[$target]['status'] = trim($info[7]);
}
return($status);
@ -475,19 +458,15 @@ function dhclient_update_gateway_groups_defaultroute($interface = "wan") {
}
function lookup_gateway_ip_by_name($name) {
global $config;
if(is_array($config['gateways']['gateway_item'])) {
foreach($config['gateways']['gateway_item'] as $gateway) {
if($gateway['name'] == $name)
return ($gateway['gateway']);
}
} else
return (false);
$gateways_arr = return_gateways_array();
if (!empty($gateways_arr[$name]))
return $gateways_arr[$name]['gateway'];
return false;
}
function lookup_gateway_monitor_ip_by_name($name) {
global $config;
$gateways_arr = return_gateways_array();
if (!empty($gateways_arr[$name])) {
@ -506,7 +485,6 @@ function lookup_gateway_monitor_ip_by_name($name) {
}
function lookup_gateway_interface_by_name($name) {
global $config;
$gateways_arr = return_gateways_array();
if (!empty($gateways_arr[$name])) {
@ -526,8 +504,14 @@ function get_interface_gateway($interface, &$dynamic = false) {
$gwcfg = $config['interfaces'][$interface];
if (is_ipaddr($gwcfg['gateway']))
$gw = $gwcfg['gateway'];
else if (!empty($gwcfg['gateway']))
$gw = lookup_gateway_ip_by_name($gwcfg['gateway']);
else if (!empty($gwcfg['gateway']) && is_array($config['gateways']['gateway_item'])) {
foreach($config['gateways']['gateway_item'] as $gateway) {
if ($gateway['name'] == $gwcfg['gateway']) {
$gw = $gateway['gateway'];
break;
}
}
}
// for dynamic interfaces we handle them through the $interface_router file.
if (!is_ipaddr($gw) && !is_ipaddr($gwcfg['ipaddr'])) {

File diff suppressed because it is too large Load Diff

View File

@ -1147,7 +1147,6 @@ function convert_seconds_to_hms($sec){
}
/* Compute the total uptime from the ppp uptime log file in the conf directory */
/* Written by: gnoahb@gmail.com */
function get_ppp_uptime($port){
if (file_exists("/conf/{$port}.log")){
@ -1171,7 +1170,7 @@ function get_interface_info($ifdescr) {
$ifinfo = array();
if (empty($config['interfaces'][$ifdescr]))
return;
$ifinfo['hwif'] = $config['interfaces'][$if]['if'];
$ifinfo['hwif'] = $config['interfaces'][$ifdescr]['if'];
$ifinfo['if'] = get_real_interface($ifdescr);
$chkif = $ifinfo['if'];
@ -1255,16 +1254,25 @@ function get_interface_info($ifdescr) {
/* PPP interface? -> get uptime for this session and cumulative uptime from the persistant log file in conf */
case "ppp":
if ($ifinfo['status'] == "up")
$ifinfo['ppplink'] = "up";
$ifinfo['ppplink'] = "up";
else
$ifinfo['ppplink'] = "down" ;
$dev = $config['interfaces'][$if]['if'];
if (empty($dev))
if (empty($ifinfo['status']))
$ifinfo['status'] = "down";
if (is_array($config['ppps']['ppp']) && count($config['ppps']['ppp'])) {
foreach ($config['ppps']['ppp'] as $pppid => $ppp) {
if ($config['interfaces'][$ifdescr]['if'] == $ppp['if'])
break;
}
}
$dev = $ppp['ports'];
if ($config['interfaces'][$ifdescr]['if'] != $ppp['if'] || empty($dev))
break;
if (file_exists("/dev/{$dev}")) {
if (file_exists("{$g['varrun_path']}/ppp_{$if}.pid")) {
$ifinfo['pppinfo'] = "{$ifinfo['if']}";
if (file_exists($dev)) {
if (file_exists("{$g['varrun_path']}/ppp_{$ifdescr}.pid")) {
$ifinfo['pppinfo'] = $ifinfo['ifdescr'];
$sec = trim(`/usr/local/sbin/ppp-uptime.sh {$ifinfo['if']}`);
$ifinfo['ppp_uptime'] = convert_seconds_to_hms($sec);
}
@ -1332,8 +1340,8 @@ function get_interface_info($ifdescr) {
}
/* lookup the gateway */
if (interface_has_gateway($if))
$ifinfo['gateway'] = get_interface_gateway($if);
if (interface_has_gateway($ifdescr))
$ifinfo['gateway'] = get_interface_gateway($ifdescr);
}
$bridge = "";
@ -2003,4 +2011,164 @@ function get_include_contents($filename) {
return false;
}
/* This xml 2 array function is courtesy of the php.net comment section on xml_parse.
* it is roughly 4 times faster then our existing pfSense parser but due to the large
* size of the RRD xml dumps this is required.
* The reason we do not use it for pfSense is that it does not know about array fields
* which causes it to fail on array fields with single items. Possible Todo?
*/
function xml2array($contents, $get_attributes = 1, $priority = 'tag')
{
if (!function_exists('xml_parser_create'))
{
return array ();
}
$parser = xml_parser_create('');
xml_parser_set_option($parser, XML_OPTION_TARGET_ENCODING, "UTF-8");
xml_parser_set_option($parser, XML_OPTION_CASE_FOLDING, 0);
xml_parser_set_option($parser, XML_OPTION_SKIP_WHITE, 1);
xml_parse_into_struct($parser, trim($contents), $xml_values);
xml_parser_free($parser);
if (!$xml_values)
return; //Hmm...
$xml_array = array ();
$parents = array ();
$opened_tags = array ();
$arr = array ();
$current = & $xml_array;
$repeated_tag_index = array ();
foreach ($xml_values as $data)
{
unset ($attributes, $value);
extract($data);
$result = array ();
$attributes_data = array ();
if (isset ($value))
{
if ($priority == 'tag')
$result = $value;
else
$result['value'] = $value;
}
if (isset ($attributes) and $get_attributes)
{
foreach ($attributes as $attr => $val)
{
if ($priority == 'tag')
$attributes_data[$attr] = $val;
else
$result['attr'][$attr] = $val; //Set all the attributes in a array called 'attr'
}
}
if ($type == "open")
{
$parent[$level -1] = & $current;
if (!is_array($current) or (!in_array($tag, array_keys($current))))
{
$current[$tag] = $result;
if ($attributes_data)
$current[$tag . '_attr'] = $attributes_data;
$repeated_tag_index[$tag . '_' . $level] = 1;
$current = & $current[$tag];
}
else
{
if (isset ($current[$tag][0]))
{
$current[$tag][$repeated_tag_index[$tag . '_' . $level]] = $result;
$repeated_tag_index[$tag . '_' . $level]++;
}
else
{
$current[$tag] = array (
$current[$tag],
$result
);
$repeated_tag_index[$tag . '_' . $level] = 2;
if (isset ($current[$tag . '_attr']))
{
$current[$tag]['0_attr'] = $current[$tag . '_attr'];
unset ($current[$tag . '_attr']);
}
}
$last_item_index = $repeated_tag_index[$tag . '_' . $level] - 1;
$current = & $current[$tag][$last_item_index];
}
}
elseif ($type == "complete")
{
if (!isset ($current[$tag]))
{
$current[$tag] = $result;
$repeated_tag_index[$tag . '_' . $level] = 1;
if ($priority == 'tag' and $attributes_data)
$current[$tag . '_attr'] = $attributes_data;
}
else
{
if (isset ($current[$tag][0]) and is_array($current[$tag]))
{
$current[$tag][$repeated_tag_index[$tag . '_' . $level]] = $result;
if ($priority == 'tag' and $get_attributes and $attributes_data)
{
$current[$tag][$repeated_tag_index[$tag . '_' . $level] . '_attr'] = $attributes_data;
}
$repeated_tag_index[$tag . '_' . $level]++;
}
else
{
$current[$tag] = array (
$current[$tag],
$result
);
$repeated_tag_index[$tag . '_' . $level] = 1;
if ($priority == 'tag' and $get_attributes)
{
if (isset ($current[$tag . '_attr']))
{
$current[$tag]['0_attr'] = $current[$tag . '_attr'];
unset ($current[$tag . '_attr']);
}
if ($attributes_data)
{
$current[$tag][$repeated_tag_index[$tag . '_' . $level] . '_attr'] = $attributes_data;
}
}
$repeated_tag_index[$tag . '_' . $level]++; //0 and 1 index is already taken
}
}
}
elseif ($type == 'close')
{
$current = & $parent[$level -1];
}
}
return ($xml_array);
}
function get_country_name($country_code) {
if ($country_code != "ALL" && strlen($country_code) != 2)
return "";
$country_names_xml = "/usr/local/share/mobile-broadband-provider-info/iso_3166-1_list_en.xml";
$country_names_contents = file_get_contents($country_names_xml);
$country_names = xml2array($country_names_contents);
if($country_code == "ALL") {
$country_list = array();
foreach($country_names['ISO_3166-1_List_en']['ISO_3166-1_Entry'] as $country) {
$country_list[] = array( "code" => $country['ISO_3166-1_Alpha-2_Code_element'],
"name" => ucwords(strtolower($country['ISO_3166-1_Country_name'])) );
}
return $country_list;
}
foreach ($country_names['ISO_3166-1_List_en']['ISO_3166-1_Entry'] as $country) {
if ($country['ISO_3166-1_Alpha-2_Code_element'] == strtoupper($country_code)) {
return ucwords(strtolower($country['ISO_3166-1_Country_name']));
}
}
return "";
}
?>

View File

@ -882,24 +882,6 @@ function delete_package_xml($pkg) {
eval_once($pkg_config['custom_php_global_functions']);
if($pkg_config['custom_php_pre_deinstall_command'] <> "")
eval_once($pkg_config['custom_php_pre_deinstall_command']);
/* remove all additional files */
if(is_array($pkg_config['additional_files_needed'])) {
$static_output .= "\tAuxiliary files... ";
update_output_window($static_output);
foreach($pkg_config['additional_files_needed'] as $afn) {
$filename = get_filename_from_url($afn['item'][0]);
if($afn['prefix'] <> "") {
$prefix = $afn['prefix'];
} else {
$prefix = "/usr/local/pkg/";
}
unlink_if_exists($prefix . $filename);
if(file_exists($prefix . $filename))
mwexec("rm -rf {$prefix}{$filename}");
}
$static_output .= "done.\n";
update_output_window($static_output);
}
/* system files */
if(is_array($pkg_config['modify_system']['item'])) {
$static_output .= "\tSystem files... ";
@ -935,6 +917,24 @@ function delete_package_xml($pkg) {
update_output_window($static_output);
}
/* remove all additional files */
if(is_array($pkg_config['additional_files_needed'])) {
$static_output .= "\tAuxiliary files... ";
update_output_window($static_output);
foreach($pkg_config['additional_files_needed'] as $afn) {
$filename = get_filename_from_url($afn['item'][0]);
if($afn['prefix'] <> "") {
$prefix = $afn['prefix'];
} else {
$prefix = "/usr/local/pkg/";
}
unlink_if_exists($prefix . $filename);
if(file_exists($prefix . $filename))
mwexec("rm -rf {$prefix}{$filename}");
}
$static_output .= "done.\n";
update_output_window($static_output);
}
/* package XML file */
$static_output .= "\tPackage XML... ";
update_output_window($static_output);

View File

@ -318,6 +318,12 @@ $priv_list['page-getstats']['descr'] = "Allow access to the 'AJAX: Get Stats' pa
$priv_list['page-getstats']['match'] = array();
$priv_list['page-getstats']['match'][] = "getstats.php*";
$priv_list['page-status-systemlogs-ppp'] = array();
$priv_list['page-status-systemlogs-ppp']['name'] = "WebCfg - Status: System logs: IPsec VPN page";
$priv_list['page-status-systemlogs-ppp']['descr'] = "Allow access to the 'Status: System logs: IPsec VPN' page.";
$priv_list['page-status-systemlogs-ppp']['match'] = array();
$priv_list['page-status-systemlogs-ppp']['match'][] = "diag_logs_ppp.php*";
$priv_list['page-diagnostics-nanobsd'] = array();
$priv_list['page-diagnostics-nanobsd']['name'] = "WebCfg - Diagnostics: NanoBSD";
$priv_list['page-diagnostics-nanobsd']['descr'] = "Allow access to the 'Diagnostics: NanoBSD' page.";

View File

@ -634,142 +634,7 @@ function enable_rrd_graphing() {
}
function kill_traffic_collector() {
mwexec("/bin/pkill -f updaterrd.sh");
}
/* This xml 2 array function is courtesy of the php.net comment section on xml_parse.
* it is roughly 4 times faster then our existing pfSense parser but due to the large
* size of the RRD xml dumps this is required.
* The reason we do not use it for pfSense is that it does not know about array fields
* which causes it to fail on array fields with single items. Possible Todo?
*/
function xml2array($contents, $get_attributes = 1, $priority = 'tag')
{
if (!function_exists('xml_parser_create'))
{
return array ();
}
$parser = xml_parser_create('');
xml_parser_set_option($parser, XML_OPTION_TARGET_ENCODING, "UTF-8");
xml_parser_set_option($parser, XML_OPTION_CASE_FOLDING, 0);
xml_parser_set_option($parser, XML_OPTION_SKIP_WHITE, 1);
xml_parse_into_struct($parser, trim($contents), $xml_values);
xml_parser_free($parser);
if (!$xml_values)
return; //Hmm...
$xml_array = array ();
$parents = array ();
$opened_tags = array ();
$arr = array ();
$current = & $xml_array;
$repeated_tag_index = array ();
foreach ($xml_values as $data)
{
unset ($attributes, $value);
extract($data);
$result = array ();
$attributes_data = array ();
if (isset ($value))
{
if ($priority == 'tag')
$result = $value;
else
$result['value'] = $value;
}
if (isset ($attributes) and $get_attributes)
{
foreach ($attributes as $attr => $val)
{
if ($priority == 'tag')
$attributes_data[$attr] = $val;
else
$result['attr'][$attr] = $val; //Set all the attributes in a array called 'attr'
}
}
if ($type == "open")
{
$parent[$level -1] = & $current;
if (!is_array($current) or (!in_array($tag, array_keys($current))))
{
$current[$tag] = $result;
if ($attributes_data)
$current[$tag . '_attr'] = $attributes_data;
$repeated_tag_index[$tag . '_' . $level] = 1;
$current = & $current[$tag];
}
else
{
if (isset ($current[$tag][0]))
{
$current[$tag][$repeated_tag_index[$tag . '_' . $level]] = $result;
$repeated_tag_index[$tag . '_' . $level]++;
}
else
{
$current[$tag] = array (
$current[$tag],
$result
);
$repeated_tag_index[$tag . '_' . $level] = 2;
if (isset ($current[$tag . '_attr']))
{
$current[$tag]['0_attr'] = $current[$tag . '_attr'];
unset ($current[$tag . '_attr']);
}
}
$last_item_index = $repeated_tag_index[$tag . '_' . $level] - 1;
$current = & $current[$tag][$last_item_index];
}
}
elseif ($type == "complete")
{
if (!isset ($current[$tag]))
{
$current[$tag] = $result;
$repeated_tag_index[$tag . '_' . $level] = 1;
if ($priority == 'tag' and $attributes_data)
$current[$tag . '_attr'] = $attributes_data;
}
else
{
if (isset ($current[$tag][0]) and is_array($current[$tag]))
{
$current[$tag][$repeated_tag_index[$tag . '_' . $level]] = $result;
if ($priority == 'tag' and $get_attributes and $attributes_data)
{
$current[$tag][$repeated_tag_index[$tag . '_' . $level] . '_attr'] = $attributes_data;
}
$repeated_tag_index[$tag . '_' . $level]++;
}
else
{
$current[$tag] = array (
$current[$tag],
$result
);
$repeated_tag_index[$tag . '_' . $level] = 1;
if ($priority == 'tag' and $get_attributes)
{
if (isset ($current[$tag . '_attr']))
{
$current[$tag]['0_attr'] = $current[$tag . '_attr'];
unset ($current[$tag . '_attr']);
}
if ($attributes_data)
{
$current[$tag][$repeated_tag_index[$tag . '_' . $level] . '_attr'] = $attributes_data;
}
}
$repeated_tag_index[$tag . '_' . $level]++; //0 and 1 index is already taken
}
}
}
elseif ($type == 'close')
{
$current = & $parent[$level -1];
}
}
return ($xml_array);
mwexec("/bin/pkill -f updaterrd.sh", true);
}
?>

View File

@ -38,26 +38,6 @@
pfSense_MODULE: utils
*/
function services_parse_dhcpd_hostnames() {
global $g, $config;
// Launch if option enabled
if (isset($config['dnsmasq']['regdhcp'])) {
/* Make sure we do not error out */
@touch("{$g['dhcpd_chroot_path']}/var/db/dhcpd.leases");
if (!file_exists("{$g['varetc_path']}/hosts"))
system_hosts_generate();
if (file_exists("{$g['varrun_path']}/dhcpleases.pid"))
sigkillbypid("{$g['varrun_path']}/dhcpleases.pid", "HUP");
else
mwexec("/usr/local/sbin/dhcpleases -l {$g['dhcpd_chroot_path']}/var/db/dhcpd.leases -d {$config['system']['domain']} -p {$g['varrun_path']}/dnsmasq.pid -h {$g['varetc_path']}/hosts");
} else {
sigkillbypid("{$g['varrun_path']}/dhcpleases.pid", "TERM");
@unlink("{$g['varrun_path']}/dhcpleases.pid");
}
}
function services_dhcpd_configure() {
global $config, $g;
@ -648,9 +628,6 @@ function services_dnsmasq_configure() {
$return = 1;
}
// restart isc-dhcpd parser
services_parse_dhcpd_hostnames();
return $return;
}

View File

@ -225,6 +225,19 @@ function system_hosts_generate() {
fwrite($fd, $hosts);
fclose($fd);
/* Start the monitoring process for dynamic dhcpclients. */
if (isset($config['dnsmasq']['regdhcp'])) {
/* Make sure we do not error out */
@touch("{$g['dhcpd_chroot_path']}/var/db/dhcpd.leases");
if (file_exists("{$g['varrun_path']}/dhcpleases.pid"))
sigkillbypid("{$g['varrun_path']}/dhcpleases.pid", "HUP");
else
mwexec("/usr/local/sbin/dhcpleases -l {$g['dhcpd_chroot_path']}/var/db/dhcpd.leases -d {$syscfg['domain']} -p {$g['varrun_path']}/dnsmasq.pid -h {$g['varetc_path']}/hosts");
} else {
sigkillbypid("{$g['varrun_path']}/dhcpleases.pid", "TERM");
@unlink("{$g['varrun_path']}/dhcpleases.pid");
}
return 0;
}

View File

@ -1970,4 +1970,96 @@ function upgrade_062_to_063() {
}
}
function upgrade_063_to_064() {
global $config;
$j=0;
$ifcfg = &$config['interfaces'];
if (is_array($config['ppps']['ppp']) && count($config['ppps']['ppp'])) {
foreach ($config['ppps']['ppp'] as $pppid => $ppp) {
$config['ppps']['ppp'][$pppid]['if'] = "ppp".$j;
$config['ppps']['ppp'][$pppid]['ptpid'] = $j;
$j++;
if (isset($ppp['port'])){
$config['ppps']['ppp'][$pppid]['ports'] = $ppp['port'];
unset($config['ppps']['ppp'][$pppid]['port']);
}
if (!isset($ppp['type'])){
$config['ppps']['ppp'][$pppid]['type'] = "ppp";
}
if (isset($ppp['defaultgw']))
unset($config['ppps']['ppp'][$pppid]['defaultgw']);
}
}
if (!is_array($config['ppps']['ppp']))
$config['ppps']['ppp'] = array();
$a_ppps = &$config['ppps']['ppp'];
foreach ($ifcfg as $ifname => $ifinfo) {
$ppp = array();
// For pppoe conversion
if ($ifinfo['ipaddr'] == "pppoe" || $ifinfo['ipaddr'] == "pptp"){
if (isset($ifinfo['ptpid']))
continue;
$ppp['ptpid'] = $j;
$ppp['type'] = $ifinfo['ipaddr'];
$ppp['if'] = $ifinfo['ipaddr'].$j;
$ppp['ports'] = $ifinfo['if'];
if ($ifinfo['ipaddr'] == "pppoe"){
$ppp['username'] = $ifinfo['pppoe_username'];
$ppp['password'] = base64_encode($ifinfo['pppoe_password']);
}
if ($ifinfo['ipaddr'] == "pptp"){
$ppp['username'] = $ifinfo['pptp_username'];
$ppp['password'] = base64_encode($ifinfo['pptp_password']);
}
if (isset($ifinfo['provider']))
$ppp['provider'] = $ifinfo['provider'];
if (isset($ifinfo['ondemand']))
$ppp['ondemand'] = true;
if (isset($ifinfo['timeout']))
$ppp['idletimeout'] = $ifinfo['timeout'];
if (isset($ifinfo['pppoe']['pppoe-reset-type'])){
$ppp['pppoe-reset-type'] = $ifinfo['pppoe']['pppoe-reset-type'];
if (is_array($config['cron']['item'])) {
for ($i = 0; $i < count($config['cron']['item']); $i++) {
$item = $config['cron']['item'][$i];
if (strpos($item['command'], "/conf/pppoe{$ifname}restart") !== false)
$config['cron']['item'][$i]['command'] = "/var/etc/pppoe_restart_" . $ppp['if'];
}
}
}
if (isset($ifinfo['local']))
$ppp['localip'] = $ifinfo['local'];
if (isset($ifinfo['subnet']))
$ppp['subnet'] = $ifinfo['subnet'];
if (isset($ifinfo['remote']))
$ppp['gateway'] = $ifinfo['remote'];
$ifcfg[$ifname]['if'] = $ifinfo['ipaddr'].$j;
$j++;
unset($ifcfg[$ifname]['pppoe_username']);
unset($ifcfg[$ifname]['pppoe_password']);
unset($ifcfg[$ifname]['provider']);
unset($ifcfg[$ifname]['ondemand']);
unset($ifcfg[$ifname]['timeout']);
unset($ifcfg[$ifname]['pppoe_reset']);
unset($ifcfg[$ifname]['pppoe_preset']);
unset($ifcfg[$ifname]['pppoe']);
unset($ifcfg[$ifname]['pptp_username']);
unset($ifcfg[$ifname]['pptp_password']);
unset($ifcfg[$ifname]['local']);
unset($ifcfg[$ifname]['subnet']);
unset($ifcfg[$ifname]['remote']);
$a_ppps[] = $ppp;
}
}
}
?>

View File

@ -1065,18 +1065,20 @@ EOD;
if (isset($pptpdcfg["wins"]) && $pptpdcfg['wins'] != "")
$mpdconf .= " set ipcp nbns {$pptpdcfg['wins']}\n";
if (is_array($pptpdcfg['dnsserver']) && ($pptpdcfg['dnsserver'][0])) {
$mpdconf .= " set ipcp dns " . join(" ", $pptpdcfg['dnsserver']) . "\n";
} else
if (isset ($config['dnsmasq']['enable'])) {
$mpdconf .= " set ipcp dns " . get_interface_ip("lan");
if ($syscfg['dnsserver'][0])
$mpdconf .= " " . $syscfg['dnsserver'][0];
$mpdconf .= "\n";
} else
if (is_array($syscfg['dnsserver']) && ($syscfg['dnsserver'][0])) {
$mpdconf .= " set ipcp dns " . join(" ", $syscfg['dnsserver']) . "\n";
}
if (!empty($pptpdcfg['dns1'])) {
$mpdconf .= " set ipcp dns " . $pptpdcfg['dns1'];
if (!empty($pptpdcfg['dns2']))
$mpdconf .= " " . $pptpdcfg['dns2'];
$mpdconf .= "\n";
} elseif (isset ($config['dnsmasq']['enable'])) {
$mpdconf .= " set ipcp dns " . get_interface_ip("lan");
if ($syscfg['dnsserver'][0])
$mpdconf .= " " . $syscfg['dnsserver'][0];
$mpdconf .= "\n";
} elseif (is_array($syscfg['dnsserver']) && ($syscfg['dnsserver'][0])) {
$mpdconf .= " set ipcp dns " . join(" ", $syscfg['dnsserver']) . "\n";
}
if (isset ($pptpdcfg['radius']['server']['enable'])) {
$authport = (isset($pptpdcfg['radius']['server']['port']) && strlen($pptpdcfg['radius']['server']['port']) > 1) ? $pptpdcfg['radius']['server']['port'] : 1812;
@ -1274,15 +1276,19 @@ pppoe_standart:
EOD;
if (isset ($config['dnsmasq']['enable'])) {
if (!empty($pppoecfg['dns1'])) {
$mpdconf .= " set ipcp dns " . $pppoecfg['dns1'];
if (!empty($pppoecfg['dns2']))
$mpdconf .= " " . $pppoecfg['dns2'];
$mpdconf .= "\n";
} elseif (isset ($config['dnsmasq']['enable'])) {
$mpdconf .= " set ipcp dns " . get_interface_ip("lan");
if ($syscfg['dnsserver'][0])
$mpdconf .= " " . $syscfg['dnsserver'][0];
$mpdconf .= "\n";
} else
if (is_array($syscfg['dnsserver']) && ($syscfg['dnsserver'][0])) {
} elseif (is_array($syscfg['dnsserver']) && ($syscfg['dnsserver'][0])) {
$mpdconf .= " set ipcp dns " . join(" ", $syscfg['dnsserver']) . "\n";
}
}
if (isset ($pppoecfg['radius']['enable'])) {
$mpdconf .=<<<EOD
@ -1454,15 +1460,19 @@ l2tp_standard:
EOD;
if (isset ($config['dnsmasq']['enable'])) {
if (!empty($l2tpcfg['dns1'])) {
$mpdconf .= " set ipcp dns " . $l2tpcfg['dns1'];
if (!empty($l2tpcfg['dns2']))
$mpdconf .= " " . $l2tpcfg['dns2'];
$mpdconf .= "\n";
} elseif (isset ($config['dnsmasq']['enable'])) {
$mpdconf .= " set ipcp dns " . get_interface_ip("lan");
if ($syscfg['dnsserver'][0])
$mpdconf .= " " . $syscfg['dnsserver'][0];
$mpdconf .= "\n";
} else
if (is_array($syscfg['dnsserver']) && ($syscfg['dnsserver'][0])) {
} elseif (is_array($syscfg['dnsserver']) && ($syscfg['dnsserver'][0])) {
$mpdconf .= " set ipcp dns " . join(" ", $syscfg['dnsserver']) . "\n";
}
}
if (isset ($l2tpcfg['radius']['enable'])) {
$mpdconf .=<<<EOD

View File

@ -8,6 +8,7 @@ require_once("globals.inc");
require_once("filter.inc");
require_once("shaper.inc");
require_once("rrd.inc");
require_once("pfsense-utils.inc");
conf_mount_rw();

View File

@ -119,6 +119,8 @@ require_once("/etc/inc/captiveportal.inc");
echo ".";
require_once("/etc/inc/rrd.inc");
echo ".";
require_once("/etc/inc/pfsense-utils.inc");
echo ".";
/* get system memory amount */
$memory = get_memory();
@ -329,9 +331,6 @@ enable_rrd_graphing();
/* start DHCP service */
services_dhcpd_configure();
/* start DHCP logging service which populates /etc/hosts */
services_parse_dhcpd_hostnames();
/* startup OLSR if needed */
setup_wireless_olsr();

Binary file not shown.

View File

@ -1,484 +0,0 @@
#! /bin/sh
# Install GRUB on your drive.
# Copyright (C) 1999,2000,2001,2002,2003,2004 Free Software Foundation, Inc.
#
# This file is free software; you can redistribute it and/or modify it
# under the terms of the GNU General Public License as published by
# the Free Software Foundation; either version 2 of the License, or
# (at your option) any later version.
#
# This program is distributed in the hope that it will be useful, but
# WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
# General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program; if not, write to the Free Software
# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
# Initialize some variables.
prefix=/usr/local
exec_prefix=${prefix}
sbindir=${exec_prefix}/sbin
libdir=/usr/local/share
PACKAGE=grub
VERSION=0.97
host_cpu=i386
host_os=freebsd7.0
host_vendor=freebsd
pkglibdir=${libdir}/${PACKAGE}/${host_cpu}-${host_vendor}
grub_shell=${sbindir}/grub
grub_set_default=${sbindir}/grub-set-default
log_file=/tmp/grub-install.log.$$
img_file=/tmp/grub-install.img.$$
rootdir=
grub_prefix=/boot/grub
install_device=
no_floppy=
force_lba=
recheck=no
debug=no
# look for secure tempfile creation wrappers on this platform
if test -x /bin/tempfile; then
mklog="/bin/tempfile --prefix=grub"
mkimg="/bin/tempfile --prefix=grub"
elif test -x /bin/mktemp; then
mklog="/bin/mktemp /tmp/grub-install.log.XXXXXX"
mkimg="/bin/mktemp /tmp/grub-install.img.XXXXXX"
else
mklog=""
mkimg=""
fi
# Usage: usage
# Print the usage.
usage () {
cat <<EOF
Usage: grub-install [OPTION] install_device
Install GRUB on your drive.
-h, --help print this message and exit
-v, --version print the version information and exit
--root-directory=DIR install GRUB images under the directory DIR
instead of the root directory
--grub-shell=FILE use FILE as the grub shell
--no-floppy do not probe any floppy drive
--force-lba force GRUB to use LBA mode even for a buggy
BIOS
--recheck probe a device map even if it already exists
INSTALL_DEVICE can be a GRUB device name or a system device filename.
grub-install copies GRUB images into the DIR/boot directory specfied by
--root-directory, and uses the grub shell to install grub into the boot
sector.
Report bugs to <bug-grub@gnu.org>.
EOF
}
# Usage: convert os_device
# Convert an OS device to the corresponding GRUB drive.
# This part is OS-specific.
convert () {
# First, check if the device file exists.
if test -e "$1"; then
:
else
echo "$1: Not found or not a block device." 1>&2
exit 1
fi
# Break the device name into the disk part and the partition part.
case "$host_os" in
linux*)
tmp_disk=`echo "$1" | sed -e 's%\([sh]d[a-z]\)[0-9]*$%\1%' \
-e 's%\(d[0-9]*\)p[0-9]*$%\1%' \
-e 's%\(fd[0-9]*\)$%\1%' \
-e 's%/part[0-9]*$%/disc%' \
-e 's%\(c[0-7]d[0-9]*\).*$%\1%'`
tmp_part=`echo "$1" | sed -e 's%.*/[sh]d[a-z]\([0-9]*\)$%\1%' \
-e 's%.*d[0-9]*p%%' \
-e 's%.*/fd[0-9]*$%%' \
-e 's%.*/floppy/[0-9]*$%%' \
-e 's%.*/\(disc\|part\([0-9]*\)\)$%\2%' \
-e 's%.*c[0-7]d[0-9]*p%%'`
;;
gnu*)
tmp_disk=`echo "$1" | sed 's%\([sh]d[0-9]*\).*%\1%'`
tmp_part=`echo "$1" | sed "s%$tmp_disk%%"` ;;
freebsd[234]* | kfreebsd*-gnu)
tmp_disk=`echo "$1" | sed 's%r\{0,1\}\([saw]d[0-9]*\).*$%r\1%' \
| sed 's%r\{0,1\}\(da[0-9]*\).*$%r\1%'`
tmp_part=`echo "$1" \
| sed "s%.*/r\{0,1\}[saw]d[0-9]\(s[0-9]*[a-h]\)%\1%" \
| sed "s%.*/r\{0,1\}da[0-9]\(s[0-9]*[a-h]\)%\1%"`
;;
freebsd[567]*)
tmp_disk=`echo "$1" | sed 's%r\{0,1\}\([saw]d[0-9]*\).*$%\1%' \
| sed 's%r\{0,1\}\(da[0-9]*\).*$%\1%'`
tmp_part=`echo "$1" \
| sed "s%.*/r\{0,1\}[saw]d[0-9]\(s[0-9]*[a-h]\)%\1%" \
| sed "s%.*/r\{0,1\}da[0-9]\(s[0-9]*[a-h]\)%\1%"`
;;
netbsd* | knetbsd*-gnu)
tmp_disk=`echo "$1" | sed 's%r\{0,1\}\([sw]d[0-9]*\).*$%r\1d%' \
| sed 's%r\{0,1\}\(fd[0-9]*\).*$%r\1a%'`
tmp_part=`echo "$1" \
| sed "s%.*/r\{0,1\}[sw]d[0-9]\([abe-p]\)%\1%"`
;;
*)
echo "grub-install does not support your OS yet." 1>&2
exit 1 ;;
esac
# Get the drive name.
tmp_drive=`grep -v '^#' $device_map | grep "$tmp_disk *$" \
| sed 's%.*\(([hf]d[0-9][a-g0-9,]*)\).*%\1%'`
# If not found, print an error message and exit.
if test "x$tmp_drive" = x; then
echo "$1 does not have any corresponding BIOS drive." 1>&2
exit 1
fi
if test "x$tmp_part" != x; then
# If a partition is specified, we need to translate it into the
# GRUB's syntax.
case "$host_os" in
linux*)
echo "$tmp_drive" | sed "s%)$%,`expr $tmp_part - 1`)%" ;;
gnu*)
if echo $tmp_part | grep "^s" >/dev/null; then
tmp_pc_slice=`echo $tmp_part \
| sed "s%s\([0-9]*\)[a-g]*$%\1%"`
tmp_drive=`echo "$tmp_drive" \
| sed "s%)%,\`expr "$tmp_pc_slice" - 1\`)%"`
fi
if echo $tmp_part | grep "[a-g]$" >/dev/null; then
tmp_bsd_partition=`echo "$tmp_part" \
| sed "s%[^a-g]*\([a-g]\)$%\1%"`
tmp_drive=`echo "$tmp_drive" \
| sed "s%)%,$tmp_bsd_partition)%"`
fi
echo "$tmp_drive" ;;
freebsd* | kfreebsd*-gnu)
if echo $tmp_part | grep "^s" >/dev/null; then
tmp_pc_slice=`echo $tmp_part \
| sed "s%s\([0-9]*\)[a-h]*$%\1%"`
tmp_drive=`echo "$tmp_drive" \
| sed "s%)%,\`expr "$tmp_pc_slice" - 1\`)%"`
fi
if echo $tmp_part | grep "[a-h]$" >/dev/null; then
tmp_bsd_partition=`echo "$tmp_part" \
| sed "s%s\{0,1\}[0-9]*\([a-h]\)$%\1%"`
tmp_drive=`echo "$tmp_drive" \
| sed "s%)%,$tmp_bsd_partition)%"`
fi
echo "$tmp_drive" ;;
netbsd* | knetbsd*-gnu)
if echo $tmp_part | grep "^[abe-p]$" >/dev/null; then
tmp_bsd_partition=`echo "$tmp_part" \
| sed "s%\([a-p]\)$%\1%"`
tmp_drive=`echo "$tmp_drive" \
| sed "s%)%,$tmp_bsd_partition)%"`
fi
echo "$tmp_drive" ;;
esac
else
# If no partition is specified, just print the drive name.
echo "$tmp_drive"
fi
}
# Usage: resolve_symlink file
# Find the real file/device that file points at
resolve_symlink () {
tmp_fname=$1
# Resolve symlinks
while test -L $tmp_fname; do
tmp_new_fname=`ls -al $tmp_fname | sed -n 's%.*-> \(.*\)%\1%p'`
if test -z "$tmp_new_fname"; then
echo "Unrecognized ls output" 2>&1
exit 1
fi
# Convert relative symlinks
case $tmp_new_fname in
/*) tmp_fname="$tmp_new_fname"
;;
*) tmp_fname="`echo $tmp_fname | sed 's%/[^/]*$%%'`/$tmp_new_fname"
;;
esac
done
echo "$tmp_fname"
}
# Usage: find_device file
# Find block device on which the file resides.
find_device () {
# For now, this uses the program `df' to get the device name, but is
# this really portable?
tmp_fname=`df $1/ | sed -n 's%.*\(/dev/[^ ]*\).*%\1%p'`
if test -z "$tmp_fname"; then
echo "Could not find device for $1" 2>&1
exit 1
fi
tmp_fname=`resolve_symlink $tmp_fname`
echo "$tmp_fname"
}
# Check the arguments.
for option in "$@"; do
case "$option" in
-h | --help)
usage
exit 0 ;;
-v | --version)
echo "grub-install (GNU GRUB ${VERSION})"
exit 0 ;;
--root-directory=*)
rootdir=`echo "$option" | sed 's/--root-directory=//'` ;;
--grub-shell=*)
grub_shell=`echo "$option" | sed 's/--grub-shell=//'` ;;
--no-floppy)
no_floppy="--no-floppy" ;;
--force-lba)
force_lba="--force-lba" ;;
--recheck)
recheck=yes ;;
# This is an undocumented feature...
--debug)
debug=yes ;;
-*)
echo "Unrecognized option \`$option'" 1>&2
usage
exit 1
;;
*)
if test "x$install_device" != x; then
echo "More than one install_devices?" 1>&2
usage
exit 1
fi
install_device="${option}" ;;
esac
done
if test "x$install_device" = x; then
echo "install_device not specified." 1>&2
usage
exit 1
fi
# If the debugging feature is enabled, print commands.
if test $debug = yes; then
set -x
fi
# Initialize these directories here, since ROOTDIR was initialized.
case "$host_os" in
netbsd* | openbsd*)
# Because /boot is used for the boot block in NetBSD and OpenBSD, use /grub
# instead of /boot/grub.
grub_prefix=/grub
bootdir=${rootdir}
;;
*)
# Use /boot/grub by default.
bootdir=${rootdir}/boot
;;
esac
grubdir=${bootdir}/grub
device_map=${grubdir}/device.map
# Check if GRUB is installed.
# This is necessary, because the user can specify "grub --read-only".
set $grub_shell dummy
if test -f "$1"; then
:
else
echo "$1: Not found." 1>&2
exit 1
fi
if test -f "$pkglibdir/stage1"; then
:
else
echo "${pkglibdir}/stage1: Not found." 1>&2
exit 1
fi
if test -f "$pkglibdir/stage2"; then
:
else
echo "${pkglibdir}/stage2: Not found." 1>&2
exit 1
fi
# Don't check for *stage1_5, because it is not fatal even if any
# Stage 1.5 does not exist.
# Create the GRUB directory if it is not present.
test -d "$bootdir" || mkdir "$bootdir" || exit 1
test -d "$grubdir" || mkdir "$grubdir" || exit 1
# If --recheck is specified, remove the device map, if present.
if test $recheck = yes; then
rm -f $device_map
fi
# Create the device map file if it is not present.
if test -f "$device_map"; then
:
else
# Create a safe temporary file.
test -n "$mklog" && log_file=`$mklog`
$grub_shell --batch $no_floppy --device-map=$device_map <<EOF >$log_file
quit
EOF
if grep "Error [0-9]*: " $log_file >/dev/null; then
cat $log_file 1>&2
exit 1
fi
rm -f $log_file
fi
# Make sure that there is no duplicated entry.
tmp=`sed -n '/^([fh]d[0-9]*)/s/\(^(.*)\).*/\1/p' $device_map \
| sort | uniq -d | sed -n 1p`
if test -n "$tmp"; then
echo "The drive $tmp is defined multiple times in the device map $device_map" 1>&2
exit 1
fi
# Check for INSTALL_DEVICE.
case "$install_device" in
/dev/*)
install_device=`resolve_symlink "$install_device"`
install_drive=`convert "$install_device"`
# I don't know why, but some shells wouldn't die if exit is
# called in a function.
if test "x$install_drive" = x; then
exit 1
fi ;;
\([hf]d[0-9]*\))
install_drive="$install_device" ;;
[hf]d[0-9]*)
# The GRUB format with no parenthesis.
install_drive="($install_device)" ;;
*)
echo "Format of install_device not recognized." 1>&2
usage
exit 1 ;;
esac
# Get the root drive.
root_device=`find_device ${rootdir}`
bootdir_device=`find_device ${bootdir}`
# Check if the boot directory is in the same device as the root directory.
if test "x$root_device" != "x$bootdir_device"; then
# Perhaps the user has a separate boot partition.
root_device=$bootdir_device
grub_prefix="/grub"
fi
# Convert the root device to a GRUB drive.
root_drive=`convert "$root_device"`
if test "x$root_drive" = x; then
exit 1
fi
# Check if the root directory exists in the same device as the grub
# directory.
grubdir_device=`find_device ${grubdir}`
if test "x$grubdir_device" != "x$root_device"; then
# For now, cannot deal with this situation.
cat <<EOF 1>&2
You must set the root directory by the option --root-directory, because
$grubdir does not exist in the root device $root_device.
EOF
exit 1
fi
# Copy the GRUB images to the GRUB directory.
for file in ${grubdir}/stage1 ${grubdir}/stage2 ${grubdir}/*stage1_5; do
rm -f $file || exit 1
done
for file in \
${pkglibdir}/stage1 ${pkglibdir}/stage2 ${pkglibdir}/*stage1_5; do
cp -f $file ${grubdir} || exit 1
done
# Make a default file.
${grub_set_default} --root-directory=${rootdir} default
# Make sure that GRUB reads the same images as the host OS.
test -n "$mkimg" && img_file=`$mkimg`
test -n "$mklog" && log_file=`$mklog`
for file in ${grubdir}/stage1 ${grubdir}/stage2 ${grubdir}/*stage1_5; do
count=5
tmp=`echo $file | sed "s|^${grubdir}|${grub_prefix}|"`
while test $count -gt 0; do
$grub_shell --batch $no_floppy --device-map=$device_map <<EOF >$log_file
dump ${root_drive}${tmp} ${img_file}
quit
EOF
if grep "Error [0-9]*: " $log_file >/dev/null; then
:
elif cmp $file $img_file >/dev/null; then
break
fi
sleep 1
count=`expr $count - 1`
done
if test $count -eq 0; then
echo "The file $file not read correctly." 1>&2
echo
fi
done
rm -f $img_file
rm -f $log_file
# Create a safe temporary file.
test -n "$mklog" && log_file=`$mklog`
# Now perform the installation.
$grub_shell --batch $no_floppy --device-map=$device_map <<EOF >$log_file
root $root_drive
setup $force_lba --stage2=$grubdir/stage2 --prefix=$grub_prefix $install_drive
quit
EOF
if grep "Error [0-9]*: " $log_file >/dev/null || test $debug = yes; then
cat $log_file 1>&2
exit 1
fi
rm -f $log_file
# Prompt the user to check if the device map is correct.
echo "Installation finished. No error reported."
echo "This is the contents of the device map $device_map."
echo "Check if this is correct or not. If any of the lines is incorrect,"
echo "fix it and re-run the script \`grub-install'."
echo
cat $device_map
# Bye.
exit 0

Binary file not shown.

Binary file not shown.

View File

@ -0,0 +1,987 @@
<?xml version="1.0" encoding="ISO-8859-1" standalone="yes"?>
<ISO_3166-1_List_en xml:lang="en">
<ISO_3166-1_Entry>
<ISO_3166-1_Country_name>AFGHANISTAN</ISO_3166-1_Country_name>
<ISO_3166-1_Alpha-2_Code_element>AF</ISO_3166-1_Alpha-2_Code_element>
</ISO_3166-1_Entry>
<ISO_3166-1_Entry>
<ISO_3166-1_Country_name>ÅLAND ISLANDS</ISO_3166-1_Country_name>
<ISO_3166-1_Alpha-2_Code_element>AX</ISO_3166-1_Alpha-2_Code_element>
</ISO_3166-1_Entry>
<ISO_3166-1_Entry>
<ISO_3166-1_Country_name>ALBANIA</ISO_3166-1_Country_name>
<ISO_3166-1_Alpha-2_Code_element>AL</ISO_3166-1_Alpha-2_Code_element>
</ISO_3166-1_Entry>
<ISO_3166-1_Entry>
<ISO_3166-1_Country_name>ALGERIA</ISO_3166-1_Country_name>
<ISO_3166-1_Alpha-2_Code_element>DZ</ISO_3166-1_Alpha-2_Code_element>
</ISO_3166-1_Entry>
<ISO_3166-1_Entry>
<ISO_3166-1_Country_name>AMERICAN SAMOA</ISO_3166-1_Country_name>
<ISO_3166-1_Alpha-2_Code_element>AS</ISO_3166-1_Alpha-2_Code_element>
</ISO_3166-1_Entry>
<ISO_3166-1_Entry>
<ISO_3166-1_Country_name>ANDORRA</ISO_3166-1_Country_name>
<ISO_3166-1_Alpha-2_Code_element>AD</ISO_3166-1_Alpha-2_Code_element>
</ISO_3166-1_Entry>
<ISO_3166-1_Entry>
<ISO_3166-1_Country_name>ANGOLA</ISO_3166-1_Country_name>
<ISO_3166-1_Alpha-2_Code_element>AO</ISO_3166-1_Alpha-2_Code_element>
</ISO_3166-1_Entry>
<ISO_3166-1_Entry>
<ISO_3166-1_Country_name>ANGUILLA</ISO_3166-1_Country_name>
<ISO_3166-1_Alpha-2_Code_element>AI</ISO_3166-1_Alpha-2_Code_element>
</ISO_3166-1_Entry>
<ISO_3166-1_Entry>
<ISO_3166-1_Country_name>ANTARCTICA</ISO_3166-1_Country_name>
<ISO_3166-1_Alpha-2_Code_element>AQ</ISO_3166-1_Alpha-2_Code_element>
</ISO_3166-1_Entry>
<ISO_3166-1_Entry>
<ISO_3166-1_Country_name>ANTIGUA AND BARBUDA</ISO_3166-1_Country_name>
<ISO_3166-1_Alpha-2_Code_element>AG</ISO_3166-1_Alpha-2_Code_element>
</ISO_3166-1_Entry>
<ISO_3166-1_Entry>
<ISO_3166-1_Country_name>ARGENTINA</ISO_3166-1_Country_name>
<ISO_3166-1_Alpha-2_Code_element>AR</ISO_3166-1_Alpha-2_Code_element>
</ISO_3166-1_Entry>
<ISO_3166-1_Entry>
<ISO_3166-1_Country_name>ARMENIA</ISO_3166-1_Country_name>
<ISO_3166-1_Alpha-2_Code_element>AM</ISO_3166-1_Alpha-2_Code_element>
</ISO_3166-1_Entry>
<ISO_3166-1_Entry>
<ISO_3166-1_Country_name>ARUBA</ISO_3166-1_Country_name>
<ISO_3166-1_Alpha-2_Code_element>AW</ISO_3166-1_Alpha-2_Code_element>
</ISO_3166-1_Entry>
<ISO_3166-1_Entry>
<ISO_3166-1_Country_name>AUSTRALIA</ISO_3166-1_Country_name>
<ISO_3166-1_Alpha-2_Code_element>AU</ISO_3166-1_Alpha-2_Code_element>
</ISO_3166-1_Entry>
<ISO_3166-1_Entry>
<ISO_3166-1_Country_name>AUSTRIA</ISO_3166-1_Country_name>
<ISO_3166-1_Alpha-2_Code_element>AT</ISO_3166-1_Alpha-2_Code_element>
</ISO_3166-1_Entry>
<ISO_3166-1_Entry>
<ISO_3166-1_Country_name>AZERBAIJAN</ISO_3166-1_Country_name>
<ISO_3166-1_Alpha-2_Code_element>AZ</ISO_3166-1_Alpha-2_Code_element>
</ISO_3166-1_Entry>
<ISO_3166-1_Entry>
<ISO_3166-1_Country_name>BAHAMAS</ISO_3166-1_Country_name>
<ISO_3166-1_Alpha-2_Code_element>BS</ISO_3166-1_Alpha-2_Code_element>
</ISO_3166-1_Entry>
<ISO_3166-1_Entry>
<ISO_3166-1_Country_name>BAHRAIN</ISO_3166-1_Country_name>
<ISO_3166-1_Alpha-2_Code_element>BH</ISO_3166-1_Alpha-2_Code_element>
</ISO_3166-1_Entry>
<ISO_3166-1_Entry>
<ISO_3166-1_Country_name>BANGLADESH</ISO_3166-1_Country_name>
<ISO_3166-1_Alpha-2_Code_element>BD</ISO_3166-1_Alpha-2_Code_element>
</ISO_3166-1_Entry>
<ISO_3166-1_Entry>
<ISO_3166-1_Country_name>BARBADOS</ISO_3166-1_Country_name>
<ISO_3166-1_Alpha-2_Code_element>BB</ISO_3166-1_Alpha-2_Code_element>
</ISO_3166-1_Entry>
<ISO_3166-1_Entry>
<ISO_3166-1_Country_name>BELARUS</ISO_3166-1_Country_name>
<ISO_3166-1_Alpha-2_Code_element>BY</ISO_3166-1_Alpha-2_Code_element>
</ISO_3166-1_Entry>
<ISO_3166-1_Entry>
<ISO_3166-1_Country_name>BELGIUM</ISO_3166-1_Country_name>
<ISO_3166-1_Alpha-2_Code_element>BE</ISO_3166-1_Alpha-2_Code_element>
</ISO_3166-1_Entry>
<ISO_3166-1_Entry>
<ISO_3166-1_Country_name>BELIZE</ISO_3166-1_Country_name>
<ISO_3166-1_Alpha-2_Code_element>BZ</ISO_3166-1_Alpha-2_Code_element>
</ISO_3166-1_Entry>
<ISO_3166-1_Entry>
<ISO_3166-1_Country_name>BENIN</ISO_3166-1_Country_name>
<ISO_3166-1_Alpha-2_Code_element>BJ</ISO_3166-1_Alpha-2_Code_element>
</ISO_3166-1_Entry>
<ISO_3166-1_Entry>
<ISO_3166-1_Country_name>BERMUDA</ISO_3166-1_Country_name>
<ISO_3166-1_Alpha-2_Code_element>BM</ISO_3166-1_Alpha-2_Code_element>
</ISO_3166-1_Entry>
<ISO_3166-1_Entry>
<ISO_3166-1_Country_name>BHUTAN</ISO_3166-1_Country_name>
<ISO_3166-1_Alpha-2_Code_element>BT</ISO_3166-1_Alpha-2_Code_element>
</ISO_3166-1_Entry>
<ISO_3166-1_Entry>
<ISO_3166-1_Country_name>BOLIVIA, PLURINATIONAL STATE OF</ISO_3166-1_Country_name>
<ISO_3166-1_Alpha-2_Code_element>BO</ISO_3166-1_Alpha-2_Code_element>
</ISO_3166-1_Entry>
<ISO_3166-1_Entry>
<ISO_3166-1_Country_name>BOSNIA AND HERZEGOVINA</ISO_3166-1_Country_name>
<ISO_3166-1_Alpha-2_Code_element>BA</ISO_3166-1_Alpha-2_Code_element>
</ISO_3166-1_Entry>
<ISO_3166-1_Entry>
<ISO_3166-1_Country_name>BOTSWANA</ISO_3166-1_Country_name>
<ISO_3166-1_Alpha-2_Code_element>BW</ISO_3166-1_Alpha-2_Code_element>
</ISO_3166-1_Entry>
<ISO_3166-1_Entry>
<ISO_3166-1_Country_name>BOUVET ISLAND</ISO_3166-1_Country_name>
<ISO_3166-1_Alpha-2_Code_element>BV</ISO_3166-1_Alpha-2_Code_element>
</ISO_3166-1_Entry>
<ISO_3166-1_Entry>
<ISO_3166-1_Country_name>BRAZIL</ISO_3166-1_Country_name>
<ISO_3166-1_Alpha-2_Code_element>BR</ISO_3166-1_Alpha-2_Code_element>
</ISO_3166-1_Entry>
<ISO_3166-1_Entry>
<ISO_3166-1_Country_name>BRITISH INDIAN OCEAN TERRITORY</ISO_3166-1_Country_name>
<ISO_3166-1_Alpha-2_Code_element>IO</ISO_3166-1_Alpha-2_Code_element>
</ISO_3166-1_Entry>
<ISO_3166-1_Entry>
<ISO_3166-1_Country_name>BRUNEI DARUSSALAM</ISO_3166-1_Country_name>
<ISO_3166-1_Alpha-2_Code_element>BN</ISO_3166-1_Alpha-2_Code_element>
</ISO_3166-1_Entry>
<ISO_3166-1_Entry>
<ISO_3166-1_Country_name>BULGARIA</ISO_3166-1_Country_name>
<ISO_3166-1_Alpha-2_Code_element>BG</ISO_3166-1_Alpha-2_Code_element>
</ISO_3166-1_Entry>
<ISO_3166-1_Entry>
<ISO_3166-1_Country_name>BURKINA FASO</ISO_3166-1_Country_name>
<ISO_3166-1_Alpha-2_Code_element>BF</ISO_3166-1_Alpha-2_Code_element>
</ISO_3166-1_Entry>
<ISO_3166-1_Entry>
<ISO_3166-1_Country_name>BURUNDI</ISO_3166-1_Country_name>
<ISO_3166-1_Alpha-2_Code_element>BI</ISO_3166-1_Alpha-2_Code_element>
</ISO_3166-1_Entry>
<ISO_3166-1_Entry>
<ISO_3166-1_Country_name>CAMBODIA</ISO_3166-1_Country_name>
<ISO_3166-1_Alpha-2_Code_element>KH</ISO_3166-1_Alpha-2_Code_element>
</ISO_3166-1_Entry>
<ISO_3166-1_Entry>
<ISO_3166-1_Country_name>CAMEROON</ISO_3166-1_Country_name>
<ISO_3166-1_Alpha-2_Code_element>CM</ISO_3166-1_Alpha-2_Code_element>
</ISO_3166-1_Entry>
<ISO_3166-1_Entry>
<ISO_3166-1_Country_name>CANADA</ISO_3166-1_Country_name>
<ISO_3166-1_Alpha-2_Code_element>CA</ISO_3166-1_Alpha-2_Code_element>
</ISO_3166-1_Entry>
<ISO_3166-1_Entry>
<ISO_3166-1_Country_name>CAPE VERDE</ISO_3166-1_Country_name>
<ISO_3166-1_Alpha-2_Code_element>CV</ISO_3166-1_Alpha-2_Code_element>
</ISO_3166-1_Entry>
<ISO_3166-1_Entry>
<ISO_3166-1_Country_name>CAYMAN ISLANDS</ISO_3166-1_Country_name>
<ISO_3166-1_Alpha-2_Code_element>KY</ISO_3166-1_Alpha-2_Code_element>
</ISO_3166-1_Entry>
<ISO_3166-1_Entry>
<ISO_3166-1_Country_name>CENTRAL AFRICAN REPUBLIC</ISO_3166-1_Country_name>
<ISO_3166-1_Alpha-2_Code_element>CF</ISO_3166-1_Alpha-2_Code_element>
</ISO_3166-1_Entry>
<ISO_3166-1_Entry>
<ISO_3166-1_Country_name>CHAD</ISO_3166-1_Country_name>
<ISO_3166-1_Alpha-2_Code_element>TD</ISO_3166-1_Alpha-2_Code_element>
</ISO_3166-1_Entry>
<ISO_3166-1_Entry>
<ISO_3166-1_Country_name>CHILE</ISO_3166-1_Country_name>
<ISO_3166-1_Alpha-2_Code_element>CL</ISO_3166-1_Alpha-2_Code_element>
</ISO_3166-1_Entry>
<ISO_3166-1_Entry>
<ISO_3166-1_Country_name>CHINA</ISO_3166-1_Country_name>
<ISO_3166-1_Alpha-2_Code_element>CN</ISO_3166-1_Alpha-2_Code_element>
</ISO_3166-1_Entry>
<ISO_3166-1_Entry>
<ISO_3166-1_Country_name>CHRISTMAS ISLAND</ISO_3166-1_Country_name>
<ISO_3166-1_Alpha-2_Code_element>CX</ISO_3166-1_Alpha-2_Code_element>
</ISO_3166-1_Entry>
<ISO_3166-1_Entry>
<ISO_3166-1_Country_name>COCOS (KEELING) ISLANDS</ISO_3166-1_Country_name>
<ISO_3166-1_Alpha-2_Code_element>CC</ISO_3166-1_Alpha-2_Code_element>
</ISO_3166-1_Entry>
<ISO_3166-1_Entry>
<ISO_3166-1_Country_name>COLOMBIA</ISO_3166-1_Country_name>
<ISO_3166-1_Alpha-2_Code_element>CO</ISO_3166-1_Alpha-2_Code_element>
</ISO_3166-1_Entry>
<ISO_3166-1_Entry>
<ISO_3166-1_Country_name>COMOROS</ISO_3166-1_Country_name>
<ISO_3166-1_Alpha-2_Code_element>KM</ISO_3166-1_Alpha-2_Code_element>
</ISO_3166-1_Entry>
<ISO_3166-1_Entry>
<ISO_3166-1_Country_name>CONGO</ISO_3166-1_Country_name>
<ISO_3166-1_Alpha-2_Code_element>CG</ISO_3166-1_Alpha-2_Code_element>
</ISO_3166-1_Entry>
<ISO_3166-1_Entry>
<ISO_3166-1_Country_name>CONGO, THE DEMOCRATIC REPUBLIC OF THE</ISO_3166-1_Country_name>
<ISO_3166-1_Alpha-2_Code_element>CD</ISO_3166-1_Alpha-2_Code_element>
</ISO_3166-1_Entry>
<ISO_3166-1_Entry>
<ISO_3166-1_Country_name>COOK ISLANDS</ISO_3166-1_Country_name>
<ISO_3166-1_Alpha-2_Code_element>CK</ISO_3166-1_Alpha-2_Code_element>
</ISO_3166-1_Entry>
<ISO_3166-1_Entry>
<ISO_3166-1_Country_name>COSTA RICA</ISO_3166-1_Country_name>
<ISO_3166-1_Alpha-2_Code_element>CR</ISO_3166-1_Alpha-2_Code_element>
</ISO_3166-1_Entry>
<ISO_3166-1_Entry>
<ISO_3166-1_Country_name>CÔTE D'IVOIRE</ISO_3166-1_Country_name>
<ISO_3166-1_Alpha-2_Code_element>CI</ISO_3166-1_Alpha-2_Code_element>
</ISO_3166-1_Entry>
<ISO_3166-1_Entry>
<ISO_3166-1_Country_name>CROATIA</ISO_3166-1_Country_name>
<ISO_3166-1_Alpha-2_Code_element>HR</ISO_3166-1_Alpha-2_Code_element>
</ISO_3166-1_Entry>
<ISO_3166-1_Entry>
<ISO_3166-1_Country_name>CUBA</ISO_3166-1_Country_name>
<ISO_3166-1_Alpha-2_Code_element>CU</ISO_3166-1_Alpha-2_Code_element>
</ISO_3166-1_Entry>
<ISO_3166-1_Entry>
<ISO_3166-1_Country_name>CYPRUS</ISO_3166-1_Country_name>
<ISO_3166-1_Alpha-2_Code_element>CY</ISO_3166-1_Alpha-2_Code_element>
</ISO_3166-1_Entry>
<ISO_3166-1_Entry>
<ISO_3166-1_Country_name>CZECH REPUBLIC</ISO_3166-1_Country_name>
<ISO_3166-1_Alpha-2_Code_element>CZ</ISO_3166-1_Alpha-2_Code_element>
</ISO_3166-1_Entry>
<ISO_3166-1_Entry>
<ISO_3166-1_Country_name>DENMARK</ISO_3166-1_Country_name>
<ISO_3166-1_Alpha-2_Code_element>DK</ISO_3166-1_Alpha-2_Code_element>
</ISO_3166-1_Entry>
<ISO_3166-1_Entry>
<ISO_3166-1_Country_name>DJIBOUTI</ISO_3166-1_Country_name>
<ISO_3166-1_Alpha-2_Code_element>DJ</ISO_3166-1_Alpha-2_Code_element>
</ISO_3166-1_Entry>
<ISO_3166-1_Entry>
<ISO_3166-1_Country_name>DOMINICA</ISO_3166-1_Country_name>
<ISO_3166-1_Alpha-2_Code_element>DM</ISO_3166-1_Alpha-2_Code_element>
</ISO_3166-1_Entry>
<ISO_3166-1_Entry>
<ISO_3166-1_Country_name>DOMINICAN REPUBLIC</ISO_3166-1_Country_name>
<ISO_3166-1_Alpha-2_Code_element>DO</ISO_3166-1_Alpha-2_Code_element>
</ISO_3166-1_Entry>
<ISO_3166-1_Entry>
<ISO_3166-1_Country_name>ECUADOR</ISO_3166-1_Country_name>
<ISO_3166-1_Alpha-2_Code_element>EC</ISO_3166-1_Alpha-2_Code_element>
</ISO_3166-1_Entry>
<ISO_3166-1_Entry>
<ISO_3166-1_Country_name>EGYPT</ISO_3166-1_Country_name>
<ISO_3166-1_Alpha-2_Code_element>EG</ISO_3166-1_Alpha-2_Code_element>
</ISO_3166-1_Entry>
<ISO_3166-1_Entry>
<ISO_3166-1_Country_name>EL SALVADOR</ISO_3166-1_Country_name>
<ISO_3166-1_Alpha-2_Code_element>SV</ISO_3166-1_Alpha-2_Code_element>
</ISO_3166-1_Entry>
<ISO_3166-1_Entry>
<ISO_3166-1_Country_name>EQUATORIAL GUINEA</ISO_3166-1_Country_name>
<ISO_3166-1_Alpha-2_Code_element>GQ</ISO_3166-1_Alpha-2_Code_element>
</ISO_3166-1_Entry>
<ISO_3166-1_Entry>
<ISO_3166-1_Country_name>ERITREA</ISO_3166-1_Country_name>
<ISO_3166-1_Alpha-2_Code_element>ER</ISO_3166-1_Alpha-2_Code_element>
</ISO_3166-1_Entry>
<ISO_3166-1_Entry>
<ISO_3166-1_Country_name>ESTONIA</ISO_3166-1_Country_name>
<ISO_3166-1_Alpha-2_Code_element>EE</ISO_3166-1_Alpha-2_Code_element>
</ISO_3166-1_Entry>
<ISO_3166-1_Entry>
<ISO_3166-1_Country_name>ETHIOPIA</ISO_3166-1_Country_name>
<ISO_3166-1_Alpha-2_Code_element>ET</ISO_3166-1_Alpha-2_Code_element>
</ISO_3166-1_Entry>
<ISO_3166-1_Entry>
<ISO_3166-1_Country_name>FALKLAND ISLANDS (MALVINAS)</ISO_3166-1_Country_name>
<ISO_3166-1_Alpha-2_Code_element>FK</ISO_3166-1_Alpha-2_Code_element>
</ISO_3166-1_Entry>
<ISO_3166-1_Entry>
<ISO_3166-1_Country_name>FAROE ISLANDS</ISO_3166-1_Country_name>
<ISO_3166-1_Alpha-2_Code_element>FO</ISO_3166-1_Alpha-2_Code_element>
</ISO_3166-1_Entry>
<ISO_3166-1_Entry>
<ISO_3166-1_Country_name>FIJI</ISO_3166-1_Country_name>
<ISO_3166-1_Alpha-2_Code_element>FJ</ISO_3166-1_Alpha-2_Code_element>
</ISO_3166-1_Entry>
<ISO_3166-1_Entry>
<ISO_3166-1_Country_name>FINLAND</ISO_3166-1_Country_name>
<ISO_3166-1_Alpha-2_Code_element>FI</ISO_3166-1_Alpha-2_Code_element>
</ISO_3166-1_Entry>
<ISO_3166-1_Entry>
<ISO_3166-1_Country_name>FRANCE</ISO_3166-1_Country_name>
<ISO_3166-1_Alpha-2_Code_element>FR</ISO_3166-1_Alpha-2_Code_element>
</ISO_3166-1_Entry>
<ISO_3166-1_Entry>
<ISO_3166-1_Country_name>FRENCH GUIANA</ISO_3166-1_Country_name>
<ISO_3166-1_Alpha-2_Code_element>GF</ISO_3166-1_Alpha-2_Code_element>
</ISO_3166-1_Entry>
<ISO_3166-1_Entry>
<ISO_3166-1_Country_name>FRENCH POLYNESIA</ISO_3166-1_Country_name>
<ISO_3166-1_Alpha-2_Code_element>PF</ISO_3166-1_Alpha-2_Code_element>
</ISO_3166-1_Entry>
<ISO_3166-1_Entry>
<ISO_3166-1_Country_name>FRENCH SOUTHERN TERRITORIES</ISO_3166-1_Country_name>
<ISO_3166-1_Alpha-2_Code_element>TF</ISO_3166-1_Alpha-2_Code_element>
</ISO_3166-1_Entry>
<ISO_3166-1_Entry>
<ISO_3166-1_Country_name>GABON</ISO_3166-1_Country_name>
<ISO_3166-1_Alpha-2_Code_element>GA</ISO_3166-1_Alpha-2_Code_element>
</ISO_3166-1_Entry>
<ISO_3166-1_Entry>
<ISO_3166-1_Country_name>GAMBIA</ISO_3166-1_Country_name>
<ISO_3166-1_Alpha-2_Code_element>GM</ISO_3166-1_Alpha-2_Code_element>
</ISO_3166-1_Entry>
<ISO_3166-1_Entry>
<ISO_3166-1_Country_name>GEORGIA</ISO_3166-1_Country_name>
<ISO_3166-1_Alpha-2_Code_element>GE</ISO_3166-1_Alpha-2_Code_element>
</ISO_3166-1_Entry>
<ISO_3166-1_Entry>
<ISO_3166-1_Country_name>GERMANY</ISO_3166-1_Country_name>
<ISO_3166-1_Alpha-2_Code_element>DE</ISO_3166-1_Alpha-2_Code_element>
</ISO_3166-1_Entry>
<ISO_3166-1_Entry>
<ISO_3166-1_Country_name>GHANA</ISO_3166-1_Country_name>
<ISO_3166-1_Alpha-2_Code_element>GH</ISO_3166-1_Alpha-2_Code_element>
</ISO_3166-1_Entry>
<ISO_3166-1_Entry>
<ISO_3166-1_Country_name>GIBRALTAR</ISO_3166-1_Country_name>
<ISO_3166-1_Alpha-2_Code_element>GI</ISO_3166-1_Alpha-2_Code_element>
</ISO_3166-1_Entry>
<ISO_3166-1_Entry>
<ISO_3166-1_Country_name>GREECE</ISO_3166-1_Country_name>
<ISO_3166-1_Alpha-2_Code_element>GR</ISO_3166-1_Alpha-2_Code_element>
</ISO_3166-1_Entry>
<ISO_3166-1_Entry>
<ISO_3166-1_Country_name>GREENLAND</ISO_3166-1_Country_name>
<ISO_3166-1_Alpha-2_Code_element>GL</ISO_3166-1_Alpha-2_Code_element>
</ISO_3166-1_Entry>
<ISO_3166-1_Entry>
<ISO_3166-1_Country_name>GRENADA</ISO_3166-1_Country_name>
<ISO_3166-1_Alpha-2_Code_element>GD</ISO_3166-1_Alpha-2_Code_element>
</ISO_3166-1_Entry>
<ISO_3166-1_Entry>
<ISO_3166-1_Country_name>GUADELOUPE</ISO_3166-1_Country_name>
<ISO_3166-1_Alpha-2_Code_element>GP</ISO_3166-1_Alpha-2_Code_element>
</ISO_3166-1_Entry>
<ISO_3166-1_Entry>
<ISO_3166-1_Country_name>GUAM</ISO_3166-1_Country_name>
<ISO_3166-1_Alpha-2_Code_element>GU</ISO_3166-1_Alpha-2_Code_element>
</ISO_3166-1_Entry>
<ISO_3166-1_Entry>
<ISO_3166-1_Country_name>GUATEMALA</ISO_3166-1_Country_name>
<ISO_3166-1_Alpha-2_Code_element>GT</ISO_3166-1_Alpha-2_Code_element>
</ISO_3166-1_Entry>
<ISO_3166-1_Entry>
<ISO_3166-1_Country_name>GUERNSEY</ISO_3166-1_Country_name>
<ISO_3166-1_Alpha-2_Code_element>GG</ISO_3166-1_Alpha-2_Code_element>
</ISO_3166-1_Entry>
<ISO_3166-1_Entry>
<ISO_3166-1_Country_name>GUINEA</ISO_3166-1_Country_name>
<ISO_3166-1_Alpha-2_Code_element>GN</ISO_3166-1_Alpha-2_Code_element>
</ISO_3166-1_Entry>
<ISO_3166-1_Entry>
<ISO_3166-1_Country_name>GUINEA-BISSAU</ISO_3166-1_Country_name>
<ISO_3166-1_Alpha-2_Code_element>GW</ISO_3166-1_Alpha-2_Code_element>
</ISO_3166-1_Entry>
<ISO_3166-1_Entry>
<ISO_3166-1_Country_name>GUYANA</ISO_3166-1_Country_name>
<ISO_3166-1_Alpha-2_Code_element>GY</ISO_3166-1_Alpha-2_Code_element>
</ISO_3166-1_Entry>
<ISO_3166-1_Entry>
<ISO_3166-1_Country_name>HAITI</ISO_3166-1_Country_name>
<ISO_3166-1_Alpha-2_Code_element>HT</ISO_3166-1_Alpha-2_Code_element>
</ISO_3166-1_Entry>
<ISO_3166-1_Entry>
<ISO_3166-1_Country_name>HEARD ISLAND AND MCDONALD ISLANDS</ISO_3166-1_Country_name>
<ISO_3166-1_Alpha-2_Code_element>HM</ISO_3166-1_Alpha-2_Code_element>
</ISO_3166-1_Entry>
<ISO_3166-1_Entry>
<ISO_3166-1_Country_name>HOLY SEE (VATICAN CITY STATE)</ISO_3166-1_Country_name>
<ISO_3166-1_Alpha-2_Code_element>VA</ISO_3166-1_Alpha-2_Code_element>
</ISO_3166-1_Entry>
<ISO_3166-1_Entry>
<ISO_3166-1_Country_name>HONDURAS</ISO_3166-1_Country_name>
<ISO_3166-1_Alpha-2_Code_element>HN</ISO_3166-1_Alpha-2_Code_element>
</ISO_3166-1_Entry>
<ISO_3166-1_Entry>
<ISO_3166-1_Country_name>HONG KONG</ISO_3166-1_Country_name>
<ISO_3166-1_Alpha-2_Code_element>HK</ISO_3166-1_Alpha-2_Code_element>
</ISO_3166-1_Entry>
<ISO_3166-1_Entry>
<ISO_3166-1_Country_name>HUNGARY</ISO_3166-1_Country_name>
<ISO_3166-1_Alpha-2_Code_element>HU</ISO_3166-1_Alpha-2_Code_element>
</ISO_3166-1_Entry>
<ISO_3166-1_Entry>
<ISO_3166-1_Country_name>ICELAND</ISO_3166-1_Country_name>
<ISO_3166-1_Alpha-2_Code_element>IS</ISO_3166-1_Alpha-2_Code_element>
</ISO_3166-1_Entry>
<ISO_3166-1_Entry>
<ISO_3166-1_Country_name>INDIA</ISO_3166-1_Country_name>
<ISO_3166-1_Alpha-2_Code_element>IN</ISO_3166-1_Alpha-2_Code_element>
</ISO_3166-1_Entry>
<ISO_3166-1_Entry>
<ISO_3166-1_Country_name>INDONESIA</ISO_3166-1_Country_name>
<ISO_3166-1_Alpha-2_Code_element>ID</ISO_3166-1_Alpha-2_Code_element>
</ISO_3166-1_Entry>
<ISO_3166-1_Entry>
<ISO_3166-1_Country_name>IRAN, ISLAMIC REPUBLIC OF</ISO_3166-1_Country_name>
<ISO_3166-1_Alpha-2_Code_element>IR</ISO_3166-1_Alpha-2_Code_element>
</ISO_3166-1_Entry>
<ISO_3166-1_Entry>
<ISO_3166-1_Country_name>IRAQ</ISO_3166-1_Country_name>
<ISO_3166-1_Alpha-2_Code_element>IQ</ISO_3166-1_Alpha-2_Code_element>
</ISO_3166-1_Entry>
<ISO_3166-1_Entry>
<ISO_3166-1_Country_name>IRELAND</ISO_3166-1_Country_name>
<ISO_3166-1_Alpha-2_Code_element>IE</ISO_3166-1_Alpha-2_Code_element>
</ISO_3166-1_Entry>
<ISO_3166-1_Entry>
<ISO_3166-1_Country_name>ISLE OF MAN</ISO_3166-1_Country_name>
<ISO_3166-1_Alpha-2_Code_element>IM</ISO_3166-1_Alpha-2_Code_element>
</ISO_3166-1_Entry>
<ISO_3166-1_Entry>
<ISO_3166-1_Country_name>ISRAEL</ISO_3166-1_Country_name>
<ISO_3166-1_Alpha-2_Code_element>IL</ISO_3166-1_Alpha-2_Code_element>
</ISO_3166-1_Entry>
<ISO_3166-1_Entry>
<ISO_3166-1_Country_name>ITALY</ISO_3166-1_Country_name>
<ISO_3166-1_Alpha-2_Code_element>IT</ISO_3166-1_Alpha-2_Code_element>
</ISO_3166-1_Entry>
<ISO_3166-1_Entry>
<ISO_3166-1_Country_name>JAMAICA</ISO_3166-1_Country_name>
<ISO_3166-1_Alpha-2_Code_element>JM</ISO_3166-1_Alpha-2_Code_element>
</ISO_3166-1_Entry>
<ISO_3166-1_Entry>
<ISO_3166-1_Country_name>JAPAN</ISO_3166-1_Country_name>
<ISO_3166-1_Alpha-2_Code_element>JP</ISO_3166-1_Alpha-2_Code_element>
</ISO_3166-1_Entry>
<ISO_3166-1_Entry>
<ISO_3166-1_Country_name>JERSEY</ISO_3166-1_Country_name>
<ISO_3166-1_Alpha-2_Code_element>JE</ISO_3166-1_Alpha-2_Code_element>
</ISO_3166-1_Entry>
<ISO_3166-1_Entry>
<ISO_3166-1_Country_name>JORDAN</ISO_3166-1_Country_name>
<ISO_3166-1_Alpha-2_Code_element>JO</ISO_3166-1_Alpha-2_Code_element>
</ISO_3166-1_Entry>
<ISO_3166-1_Entry>
<ISO_3166-1_Country_name>KAZAKHSTAN</ISO_3166-1_Country_name>
<ISO_3166-1_Alpha-2_Code_element>KZ</ISO_3166-1_Alpha-2_Code_element>
</ISO_3166-1_Entry>
<ISO_3166-1_Entry>
<ISO_3166-1_Country_name>KENYA</ISO_3166-1_Country_name>
<ISO_3166-1_Alpha-2_Code_element>KE</ISO_3166-1_Alpha-2_Code_element>
</ISO_3166-1_Entry>
<ISO_3166-1_Entry>
<ISO_3166-1_Country_name>KIRIBATI</ISO_3166-1_Country_name>
<ISO_3166-1_Alpha-2_Code_element>KI</ISO_3166-1_Alpha-2_Code_element>
</ISO_3166-1_Entry>
<ISO_3166-1_Entry>
<ISO_3166-1_Country_name>KOREA, DEMOCRATIC PEOPLE'S REPUBLIC OF</ISO_3166-1_Country_name>
<ISO_3166-1_Alpha-2_Code_element>KP</ISO_3166-1_Alpha-2_Code_element>
</ISO_3166-1_Entry>
<ISO_3166-1_Entry>
<ISO_3166-1_Country_name>KOREA, REPUBLIC OF</ISO_3166-1_Country_name>
<ISO_3166-1_Alpha-2_Code_element>KR</ISO_3166-1_Alpha-2_Code_element>
</ISO_3166-1_Entry>
<ISO_3166-1_Entry>
<ISO_3166-1_Country_name>KUWAIT</ISO_3166-1_Country_name>
<ISO_3166-1_Alpha-2_Code_element>KW</ISO_3166-1_Alpha-2_Code_element>
</ISO_3166-1_Entry>
<ISO_3166-1_Entry>
<ISO_3166-1_Country_name>KYRGYZSTAN</ISO_3166-1_Country_name>
<ISO_3166-1_Alpha-2_Code_element>KG</ISO_3166-1_Alpha-2_Code_element>
</ISO_3166-1_Entry>
<ISO_3166-1_Entry>
<ISO_3166-1_Country_name>LAO PEOPLE'S DEMOCRATIC REPUBLIC</ISO_3166-1_Country_name>
<ISO_3166-1_Alpha-2_Code_element>LA</ISO_3166-1_Alpha-2_Code_element>
</ISO_3166-1_Entry>
<ISO_3166-1_Entry>
<ISO_3166-1_Country_name>LATVIA</ISO_3166-1_Country_name>
<ISO_3166-1_Alpha-2_Code_element>LV</ISO_3166-1_Alpha-2_Code_element>
</ISO_3166-1_Entry>
<ISO_3166-1_Entry>
<ISO_3166-1_Country_name>LEBANON</ISO_3166-1_Country_name>
<ISO_3166-1_Alpha-2_Code_element>LB</ISO_3166-1_Alpha-2_Code_element>
</ISO_3166-1_Entry>
<ISO_3166-1_Entry>
<ISO_3166-1_Country_name>LESOTHO</ISO_3166-1_Country_name>
<ISO_3166-1_Alpha-2_Code_element>LS</ISO_3166-1_Alpha-2_Code_element>
</ISO_3166-1_Entry>
<ISO_3166-1_Entry>
<ISO_3166-1_Country_name>LIBERIA</ISO_3166-1_Country_name>
<ISO_3166-1_Alpha-2_Code_element>LR</ISO_3166-1_Alpha-2_Code_element>
</ISO_3166-1_Entry>
<ISO_3166-1_Entry>
<ISO_3166-1_Country_name>LIBYAN ARAB JAMAHIRIYA</ISO_3166-1_Country_name>
<ISO_3166-1_Alpha-2_Code_element>LY</ISO_3166-1_Alpha-2_Code_element>
</ISO_3166-1_Entry>
<ISO_3166-1_Entry>
<ISO_3166-1_Country_name>LIECHTENSTEIN</ISO_3166-1_Country_name>
<ISO_3166-1_Alpha-2_Code_element>LI</ISO_3166-1_Alpha-2_Code_element>
</ISO_3166-1_Entry>
<ISO_3166-1_Entry>
<ISO_3166-1_Country_name>LITHUANIA</ISO_3166-1_Country_name>
<ISO_3166-1_Alpha-2_Code_element>LT</ISO_3166-1_Alpha-2_Code_element>
</ISO_3166-1_Entry>
<ISO_3166-1_Entry>
<ISO_3166-1_Country_name>LUXEMBOURG</ISO_3166-1_Country_name>
<ISO_3166-1_Alpha-2_Code_element>LU</ISO_3166-1_Alpha-2_Code_element>
</ISO_3166-1_Entry>
<ISO_3166-1_Entry>
<ISO_3166-1_Country_name>MACAO</ISO_3166-1_Country_name>
<ISO_3166-1_Alpha-2_Code_element>MO</ISO_3166-1_Alpha-2_Code_element>
</ISO_3166-1_Entry>
<ISO_3166-1_Entry>
<ISO_3166-1_Country_name>MACEDONIA, THE FORMER YUGOSLAV REPUBLIC OF</ISO_3166-1_Country_name>
<ISO_3166-1_Alpha-2_Code_element>MK</ISO_3166-1_Alpha-2_Code_element>
</ISO_3166-1_Entry>
<ISO_3166-1_Entry>
<ISO_3166-1_Country_name>MADAGASCAR</ISO_3166-1_Country_name>
<ISO_3166-1_Alpha-2_Code_element>MG</ISO_3166-1_Alpha-2_Code_element>
</ISO_3166-1_Entry>
<ISO_3166-1_Entry>
<ISO_3166-1_Country_name>MALAWI</ISO_3166-1_Country_name>
<ISO_3166-1_Alpha-2_Code_element>MW</ISO_3166-1_Alpha-2_Code_element>
</ISO_3166-1_Entry>
<ISO_3166-1_Entry>
<ISO_3166-1_Country_name>MALAYSIA</ISO_3166-1_Country_name>
<ISO_3166-1_Alpha-2_Code_element>MY</ISO_3166-1_Alpha-2_Code_element>
</ISO_3166-1_Entry>
<ISO_3166-1_Entry>
<ISO_3166-1_Country_name>MALDIVES</ISO_3166-1_Country_name>
<ISO_3166-1_Alpha-2_Code_element>MV</ISO_3166-1_Alpha-2_Code_element>
</ISO_3166-1_Entry>
<ISO_3166-1_Entry>
<ISO_3166-1_Country_name>MALI</ISO_3166-1_Country_name>
<ISO_3166-1_Alpha-2_Code_element>ML</ISO_3166-1_Alpha-2_Code_element>
</ISO_3166-1_Entry>
<ISO_3166-1_Entry>
<ISO_3166-1_Country_name>MALTA</ISO_3166-1_Country_name>
<ISO_3166-1_Alpha-2_Code_element>MT</ISO_3166-1_Alpha-2_Code_element>
</ISO_3166-1_Entry>
<ISO_3166-1_Entry>
<ISO_3166-1_Country_name>MARSHALL ISLANDS</ISO_3166-1_Country_name>
<ISO_3166-1_Alpha-2_Code_element>MH</ISO_3166-1_Alpha-2_Code_element>
</ISO_3166-1_Entry>
<ISO_3166-1_Entry>
<ISO_3166-1_Country_name>MARTINIQUE</ISO_3166-1_Country_name>
<ISO_3166-1_Alpha-2_Code_element>MQ</ISO_3166-1_Alpha-2_Code_element>
</ISO_3166-1_Entry>
<ISO_3166-1_Entry>
<ISO_3166-1_Country_name>MAURITANIA</ISO_3166-1_Country_name>
<ISO_3166-1_Alpha-2_Code_element>MR</ISO_3166-1_Alpha-2_Code_element>
</ISO_3166-1_Entry>
<ISO_3166-1_Entry>
<ISO_3166-1_Country_name>MAURITIUS</ISO_3166-1_Country_name>
<ISO_3166-1_Alpha-2_Code_element>MU</ISO_3166-1_Alpha-2_Code_element>
</ISO_3166-1_Entry>
<ISO_3166-1_Entry>
<ISO_3166-1_Country_name>MAYOTTE</ISO_3166-1_Country_name>
<ISO_3166-1_Alpha-2_Code_element>YT</ISO_3166-1_Alpha-2_Code_element>
</ISO_3166-1_Entry>
<ISO_3166-1_Entry>
<ISO_3166-1_Country_name>MEXICO</ISO_3166-1_Country_name>
<ISO_3166-1_Alpha-2_Code_element>MX</ISO_3166-1_Alpha-2_Code_element>
</ISO_3166-1_Entry>
<ISO_3166-1_Entry>
<ISO_3166-1_Country_name>MICRONESIA, FEDERATED STATES OF</ISO_3166-1_Country_name>
<ISO_3166-1_Alpha-2_Code_element>FM</ISO_3166-1_Alpha-2_Code_element>
</ISO_3166-1_Entry>
<ISO_3166-1_Entry>
<ISO_3166-1_Country_name>MOLDOVA, REPUBLIC OF</ISO_3166-1_Country_name>
<ISO_3166-1_Alpha-2_Code_element>MD</ISO_3166-1_Alpha-2_Code_element>
</ISO_3166-1_Entry>
<ISO_3166-1_Entry>
<ISO_3166-1_Country_name>MONACO</ISO_3166-1_Country_name>
<ISO_3166-1_Alpha-2_Code_element>MC</ISO_3166-1_Alpha-2_Code_element>
</ISO_3166-1_Entry>
<ISO_3166-1_Entry>
<ISO_3166-1_Country_name>MONGOLIA</ISO_3166-1_Country_name>
<ISO_3166-1_Alpha-2_Code_element>MN</ISO_3166-1_Alpha-2_Code_element>
</ISO_3166-1_Entry>
<ISO_3166-1_Entry>
<ISO_3166-1_Country_name>MONTENEGRO</ISO_3166-1_Country_name>
<ISO_3166-1_Alpha-2_Code_element>ME</ISO_3166-1_Alpha-2_Code_element>
</ISO_3166-1_Entry>
<ISO_3166-1_Entry>
<ISO_3166-1_Country_name>MONTSERRAT</ISO_3166-1_Country_name>
<ISO_3166-1_Alpha-2_Code_element>MS</ISO_3166-1_Alpha-2_Code_element>
</ISO_3166-1_Entry>
<ISO_3166-1_Entry>
<ISO_3166-1_Country_name>MOROCCO</ISO_3166-1_Country_name>
<ISO_3166-1_Alpha-2_Code_element>MA</ISO_3166-1_Alpha-2_Code_element>
</ISO_3166-1_Entry>
<ISO_3166-1_Entry>
<ISO_3166-1_Country_name>MOZAMBIQUE</ISO_3166-1_Country_name>
<ISO_3166-1_Alpha-2_Code_element>MZ</ISO_3166-1_Alpha-2_Code_element>
</ISO_3166-1_Entry>
<ISO_3166-1_Entry>
<ISO_3166-1_Country_name>MYANMAR</ISO_3166-1_Country_name>
<ISO_3166-1_Alpha-2_Code_element>MM</ISO_3166-1_Alpha-2_Code_element>
</ISO_3166-1_Entry>
<ISO_3166-1_Entry>
<ISO_3166-1_Country_name>NAMIBIA</ISO_3166-1_Country_name>
<ISO_3166-1_Alpha-2_Code_element>NA</ISO_3166-1_Alpha-2_Code_element>
</ISO_3166-1_Entry>
<ISO_3166-1_Entry>
<ISO_3166-1_Country_name>NAURU</ISO_3166-1_Country_name>
<ISO_3166-1_Alpha-2_Code_element>NR</ISO_3166-1_Alpha-2_Code_element>
</ISO_3166-1_Entry>
<ISO_3166-1_Entry>
<ISO_3166-1_Country_name>NEPAL</ISO_3166-1_Country_name>
<ISO_3166-1_Alpha-2_Code_element>NP</ISO_3166-1_Alpha-2_Code_element>
</ISO_3166-1_Entry>
<ISO_3166-1_Entry>
<ISO_3166-1_Country_name>NETHERLANDS</ISO_3166-1_Country_name>
<ISO_3166-1_Alpha-2_Code_element>NL</ISO_3166-1_Alpha-2_Code_element>
</ISO_3166-1_Entry>
<ISO_3166-1_Entry>
<ISO_3166-1_Country_name>NETHERLANDS ANTILLES</ISO_3166-1_Country_name>
<ISO_3166-1_Alpha-2_Code_element>AN</ISO_3166-1_Alpha-2_Code_element>
</ISO_3166-1_Entry>
<ISO_3166-1_Entry>
<ISO_3166-1_Country_name>NEW CALEDONIA</ISO_3166-1_Country_name>
<ISO_3166-1_Alpha-2_Code_element>NC</ISO_3166-1_Alpha-2_Code_element>
</ISO_3166-1_Entry>
<ISO_3166-1_Entry>
<ISO_3166-1_Country_name>NEW ZEALAND</ISO_3166-1_Country_name>
<ISO_3166-1_Alpha-2_Code_element>NZ</ISO_3166-1_Alpha-2_Code_element>
</ISO_3166-1_Entry>
<ISO_3166-1_Entry>
<ISO_3166-1_Country_name>NICARAGUA</ISO_3166-1_Country_name>
<ISO_3166-1_Alpha-2_Code_element>NI</ISO_3166-1_Alpha-2_Code_element>
</ISO_3166-1_Entry>
<ISO_3166-1_Entry>
<ISO_3166-1_Country_name>NIGER</ISO_3166-1_Country_name>
<ISO_3166-1_Alpha-2_Code_element>NE</ISO_3166-1_Alpha-2_Code_element>
</ISO_3166-1_Entry>
<ISO_3166-1_Entry>
<ISO_3166-1_Country_name>NIGERIA</ISO_3166-1_Country_name>
<ISO_3166-1_Alpha-2_Code_element>NG</ISO_3166-1_Alpha-2_Code_element>
</ISO_3166-1_Entry>
<ISO_3166-1_Entry>
<ISO_3166-1_Country_name>NIUE</ISO_3166-1_Country_name>
<ISO_3166-1_Alpha-2_Code_element>NU</ISO_3166-1_Alpha-2_Code_element>
</ISO_3166-1_Entry>
<ISO_3166-1_Entry>
<ISO_3166-1_Country_name>NORFOLK ISLAND</ISO_3166-1_Country_name>
<ISO_3166-1_Alpha-2_Code_element>NF</ISO_3166-1_Alpha-2_Code_element>
</ISO_3166-1_Entry>
<ISO_3166-1_Entry>
<ISO_3166-1_Country_name>NORTHERN MARIANA ISLANDS</ISO_3166-1_Country_name>
<ISO_3166-1_Alpha-2_Code_element>MP</ISO_3166-1_Alpha-2_Code_element>
</ISO_3166-1_Entry>
<ISO_3166-1_Entry>
<ISO_3166-1_Country_name>NORWAY</ISO_3166-1_Country_name>
<ISO_3166-1_Alpha-2_Code_element>NO</ISO_3166-1_Alpha-2_Code_element>
</ISO_3166-1_Entry>
<ISO_3166-1_Entry>
<ISO_3166-1_Country_name>OMAN</ISO_3166-1_Country_name>
<ISO_3166-1_Alpha-2_Code_element>OM</ISO_3166-1_Alpha-2_Code_element>
</ISO_3166-1_Entry>
<ISO_3166-1_Entry>
<ISO_3166-1_Country_name>PAKISTAN</ISO_3166-1_Country_name>
<ISO_3166-1_Alpha-2_Code_element>PK</ISO_3166-1_Alpha-2_Code_element>
</ISO_3166-1_Entry>
<ISO_3166-1_Entry>
<ISO_3166-1_Country_name>PALAU</ISO_3166-1_Country_name>
<ISO_3166-1_Alpha-2_Code_element>PW</ISO_3166-1_Alpha-2_Code_element>
</ISO_3166-1_Entry>
<ISO_3166-1_Entry>
<ISO_3166-1_Country_name>PALESTINIAN TERRITORY, OCCUPIED</ISO_3166-1_Country_name>
<ISO_3166-1_Alpha-2_Code_element>PS</ISO_3166-1_Alpha-2_Code_element>
</ISO_3166-1_Entry>
<ISO_3166-1_Entry>
<ISO_3166-1_Country_name>PANAMA</ISO_3166-1_Country_name>
<ISO_3166-1_Alpha-2_Code_element>PA</ISO_3166-1_Alpha-2_Code_element>
</ISO_3166-1_Entry>
<ISO_3166-1_Entry>
<ISO_3166-1_Country_name>PAPUA NEW GUINEA</ISO_3166-1_Country_name>
<ISO_3166-1_Alpha-2_Code_element>PG</ISO_3166-1_Alpha-2_Code_element>
</ISO_3166-1_Entry>
<ISO_3166-1_Entry>
<ISO_3166-1_Country_name>PARAGUAY</ISO_3166-1_Country_name>
<ISO_3166-1_Alpha-2_Code_element>PY</ISO_3166-1_Alpha-2_Code_element>
</ISO_3166-1_Entry>
<ISO_3166-1_Entry>
<ISO_3166-1_Country_name>PERU</ISO_3166-1_Country_name>
<ISO_3166-1_Alpha-2_Code_element>PE</ISO_3166-1_Alpha-2_Code_element>
</ISO_3166-1_Entry>
<ISO_3166-1_Entry>
<ISO_3166-1_Country_name>PHILIPPINES</ISO_3166-1_Country_name>
<ISO_3166-1_Alpha-2_Code_element>PH</ISO_3166-1_Alpha-2_Code_element>
</ISO_3166-1_Entry>
<ISO_3166-1_Entry>
<ISO_3166-1_Country_name>PITCAIRN</ISO_3166-1_Country_name>
<ISO_3166-1_Alpha-2_Code_element>PN</ISO_3166-1_Alpha-2_Code_element>
</ISO_3166-1_Entry>
<ISO_3166-1_Entry>
<ISO_3166-1_Country_name>POLAND</ISO_3166-1_Country_name>
<ISO_3166-1_Alpha-2_Code_element>PL</ISO_3166-1_Alpha-2_Code_element>
</ISO_3166-1_Entry>
<ISO_3166-1_Entry>
<ISO_3166-1_Country_name>PORTUGAL</ISO_3166-1_Country_name>
<ISO_3166-1_Alpha-2_Code_element>PT</ISO_3166-1_Alpha-2_Code_element>
</ISO_3166-1_Entry>
<ISO_3166-1_Entry>
<ISO_3166-1_Country_name>PUERTO RICO</ISO_3166-1_Country_name>
<ISO_3166-1_Alpha-2_Code_element>PR</ISO_3166-1_Alpha-2_Code_element>
</ISO_3166-1_Entry>
<ISO_3166-1_Entry>
<ISO_3166-1_Country_name>QATAR</ISO_3166-1_Country_name>
<ISO_3166-1_Alpha-2_Code_element>QA</ISO_3166-1_Alpha-2_Code_element>
</ISO_3166-1_Entry>
<ISO_3166-1_Entry>
<ISO_3166-1_Country_name>REUNION</ISO_3166-1_Country_name>
<ISO_3166-1_Alpha-2_Code_element>RE</ISO_3166-1_Alpha-2_Code_element>
</ISO_3166-1_Entry>
<ISO_3166-1_Entry>
<ISO_3166-1_Country_name>ROMANIA</ISO_3166-1_Country_name>
<ISO_3166-1_Alpha-2_Code_element>RO</ISO_3166-1_Alpha-2_Code_element>
</ISO_3166-1_Entry>
<ISO_3166-1_Entry>
<ISO_3166-1_Country_name>RUSSIAN FEDERATION</ISO_3166-1_Country_name>
<ISO_3166-1_Alpha-2_Code_element>RU</ISO_3166-1_Alpha-2_Code_element>
</ISO_3166-1_Entry>
<ISO_3166-1_Entry>
<ISO_3166-1_Country_name>RWANDA</ISO_3166-1_Country_name>
<ISO_3166-1_Alpha-2_Code_element>RW</ISO_3166-1_Alpha-2_Code_element>
</ISO_3166-1_Entry>
<ISO_3166-1_Entry>
<ISO_3166-1_Country_name>SAINT BARTHÉLEMY</ISO_3166-1_Country_name>
<ISO_3166-1_Alpha-2_Code_element>BL</ISO_3166-1_Alpha-2_Code_element>
</ISO_3166-1_Entry>
<ISO_3166-1_Entry>
<ISO_3166-1_Country_name>SAINT HELENA, ASCENSION AND TRISTAN DA CUNHA</ISO_3166-1_Country_name>
<ISO_3166-1_Alpha-2_Code_element>SH</ISO_3166-1_Alpha-2_Code_element>
</ISO_3166-1_Entry>
<ISO_3166-1_Entry>
<ISO_3166-1_Country_name>SAINT KITTS AND NEVIS</ISO_3166-1_Country_name>
<ISO_3166-1_Alpha-2_Code_element>KN</ISO_3166-1_Alpha-2_Code_element>
</ISO_3166-1_Entry>
<ISO_3166-1_Entry>
<ISO_3166-1_Country_name>SAINT LUCIA</ISO_3166-1_Country_name>
<ISO_3166-1_Alpha-2_Code_element>LC</ISO_3166-1_Alpha-2_Code_element>
</ISO_3166-1_Entry>
<ISO_3166-1_Entry>
<ISO_3166-1_Country_name>SAINT MARTIN</ISO_3166-1_Country_name>
<ISO_3166-1_Alpha-2_Code_element>MF</ISO_3166-1_Alpha-2_Code_element>
</ISO_3166-1_Entry>
<ISO_3166-1_Entry>
<ISO_3166-1_Country_name>SAINT PIERRE AND MIQUELON</ISO_3166-1_Country_name>
<ISO_3166-1_Alpha-2_Code_element>PM</ISO_3166-1_Alpha-2_Code_element>
</ISO_3166-1_Entry>
<ISO_3166-1_Entry>
<ISO_3166-1_Country_name>SAINT VINCENT AND THE GRENADINES</ISO_3166-1_Country_name>
<ISO_3166-1_Alpha-2_Code_element>VC</ISO_3166-1_Alpha-2_Code_element>
</ISO_3166-1_Entry>
<ISO_3166-1_Entry>
<ISO_3166-1_Country_name>SAMOA</ISO_3166-1_Country_name>
<ISO_3166-1_Alpha-2_Code_element>WS</ISO_3166-1_Alpha-2_Code_element>
</ISO_3166-1_Entry>
<ISO_3166-1_Entry>
<ISO_3166-1_Country_name>SAN MARINO</ISO_3166-1_Country_name>
<ISO_3166-1_Alpha-2_Code_element>SM</ISO_3166-1_Alpha-2_Code_element>
</ISO_3166-1_Entry>
<ISO_3166-1_Entry>
<ISO_3166-1_Country_name>SAO TOME AND PRINCIPE</ISO_3166-1_Country_name>
<ISO_3166-1_Alpha-2_Code_element>ST</ISO_3166-1_Alpha-2_Code_element>
</ISO_3166-1_Entry>
<ISO_3166-1_Entry>
<ISO_3166-1_Country_name>SAUDI ARABIA</ISO_3166-1_Country_name>
<ISO_3166-1_Alpha-2_Code_element>SA</ISO_3166-1_Alpha-2_Code_element>
</ISO_3166-1_Entry>
<ISO_3166-1_Entry>
<ISO_3166-1_Country_name>SENEGAL</ISO_3166-1_Country_name>
<ISO_3166-1_Alpha-2_Code_element>SN</ISO_3166-1_Alpha-2_Code_element>
</ISO_3166-1_Entry>
<ISO_3166-1_Entry>
<ISO_3166-1_Country_name>SERBIA</ISO_3166-1_Country_name>
<ISO_3166-1_Alpha-2_Code_element>RS</ISO_3166-1_Alpha-2_Code_element>
</ISO_3166-1_Entry>
<ISO_3166-1_Entry>
<ISO_3166-1_Country_name>SEYCHELLES</ISO_3166-1_Country_name>
<ISO_3166-1_Alpha-2_Code_element>SC</ISO_3166-1_Alpha-2_Code_element>
</ISO_3166-1_Entry>
<ISO_3166-1_Entry>
<ISO_3166-1_Country_name>SIERRA LEONE</ISO_3166-1_Country_name>
<ISO_3166-1_Alpha-2_Code_element>SL</ISO_3166-1_Alpha-2_Code_element>
</ISO_3166-1_Entry>
<ISO_3166-1_Entry>
<ISO_3166-1_Country_name>SINGAPORE</ISO_3166-1_Country_name>
<ISO_3166-1_Alpha-2_Code_element>SG</ISO_3166-1_Alpha-2_Code_element>
</ISO_3166-1_Entry>
<ISO_3166-1_Entry>
<ISO_3166-1_Country_name>SLOVAKIA</ISO_3166-1_Country_name>
<ISO_3166-1_Alpha-2_Code_element>SK</ISO_3166-1_Alpha-2_Code_element>
</ISO_3166-1_Entry>
<ISO_3166-1_Entry>
<ISO_3166-1_Country_name>SLOVENIA</ISO_3166-1_Country_name>
<ISO_3166-1_Alpha-2_Code_element>SI</ISO_3166-1_Alpha-2_Code_element>
</ISO_3166-1_Entry>
<ISO_3166-1_Entry>
<ISO_3166-1_Country_name>SOLOMON ISLANDS</ISO_3166-1_Country_name>
<ISO_3166-1_Alpha-2_Code_element>SB</ISO_3166-1_Alpha-2_Code_element>
</ISO_3166-1_Entry>
<ISO_3166-1_Entry>
<ISO_3166-1_Country_name>SOMALIA</ISO_3166-1_Country_name>
<ISO_3166-1_Alpha-2_Code_element>SO</ISO_3166-1_Alpha-2_Code_element>
</ISO_3166-1_Entry>
<ISO_3166-1_Entry>
<ISO_3166-1_Country_name>SOUTH AFRICA</ISO_3166-1_Country_name>
<ISO_3166-1_Alpha-2_Code_element>ZA</ISO_3166-1_Alpha-2_Code_element>
</ISO_3166-1_Entry>
<ISO_3166-1_Entry>
<ISO_3166-1_Country_name>SOUTH GEORGIA AND THE SOUTH SANDWICH ISLANDS</ISO_3166-1_Country_name>
<ISO_3166-1_Alpha-2_Code_element>GS</ISO_3166-1_Alpha-2_Code_element>
</ISO_3166-1_Entry>
<ISO_3166-1_Entry>
<ISO_3166-1_Country_name>SPAIN</ISO_3166-1_Country_name>
<ISO_3166-1_Alpha-2_Code_element>ES</ISO_3166-1_Alpha-2_Code_element>
</ISO_3166-1_Entry>
<ISO_3166-1_Entry>
<ISO_3166-1_Country_name>SRI LANKA</ISO_3166-1_Country_name>
<ISO_3166-1_Alpha-2_Code_element>LK</ISO_3166-1_Alpha-2_Code_element>
</ISO_3166-1_Entry>
<ISO_3166-1_Entry>
<ISO_3166-1_Country_name>SUDAN</ISO_3166-1_Country_name>
<ISO_3166-1_Alpha-2_Code_element>SD</ISO_3166-1_Alpha-2_Code_element>
</ISO_3166-1_Entry>
<ISO_3166-1_Entry>
<ISO_3166-1_Country_name>SURINAME</ISO_3166-1_Country_name>
<ISO_3166-1_Alpha-2_Code_element>SR</ISO_3166-1_Alpha-2_Code_element>
</ISO_3166-1_Entry>
<ISO_3166-1_Entry>
<ISO_3166-1_Country_name>SVALBARD AND JAN MAYEN</ISO_3166-1_Country_name>
<ISO_3166-1_Alpha-2_Code_element>SJ</ISO_3166-1_Alpha-2_Code_element>
</ISO_3166-1_Entry>
<ISO_3166-1_Entry>
<ISO_3166-1_Country_name>SWAZILAND</ISO_3166-1_Country_name>
<ISO_3166-1_Alpha-2_Code_element>SZ</ISO_3166-1_Alpha-2_Code_element>
</ISO_3166-1_Entry>
<ISO_3166-1_Entry>
<ISO_3166-1_Country_name>SWEDEN</ISO_3166-1_Country_name>
<ISO_3166-1_Alpha-2_Code_element>SE</ISO_3166-1_Alpha-2_Code_element>
</ISO_3166-1_Entry>
<ISO_3166-1_Entry>
<ISO_3166-1_Country_name>SWITZERLAND</ISO_3166-1_Country_name>
<ISO_3166-1_Alpha-2_Code_element>CH</ISO_3166-1_Alpha-2_Code_element>
</ISO_3166-1_Entry>
<ISO_3166-1_Entry>
<ISO_3166-1_Country_name>SYRIAN ARAB REPUBLIC</ISO_3166-1_Country_name>
<ISO_3166-1_Alpha-2_Code_element>SY</ISO_3166-1_Alpha-2_Code_element>
</ISO_3166-1_Entry>
<ISO_3166-1_Entry>
<ISO_3166-1_Country_name>TAIWAN, PROVINCE OF CHINA</ISO_3166-1_Country_name>
<ISO_3166-1_Alpha-2_Code_element>TW</ISO_3166-1_Alpha-2_Code_element>
</ISO_3166-1_Entry>
<ISO_3166-1_Entry>
<ISO_3166-1_Country_name>TAJIKISTAN</ISO_3166-1_Country_name>
<ISO_3166-1_Alpha-2_Code_element>TJ</ISO_3166-1_Alpha-2_Code_element>
</ISO_3166-1_Entry>
<ISO_3166-1_Entry>
<ISO_3166-1_Country_name>TANZANIA, UNITED REPUBLIC OF</ISO_3166-1_Country_name>
<ISO_3166-1_Alpha-2_Code_element>TZ</ISO_3166-1_Alpha-2_Code_element>
</ISO_3166-1_Entry>
<ISO_3166-1_Entry>
<ISO_3166-1_Country_name>THAILAND</ISO_3166-1_Country_name>
<ISO_3166-1_Alpha-2_Code_element>TH</ISO_3166-1_Alpha-2_Code_element>
</ISO_3166-1_Entry>
<ISO_3166-1_Entry>
<ISO_3166-1_Country_name>TIMOR-LESTE</ISO_3166-1_Country_name>
<ISO_3166-1_Alpha-2_Code_element>TL</ISO_3166-1_Alpha-2_Code_element>
</ISO_3166-1_Entry>
<ISO_3166-1_Entry>
<ISO_3166-1_Country_name>TOGO</ISO_3166-1_Country_name>
<ISO_3166-1_Alpha-2_Code_element>TG</ISO_3166-1_Alpha-2_Code_element>
</ISO_3166-1_Entry>
<ISO_3166-1_Entry>
<ISO_3166-1_Country_name>TOKELAU</ISO_3166-1_Country_name>
<ISO_3166-1_Alpha-2_Code_element>TK</ISO_3166-1_Alpha-2_Code_element>
</ISO_3166-1_Entry>
<ISO_3166-1_Entry>
<ISO_3166-1_Country_name>TONGA</ISO_3166-1_Country_name>
<ISO_3166-1_Alpha-2_Code_element>TO</ISO_3166-1_Alpha-2_Code_element>
</ISO_3166-1_Entry>
<ISO_3166-1_Entry>
<ISO_3166-1_Country_name>TRINIDAD AND TOBAGO</ISO_3166-1_Country_name>
<ISO_3166-1_Alpha-2_Code_element>TT</ISO_3166-1_Alpha-2_Code_element>
</ISO_3166-1_Entry>
<ISO_3166-1_Entry>
<ISO_3166-1_Country_name>TUNISIA</ISO_3166-1_Country_name>
<ISO_3166-1_Alpha-2_Code_element>TN</ISO_3166-1_Alpha-2_Code_element>
</ISO_3166-1_Entry>
<ISO_3166-1_Entry>
<ISO_3166-1_Country_name>TURKEY</ISO_3166-1_Country_name>
<ISO_3166-1_Alpha-2_Code_element>TR</ISO_3166-1_Alpha-2_Code_element>
</ISO_3166-1_Entry>
<ISO_3166-1_Entry>
<ISO_3166-1_Country_name>TURKMENISTAN</ISO_3166-1_Country_name>
<ISO_3166-1_Alpha-2_Code_element>TM</ISO_3166-1_Alpha-2_Code_element>
</ISO_3166-1_Entry>
<ISO_3166-1_Entry>
<ISO_3166-1_Country_name>TURKS AND CAICOS ISLANDS</ISO_3166-1_Country_name>
<ISO_3166-1_Alpha-2_Code_element>TC</ISO_3166-1_Alpha-2_Code_element>
</ISO_3166-1_Entry>
<ISO_3166-1_Entry>
<ISO_3166-1_Country_name>TUVALU</ISO_3166-1_Country_name>
<ISO_3166-1_Alpha-2_Code_element>TV</ISO_3166-1_Alpha-2_Code_element>
</ISO_3166-1_Entry>
<ISO_3166-1_Entry>
<ISO_3166-1_Country_name>UGANDA</ISO_3166-1_Country_name>
<ISO_3166-1_Alpha-2_Code_element>UG</ISO_3166-1_Alpha-2_Code_element>
</ISO_3166-1_Entry>
<ISO_3166-1_Entry>
<ISO_3166-1_Country_name>UKRAINE</ISO_3166-1_Country_name>
<ISO_3166-1_Alpha-2_Code_element>UA</ISO_3166-1_Alpha-2_Code_element>
</ISO_3166-1_Entry>
<ISO_3166-1_Entry>
<ISO_3166-1_Country_name>UNITED ARAB EMIRATES</ISO_3166-1_Country_name>
<ISO_3166-1_Alpha-2_Code_element>AE</ISO_3166-1_Alpha-2_Code_element>
</ISO_3166-1_Entry>
<ISO_3166-1_Entry>
<ISO_3166-1_Country_name>UNITED KINGDOM</ISO_3166-1_Country_name>
<ISO_3166-1_Alpha-2_Code_element>GB</ISO_3166-1_Alpha-2_Code_element>
</ISO_3166-1_Entry>
<ISO_3166-1_Entry>
<ISO_3166-1_Country_name>UNITED STATES</ISO_3166-1_Country_name>
<ISO_3166-1_Alpha-2_Code_element>US</ISO_3166-1_Alpha-2_Code_element>
</ISO_3166-1_Entry>
<ISO_3166-1_Entry>
<ISO_3166-1_Country_name>UNITED STATES MINOR OUTLYING ISLANDS</ISO_3166-1_Country_name>
<ISO_3166-1_Alpha-2_Code_element>UM</ISO_3166-1_Alpha-2_Code_element>
</ISO_3166-1_Entry>
<ISO_3166-1_Entry>
<ISO_3166-1_Country_name>URUGUAY</ISO_3166-1_Country_name>
<ISO_3166-1_Alpha-2_Code_element>UY</ISO_3166-1_Alpha-2_Code_element>
</ISO_3166-1_Entry>
<ISO_3166-1_Entry>
<ISO_3166-1_Country_name>UZBEKISTAN</ISO_3166-1_Country_name>
<ISO_3166-1_Alpha-2_Code_element>UZ</ISO_3166-1_Alpha-2_Code_element>
</ISO_3166-1_Entry>
<ISO_3166-1_Entry>
<ISO_3166-1_Country_name>VANUATU</ISO_3166-1_Country_name>
<ISO_3166-1_Alpha-2_Code_element>VU</ISO_3166-1_Alpha-2_Code_element>
</ISO_3166-1_Entry>
<ISO_3166-1_Entry>
<ISO_3166-1_Country_name>VENEZUELA, BOLIVARIAN REPUBLIC OF</ISO_3166-1_Country_name>
<ISO_3166-1_Alpha-2_Code_element>VE</ISO_3166-1_Alpha-2_Code_element>
</ISO_3166-1_Entry>
<ISO_3166-1_Entry>
<ISO_3166-1_Country_name>VIET NAM</ISO_3166-1_Country_name>
<ISO_3166-1_Alpha-2_Code_element>VN</ISO_3166-1_Alpha-2_Code_element>
</ISO_3166-1_Entry>
<ISO_3166-1_Entry>
<ISO_3166-1_Country_name>VIRGIN ISLANDS, BRITISH</ISO_3166-1_Country_name>
<ISO_3166-1_Alpha-2_Code_element>VG</ISO_3166-1_Alpha-2_Code_element>
</ISO_3166-1_Entry>
<ISO_3166-1_Entry>
<ISO_3166-1_Country_name>VIRGIN ISLANDS, U.S.</ISO_3166-1_Country_name>
<ISO_3166-1_Alpha-2_Code_element>VI</ISO_3166-1_Alpha-2_Code_element>
</ISO_3166-1_Entry>
<ISO_3166-1_Entry>
<ISO_3166-1_Country_name>WALLIS AND FUTUNA</ISO_3166-1_Country_name>
<ISO_3166-1_Alpha-2_Code_element>WF</ISO_3166-1_Alpha-2_Code_element>
</ISO_3166-1_Entry>
<ISO_3166-1_Entry>
<ISO_3166-1_Country_name>WESTERN SAHARA</ISO_3166-1_Country_name>
<ISO_3166-1_Alpha-2_Code_element>EH</ISO_3166-1_Alpha-2_Code_element>
</ISO_3166-1_Entry>
<ISO_3166-1_Entry>
<ISO_3166-1_Country_name>YEMEN</ISO_3166-1_Country_name>
<ISO_3166-1_Alpha-2_Code_element>YE</ISO_3166-1_Alpha-2_Code_element>
</ISO_3166-1_Entry>
<ISO_3166-1_Entry>
<ISO_3166-1_Country_name>ZAMBIA</ISO_3166-1_Country_name>
<ISO_3166-1_Alpha-2_Code_element>ZM</ISO_3166-1_Alpha-2_Code_element>
</ISO_3166-1_Entry>
<ISO_3166-1_Entry>
<ISO_3166-1_Country_name>ZIMBABWE</ISO_3166-1_Country_name>
<ISO_3166-1_Alpha-2_Code_element>ZW</ISO_3166-1_Alpha-2_Code_element>
</ISO_3166-1_Entry>
</ISO_3166-1_List_en>

File diff suppressed because it is too large Load Diff

View File

@ -79,6 +79,7 @@ include("head.inc");
$tab_array[] = array("DHCP", false, "diag_logs_dhcp.php");
$tab_array[] = array("Portal Auth", false, "diag_logs_auth.php");
$tab_array[] = array("IPsec", false, "diag_logs_ipsec.php");
$tab_array[] = array("PPP", false, "diag_logs_ppp.php");
$tab_array[] = array("VPN", false, "diag_logs_vpn.php");
$tab_array[] = array("Load Balancer", false, "diag_logs_relayd.php");
$tab_array[] = array("OpenVPN", false, "diag_logs_openvpn.php");

View File

@ -67,6 +67,7 @@ include("head.inc");
$tab_array[] = array("DHCP", false, "diag_logs_dhcp.php");
$tab_array[] = array("Portal Auth", true, "diag_logs_auth.php");
$tab_array[] = array("IPsec", false, "diag_logs_ipsec.php");
$tab_array[] = array("PPP", false, "diag_logs_ppp.php");
$tab_array[] = array("VPN", false, "diag_logs_vpn.php");
$tab_array[] = array("Load Balancer", false, "diag_logs_relayd.php");
$tab_array[] = array("OpenVPN", false, "diag_logs_openvpn.php");

View File

@ -69,6 +69,7 @@ include("head.inc");
$tab_array[] = array("DHCP", true, "diag_logs_dhcp.php");
$tab_array[] = array("Portal Auth", false, "diag_logs_auth.php");
$tab_array[] = array("IPsec", false, "diag_logs_ipsec.php");
$tab_array[] = array("PPP", false, "diag_logs_ppp.php");
$tab_array[] = array("VPN", false, "diag_logs_vpn.php");
$tab_array[] = array("Load Balancer", false, "diag_logs_relayd.php");
$tab_array[] = array("OpenVPN", false, "diag_logs_openvpn.php");

View File

@ -103,6 +103,7 @@ include("head.inc");
$tab_array[] = array("DHCP", false, "diag_logs_dhcp.php");
$tab_array[] = array("Portal Auth", false, "diag_logs_auth.php");
$tab_array[] = array("IPsec", false, "diag_logs_ipsec.php");
$tab_array[] = array("PPP", false, "diag_logs_ppp.php");
$tab_array[] = array("VPN", false, "diag_logs_vpn.php");
$tab_array[] = array("Load Balancer", false, "diag_logs_relayd.php");
$tab_array[] = array("OpenVPN", false, "diag_logs_openvpn.php");

View File

@ -102,6 +102,7 @@ include("head.inc");
$tab_array[] = array("DHCP", false, "diag_logs_dhcp.php");
$tab_array[] = array("Portal Auth", false, "diag_logs_auth.php");
$tab_array[] = array("IPsec", false, "diag_logs_ipsec.php");
$tab_array[] = array("PPP", false, "diag_logs_ppp.php");
$tab_array[] = array("VPN", false, "diag_logs_vpn.php");
$tab_array[] = array("Load Balancer", false, "diag_logs_relayd.php");
$tab_array[] = array("OpenVPN", false, "diag_logs_openvpn.php");

View File

@ -186,6 +186,7 @@ include("head.inc"); ?>
$tab_array[] = array("DHCP", false, "diag_logs_dhcp.php");
$tab_array[] = array("Portal Auth", false, "diag_logs_auth.php");
$tab_array[] = array("IPsec", false, "diag_logs_ipsec.php");
$tab_array[] = array("PPP", false, "diag_logs_ppp.php");
$tab_array[] = array("VPN", false, "diag_logs_vpn.php");
$tab_array[] = array("Load Balancer", false, "diag_logs_relayd.php");
$tab_array[] = array("OpenVPN", false, "diag_logs_openvpn.php");

View File

@ -89,6 +89,7 @@ include("head.inc");
$tab_array[] = array("DHCP", false, "diag_logs_dhcp.php");
$tab_array[] = array("Portal Auth", false, "diag_logs_auth.php");
$tab_array[] = array("IPsec", true, "diag_logs_ipsec.php");
$tab_array[] = array("PPP", false, "diag_logs_ppp.php");
$tab_array[] = array("VPN", false, "diag_logs_vpn.php");
$tab_array[] = array("Load Balancer", false, "diag_logs_relayd.php");
$tab_array[] = array("OpenVPN", false, "diag_logs_openvpn.php");

View File

@ -67,6 +67,7 @@ include("head.inc");
$tab_array[] = array("DHCP", false, "diag_logs_dhcp.php");
$tab_array[] = array("Portal Auth", false, "diag_logs_auth.php");
$tab_array[] = array("IPsec", false, "diag_logs_ipsec.php");
$tab_array[] = array("PPP", false, "diag_logs_ppp.php");
$tab_array[] = array("VPN", false, "diag_logs_vpn.php");
$tab_array[] = array("Load Balancer", false, "diag_logs_relayd.php");
$tab_array[] = array("OpenVPN", false, "diag_logs_openvpn.php");

View File

@ -71,6 +71,7 @@ include("head.inc");
$tab_array[] = array("DHCP", false, "diag_logs_dhcp.php");
$tab_array[] = array("Portal Auth", false, "diag_logs_auth.php");
$tab_array[] = array("IPsec", false, "diag_logs_ipsec.php");
$tab_array[] = array("PPP", false, "diag_logs_ppp.php");
$tab_array[] = array("VPN", false, "diag_logs_vpn.php");
$tab_array[] = array("Load Balancer", false, "diag_logs_relayd.php");
$tab_array[] = array("OpenVPN", true, "diag_logs_openvpn.php");

124
usr/local/www/diag_logs_ppp.php Executable file
View File

@ -0,0 +1,124 @@
<?php
/* $Id$ */
/*
diag_logs.php
Copyright (C) 2004-2009 Scott Ullrich
All rights reserved.
originally part of m0n0wall (http://m0n0.ch/wall)
Copyright (C) 2003-2004 Manuel Kasper <mk@neon1.net>.
All rights reserved.
Redistribution and use in source and binary forms, with or without
modification, are permitted provided that the following conditions are met:
1. Redistributions of source code must retain the above copyright notice,
this list of conditions and the following disclaimer.
2. Redistributions in binary form must reproduce the above copyright
notice, this list of conditions and the following disclaimer in the
documentation and/or other materials provided with the distribution.
THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES,
INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY
AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY,
OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
POSSIBILITY OF SUCH DAMAGE.
*/
/*
pfSense_BUILDER_BINARIES: /sbin/ifconfig /usr/bin/awk
pfSense_MODULE:
*/
##|+PRIV
##|*IDENT=page-status-systemlogs-ppp
##|*NAME=Status: System logs: IPsec VPN page
##|*DESCR=Allow access to the 'Status: System logs: IPsec VPN' page.
##|*MATCH=diag_logs_ppp.php*
##|-PRIV
require("guiconfig.inc");
$ppp_logfile = "{$g['varlog_path']}/ppp.log";
$nentries = $config['syslog']['nentries'];
if (!$nentries)
$nentries = 50;
if ($_POST['clear'])
clear_log_file($ppp_logfile);
$ppp_logarr = return_clog($ppp_logfile, $nentries);
$pgtitle = array("Status","System logs","PPP");
include("head.inc");
?>
<body link="#0000CC" vlink="#0000CC" alink="#0000CC">
<?php include("fbegin.inc"); ?>
<table width="100%" border="0" cellpadding="0" cellspacing="0">
<tr>
<td>
<?php
$tab_array = array();
$tab_array[] = array("System", false, "diag_logs.php");
$tab_array[] = array("Firewall", false, "diag_logs_filter.php");
$tab_array[] = array("DHCP", false, "diag_logs_dhcp.php");
$tab_array[] = array("Portal Auth", false, "diag_logs_auth.php");
$tab_array[] = array("IPsec", false, "diag_logs_ipsec.php");
$tab_array[] = array("PPP", true, "diag_logs_ppp.php");
$tab_array[] = array("VPN", false, "diag_logs_vpn.php");
$tab_array[] = array("Load Balancer", false, "diag_logs_relayd.php");
$tab_array[] = array("OpenVPN", false, "diag_logs_openvpn.php");
$tab_array[] = array("OpenNTPD", false, "diag_logs_ntpd.php");
$tab_array[] = array("Settings", false, "diag_logs_settings.php");
display_top_tabs($tab_array);
?>
</td>
</tr>
<tr>
<td>
<div id="mainarea">
<table class="tabcont" width="100%" border="0" cellspacing="0" cellpadding="0">
<tr>
<td colspan="2" class="listtopic">Last <?=$nentries;?> PPP log entries</td>
</tr>
<?php
foreach($ppp_logarr as $logent){
if(isset($match)) {
$logent = preg_replace($search, $replace, $logent);
} else {
$searchs = "/(racoon: )([A-Z:].*?)([0-9].+\.[0-9].+.[0-9].+.[0-9].+\[[0-9].+\])(.*)/i";
$replaces = "$1<strong><font color=red>[Unknown Gateway/Dynamic]</font></strong>: $2$3$4";
$logent = preg_replace($searchs, $replaces, $logent);
}
$logent = preg_split("/\s+/", $logent, 6);
echo "<tr valign=\"top\">\n";
$entry_date_time = htmlspecialchars(join(" ", array_slice($logent, 0, 3)));
echo "<td class=\"listlr\" nowrap>" . $entry_date_time . "</td>\n";
echo "<td class=\"listr\">" . $logent[4] . " " . $logent[5] . "</td>\n";
echo "</tr>\n";
}
?>
<tr>
<td>
<br>
<form action="diag_logs_ppp.php" method="post">
<input name="clear" type="submit" class="formbtn" value="Clear log">
</form>
</td>
</tr>
</table>
</div>
</td>
</tr>
</table>
<?php include("fend.inc"); ?>
</body>
</html>

View File

@ -67,6 +67,7 @@ include("head.inc");
$tab_array[] = array("Firewall", false, "diag_logs_filter.php");
$tab_array[] = array("DHCP", false, "diag_logs_dhcp.php");
$tab_array[] = array("Portal Auth", false, "diag_logs_auth.php");
$tab_array[] = array("PPP", false, "diag_logs_ppp.php");
$tab_array[] = array("IPsec", false, "diag_logs_ipsec.php");
$tab_array[] = array("VPN", false, "diag_logs_vpn.php");
$tab_array[] = array("Load Balancer", true, "diag_logs_relayd.php");

View File

@ -171,6 +171,7 @@ function enable_change(enable_over) {
$tab_array[] = array("DHCP", false, "diag_logs_dhcp.php");
$tab_array[] = array("Portal Auth", false, "diag_logs_auth.php");
$tab_array[] = array("IPsec", false, "diag_logs_ipsec.php");
$tab_array[] = array("PPP", false, "diag_logs_ppp.php");
$tab_array[] = array("VPN", false, "diag_logs_vpn.php");
$tab_array[] = array("Load Balancer", false, "diag_logs_relayd.php");
$tab_array[] = array("OpenVPN", false, "diag_logs_openvpn.php");

View File

@ -103,6 +103,7 @@ include("head.inc");
$tab_array[] = array("DHCP", false, "diag_logs_dhcp.php");
$tab_array[] = array("Portal Auth", false, "diag_logs_auth.php");
$tab_array[] = array("IPsec", false, "diag_logs_ipsec.php");
$tab_array[] = array("PPP", false, "diag_logs_ppp.php");
$tab_array[] = array("VPN", true, "diag_logs_vpn.php");
$tab_array[] = array("Load Balancer", false, "diag_logs_relayd.php");
$tab_array[] = array("OpenVPN", false, "diag_logs_openvpn.php");

View File

@ -155,7 +155,7 @@ if ($_POST) {
if (isset($id) && ($a_vip[$id])) {
if ($a_vip[$id]['mode'] != $_POST['mode'])
interface_bring_down($a_vip[$id]);
interface_bring_down($a_vip[$id]['interface']);
}
if (!$input_errors) {

View File

@ -0,0 +1,145 @@
<?php
/*
getserviceproviders.php
Copyright (C) 2010 Vinicius Coque <vinicius.coque@bluepex.com>
All rights reserved.
Redistribution and use in source and binary forms, with or without
modification, are permitted provided that the following conditions are met:
1. Redistributions of source code must retain the above copyright notice,
this list of conditions and the following disclaimer.
2. Redistributions in binary form must reproduce the above copyright
notice, this list of conditions and the following disclaimer in the
documentation and/or other materials provided with the distribution.
THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES,
INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY
AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY,
OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
POSSIBILITY OF SUCH DAMAGE.
*/
/*
pfSense_MODULE: ajax
*/
##|+PRIV
##|*IDENT=page-getserviceproviders
##|*NAME=AJAX: Get Service Providers
##|*DESCR=Allow access to the 'AJAX: Service Providers' page.
##|*MATCH=getserviceproviders.php*
##|-PRIV
require_once("pfsense-utils.inc");
$serviceproviders_xml = "/usr/local/share/mobile-broadband-provider-info/serviceproviders.xml";
$serviceproviders_contents = file_get_contents($serviceproviders_xml);
$serviceproviders_attr = xml2array($serviceproviders_contents,1,"attr");
$serviceproviders = &$serviceproviders_attr['serviceproviders']['country'];
function get_country_providers($country) {
global $serviceproviders;
foreach($serviceproviders as $sp) {
if($sp['attr']['code'] == strtolower($country)) {
return is_array($sp['provider'][0]) ? $sp['provider'] : array($sp['provider']);
}
}
return $provider_list;
}
function country_list() {
global $serviceproviders;
$country_list = get_country_name("ALL");
foreach($serviceproviders as $sp) {
foreach($country_list as $country) {
if(strtoupper($sp['attr']['code']) == $country['code']) {
echo $country['name'] . ":" . $country['code'] . "\n";
}
}
}
}
function providers_list($country) {
$serviceproviders = get_country_providers($country);
foreach($serviceproviders as $sp) {
echo $sp['name']['value'] . "\n";
}
}
function provider_plan_data($country,$provider,$connection) {
Header("Content-type: application/xml; charset=iso-8859-1");
echo "<?xml version=\"1.0\" encoding=\"ISO-8859-1\" ?>\n";
echo "<connection>\n";
$serviceproviders = get_country_providers($country);
foreach($serviceproviders as $sp) {
if(strtolower($sp['name']['value']) == strtolower($provider)) {
if(strtoupper($connection) == "CDMA") {
$conndata = $sp['cdma'];
} else {
if(!is_array($sp['gsm']['apn'][0])) {
$conndata = $sp['gsm']['apn'];
} else {
foreach($sp['gsm']['apn'] as $apn) {
if($apn['attr']['value'] == $connection) {
$conndata = $apn;
break;
}
}
}
}
if(is_array($conndata)) {
echo "<apn>" . $connection . "</apn>\n";
echo "<username>" . $conndata['username']['value'] . "</username>\n";
echo "<password>" . $conndata['password']['value'] . "</password>\n";
$dns_arr = is_array($conndata['dns'][0]) ? $conndata['dns'] : array( $conndata['dns'] );
foreach($dns_arr as $dns) {
echo '<dns>' . $dns['value'] . "</dns>\n";
}
}
break;
}
}
echo "</connection>";
}
function provider_plans_list($country,$provider) {
$serviceproviders = get_country_providers($country);
foreach($serviceproviders as $sp) {
if(strtolower($sp['name']['value']) == strtolower($provider)) {
if(array_key_exists('gsm',$sp)) {
if(array_key_exists('attr',$sp['gsm']['apn'])) {
$name = ($sp['gsm']['apn']['name'] ? $sp['gsm']['apn']['name'] : $sp['name']['value']);
echo $name . ":" . $sp['gsm']['apn']['attr']['value'];
} else {
foreach($sp['gsm']['apn'] as $apn_info) {
$name = ($apn_info['name']['value'] ? $apn_info['name']['value'] : $apn_info['gsm']['apn']['name']);
echo $name . ":" . $apn_info['attr']['value'] . "\n";
}
}
}
if(array_key_exists('cdma',$sp)) {
$name = $sp['cdma']['name']['value'] ? $sp['cdma']['name']['value']:$sp['name']['value'];
echo $name . ":" . "CDMA";
}
}
}
}
if(isset($_POST['country']) && !isset($_POST['provider'])) {
providers_list($_POST['country']);
} elseif(isset($_POST['country']) && isset($_POST['provider'])) {
if(isset($_POST['plan']))
provider_plan_data($_POST['country'],$_POST['provider'],$_POST['plan']);
else
provider_plans_list($_POST['country'],$_POST['provider']);
} else {
country_list();
}
?>

View File

@ -58,6 +58,7 @@ $helppages = array(
'diag_logs_filter_dynamic.php' => 'http://doc.pfsense.org/index.php/Firewall_Logs',
'diag_logs_filter_summary.php' => 'http://doc.pfsense.org/index.php/Firewall_Logs',
'diag_logs_ntpd.php' => 'http://doc.pfsense.org/index.php/NTP_Logs',
'diag_logs_ppp.php' => 'http://doc.pfsense.org/index.php/PPP_Logs',
'diag_logs_relayd.php' => 'http://doc.pfsense.org/index.php/Load_Balancer_Logs',
'diag_logs_settings.php' => 'http://doc.pfsense.org/index.php/Log_Settings',
'diag_logs_vpn.php' => 'http://doc.pfsense.org/index.php/PPTP_VPN_Logs',

View File

@ -165,7 +165,7 @@ EOF;
if ($fd) {
while (!feof($fd)) {
$dmesgl = fgets($fd);
if (preg_match("/^hifn.: (.*?),/", $dmesgl, $matches) or preg_match("/^safe.: (.*?),/", $dmesgl, $matches) or preg_match("/^ubsec.: (.*?),/", $dmesgl, $matches) or preg_match("/^padlock.: <(.*?)>,/", $dmesgl, $matches) or preg_match("/^glxsb.: (.*?),/", $dmesgl, $matches)) {
if (preg_match("/^hifn.: (.*?),/", $dmesgl, $matches) or preg_match("/.*(VIA Padlock)/", $dmesgl, $matches) or preg_match("/^safe.: (.*?),/", $dmesgl, $matches) or preg_match("/^ubsec.: (.*?),/", $dmesgl, $matches) or preg_match("/^padlock.: <(.*?)>,/", $dmesgl, $matches) or preg_match("/^glxsb.: (.*?),/", $dmesgl, $matches)) {
$hwcrypto = $matches[1];
break;
}

View File

@ -44,14 +44,14 @@
##|*MATCH=interfaces.php*
##|-PRIV
require("guiconfig.inc");
require("ipsec.inc");
require("functions.inc");
require("captiveportal.inc");
require("filter.inc");
require("shaper.inc");
require("rrd.inc");
require("vpn.inc");
require_once("guiconfig.inc");
require_once("ipsec.inc");
require_once("functions.inc");
require_once("captiveportal.inc");
require_once("filter.inc");
require_once("shaper.inc");
require_once("rrd.inc");
require_once("vpn.inc");
if ($_REQUEST['if']) {
$if = $_REQUEST['if'];
@ -59,34 +59,15 @@ if ($_REQUEST['if']) {
$if = "wan";
}
define("CRON_PPPOE_CMD_FILE", "/conf/pppoe{$if}restart");
define("CRON_MONTHLY_PATTERN", "0 0 1 * *");
define("CRON_WEEKLY_PATTERN", "0 0 * * 0");
define("CRON_DAILY_PATTERN", "0 0 * * *");
define("CRON_HOURLY_PATTERN", "0 * * * *");
function getMPDCRONSettings() {
global $config;
if (is_array($config['cron']['item'])) {
for ($i = 0; $i < count($config['cron']['item']); $i++) {
$item = $config['cron']['item'][$i];
if (strpos($item['command'], CRON_PPPOE_CMD_FILE) !== false) {
return array("ID" => $i, "ITEM" => $item);
}
}
}
return NULL;
}
if (!is_array($config['ppps']['ppp']))
$config['ppps']['ppp'] = array();
function getMPDResetTimeFromConfig() {
$itemhash = getMPDCRONSettings();
$cronitem = $itemhash['ITEM'];
if (isset($cronitem)) {
return "{$cronitem['minute']} {$cronitem['hour']} {$cronitem['mday']} {$cronitem['month']} {$cronitem['wday']}";
} else {
return NULL;
}
}
$a_ppps = &$config['ppps']['ppp'];
function remove_bad_chars($string) {
return preg_replace('/[^a-z|_|0-9]/i','',$string);
@ -99,56 +80,86 @@ $a_gateways = &$config['gateways']['gateway_item'];
$wancfg = &$config['interfaces'][$if];
$pconfig['pppoe_username'] = $wancfg['pppoe_username'];
$pconfig['pppoe_password'] = $wancfg['pppoe_password'];
$pconfig['provider'] = $wancfg['provider'];
$pconfig['pppoe_dialondemand'] = isset($wancfg['ondemand']);
$pconfig['pppoe_idletimeout'] = $wancfg['timeout'];
/* ================================================ */
/* = force a connection reset at a specific time? = */
/* ================================================ */
if (isset($wancfg['pppoe']['pppoe-reset-type'])) {
$resetTime = getMPDResetTimeFromConfig();
$pconfig['pppoe_preset'] = true;
if ($wancfg['pppoe']['pppoe-reset-type'] == "custom") {
$resetTime_a = split(" ", $resetTime);
$pconfig['pppoe_pr_custom'] = true;
$pconfig['pppoe_resetminute'] = $resetTime_a[0];
$pconfig['pppoe_resethour'] = $resetTime_a[1];
/* just initialize $pconfig['pppoe_resetdate'] if the
* coresponding item contains appropriate numeric values.
*/
if ($resetTime_a[2] <> "*" && $resetTime_a[3] <> "*")
$pconfig['pppoe_resetdate'] = "{$resetTime_a[3]}/{$resetTime_a[2]}/" . date("Y");
} else if ($wancfg['pppoe']['pppoe-reset-type'] == "preset") {
$pconfig['pppoe_pr_preset'] = true;
switch ($resetTime) {
case CRON_MONTHLY_PATTERN:
$pconfig['pppoe_monthly'] = true;
break;
case CRON_WEEKLY_PATTERN:
$pconfig['pppoe_weekly'] = true;
break;
case CRON_DAILY_PATTERN:
$pconfig['pppoe_daily'] = true;
break;
case CRON_HOURLY_PATTERN:
$pconfig['pppoe_hourly'] = true;
break;
}
}
foreach ($a_ppps as $pppid => $ppp) {
if ($wancfg['if'] == $ppp['if'])
break;
}
$pconfig['pptp_username'] = $wancfg['pptp_username'];
$pconfig['pptp_password'] = $wancfg['pptp_password'];
$pconfig['pptp_local'] = $wancfg['local'];
$pconfig['pptp_subnet'] = $wancfg['subnet'];
$pconfig['pptp_remote'] = $wancfg['remote'];
$pconfig['pptp_dialondemand'] = isset($wancfg['ondemand']);
$pconfig['pptp_idletimeout'] = $wancfg['timeout'];
if ($wancfg['if'] == $a_ppps[$pppid]['if']) {
$pconfig['pppid'] = $pppid;
$pconfig['ptpid'] = $a_ppps[$pppid]['ptpid'];
$pconfig['port'] = $a_ppps[$pppid]['ports'];
if ($a_ppps[$pppid]['type'] == "ppp"){
$pconfig['username'] = $a_ppps[$pppid]['username'];
$pconfig['password'] = base64_decode($a_ppps[$pppid]['password']);
$pconfig['phone'] = $a_ppps[$pppid]['phone'];
$pconfig['apn'] = $a_ppps[$pppid]['apn'];
}
if ($a_ppps[$pppid]['type'] == "pppoe"){
$pconfig['pppoe_username'] = $a_ppps[$pppid]['username'];
$pconfig['pppoe_password'] = base64_decode($a_ppps[$pppid]['password']);
$pconfig['provider'] = $a_ppps[$pppid]['provider'];
$pconfig['pppoe_dialondemand'] = isset($a_ppps[$pppid]['ondemand']);
$pconfig['pppoe_idletimeout'] = $a_ppps[$pppid]['idletimeout'];
/* ================================================ */
/* = force a connection reset at a specific time? = */
/* ================================================ */
if (isset($a_ppps[$pppid]['pppoe-reset-type'])) {
$pconfig['pppoe-reset-type'] = $a_ppps[$pppid]['pppoe-reset-type'];
$itemhash = getMPDCRONSettings($a_ppps[$pppid]['if']);
$cronitem = $itemhash['ITEM'];
if (isset($cronitem)) {
$resetTime = "{$cronitem['minute']} {$cronitem['hour']} {$cronitem['mday']} {$cronitem['month']} {$cronitem['wday']}";
} else {
$resetTime = NULL;
}
log_error("ResetTime:".$resetTime);
if ($a_ppps[$pppid]['pppoe-reset-type'] == "custom") {
$resetTime_a = split(" ", $resetTime);
$pconfig['pppoe_pr_custom'] = true;
$pconfig['pppoe_resetminute'] = $resetTime_a[0];
$pconfig['pppoe_resethour'] = $resetTime_a[1];
/* just initialize $pconfig['pppoe_resetdate'] if the
* coresponding item contains appropriate numeric values.
*/
if ($resetTime_a[2] <> "*" && $resetTime_a[3] <> "*")
$pconfig['pppoe_resetdate'] = "{$resetTime_a[3]}/{$resetTime_a[2]}/" . date("Y");
} else if ($a_ppps[$pppid]['pppoe-reset-type'] == "preset") {
$pconfig['pppoe_pr_preset'] = true;
switch ($resetTime) {
case CRON_MONTHLY_PATTERN:
$pconfig['pppoe_monthly'] = true;
break;
case CRON_WEEKLY_PATTERN:
$pconfig['pppoe_weekly'] = true;
break;
case CRON_DAILY_PATTERN:
$pconfig['pppoe_daily'] = true;
break;
case CRON_HOURLY_PATTERN:
$pconfig['pppoe_hourly'] = true;
break;
}
}
}// End force pppoe reset at specific time
}// End if type == pppoe
if ($a_ppps[$pppid]['type'] == "pptp"){
$pconfig['pptp_username'] = $a_ppps[$pppid]['username'];
$pconfig['pptp_password'] = base64_decode($a_ppps[$pppid]['password']);
$pconfig['pptp_local'] = $a_ppps[$pppid]['localip'];
$pconfig['pptp_subnet'] = $a_ppps[$pppid]['subnet'];
$pconfig['pptp_remote'] = $a_ppps[$pppid]['gateway'];
$pconfig['pptp_dialondemand'] = isset($a_ppps[$pppid]['ondemand']);
$pconfig['pptp_idletimeout'] = $a_ppps[$pppid]['timeout'];
}
} else {
$pconfig['ptpid'] = interfaces_ptpid_next();
$pppid = count($a_ppps);
}
$pconfig['dhcphostname'] = $wancfg['dhcphostname'];
$pconfig['alias-address'] = $wancfg['alias-address'];
$pconfig['alias-subnet'] = $wancfg['alias-subnet'];
@ -180,13 +191,9 @@ switch($wancfg['ipaddr']) {
$pconfig['ipaddr'] = "";
break;
case "pppoe":
$pconfig['type'] = "pppoe";
break;
case "pptp":
$pconfig['type'] = "pptp";
break;
case "ppp":
$pconfig['type'] = "ppp";
$pconfig['type'] = $wancfg['ipaddr'];
break;
default:
if(is_ipaddr($wancfg['ipaddr'])) {
@ -327,7 +334,7 @@ if ($_POST) {
* data validation procedure below, may trigger a false error
* message.
*/
if (empty($_POST['pppoe_preset'])) {
if (empty($_POST['pppoe-reset-type'])) {
unset($_POST['pppoe_pr_type']);
unset($_POST['pppoe_resethour']);
unset($_POST['pppoe_resetminute']);
@ -351,6 +358,11 @@ if ($_POST) {
$reqdfieldsn = explode(",", "IP address,Subnet bit count,Gateway");
do_input_validation($_POST, $reqdfields, $reqdfieldsn, &$input_errors);
break;
case "ppp":
$reqdfields = explode(" ", "port phone");
$reqdfieldsn = explode(",", "Modem Port,Phone Number");
do_input_validation($_POST, $reqdfields, $reqdfieldsn, &$input_errors);
break;
case "PPPoE":
if ($_POST['pppoe_dialondemand']) {
$reqdfields = explode(" ", "pppoe_username pppoe_password pppoe_dialondemand pppoe_idletimeout");
@ -467,6 +479,7 @@ if ($_POST) {
}
}
if (!$input_errors) {
$ppp = array();
if ($wancfg['ipaddr'] != "ppp")
unset($wancfg['ipaddr']);
unset($wancfg['subnet']);
@ -479,12 +492,18 @@ if ($_POST) {
unset($wancfg['provider']);
unset($wancfg['ondemand']);
unset($wancfg['timeout']);
if ($wancfg['pppoe']['pppoe-reset-type'])
unset($wancfg['pppoe']['pppoe-reset-type']);
unset($wancfg['pppoe']['pppoe-reset-type']);
unset($wancfg['local']);
unset($wancfg['subnet']);
unset($wancfg['remote']);
unset($a_ppps[$pppid]['apn']);
unset($a_ppps[$pppid]['phone']);
unset($a_ppps[$pppid]['localip']);
unset($a_ppps[$pppid]['subnet']);
unset($a_ppps[$pppid]['gateway']);
unset($a_ppps[$pppid]['pppoe-reset-type']);
unset($a_ppps[$pppid]['provider']);
$wancfg['descr'] = remove_bad_chars($_POST['descr']);
$wancfg['enable'] = $_POST['enable'] == "yes" ? true : false;
@ -509,7 +528,7 @@ if ($_POST) {
unset($gateway_item);
}
}
switch($_POST['type']) {
case "static":
$wancfg['ipaddr'] = $_POST['ipaddr'];
@ -536,40 +555,82 @@ if ($_POST) {
$a_gateways[] = $gateway_item;
}
break;
case "ppp":
$a_ppps[$pppid]['ptpid'] = $_POST['ptpid'];
$a_ppps[$pppid]['type'] = $_POST['type'];
$a_ppps[$pppid]['if'] = $_POST['type'].$_POST['ptpid'];
$a_ppps[$pppid]['ports'] = $_POST['port'];
$a_ppps[$pppid]['username'] = $_POST['username'];
$a_ppps[$pppid]['password'] = base64_encode($_POST['password']);
$a_ppps[$pppid]['phone'] = $_POST['phone'];
$a_ppps[$pppid]['apn'] = $_POST['apn'];
$wancfg['if'] = $_POST['type'] . $_POST['ptpid'];
$wancfg['ipaddr'] = $_POST['type'];
unset($a_ppps[$pppid]['ondemand']);
unset($a_ppps[$pppid]['idletimeout']);
break;
case "pppoe":
$wancfg['ipaddr'] = "pppoe";
$wancfg['pppoe_username'] = $_POST['pppoe_username'];
$wancfg['pppoe_password'] = $_POST['pppoe_password'];
$wancfg['provider'] = $_POST['provider'];
$wancfg['ondemand'] = $_POST['pppoe_dialondemand'] ? true : false;
$wancfg['timeout'] = $_POST['pppoe_idletimeout'];
$a_ppps[$pppid]['ptpid'] = $_POST['ptpid'];
$a_ppps[$pppid]['type'] = $_POST['type'];
$a_ppps[$pppid]['if'] = $_POST['type'].$_POST['ptpid'];
if (isset($_POST['ppp_port']))
$a_ppps[$pppid]['ports'] = $_POST['ppp_port'];
else
$a_ppps[$pppid]['ports'] = $wancfg['if'];
$a_ppps[$pppid]['username'] = $_POST['pppoe_username'];
$a_ppps[$pppid]['password'] = base64_encode($_POST['pppoe_password']);
if (!empty($_POST['provider']))
$a_ppps[$pppid]['provider'] = $_POST['provider'];
else
unset($a_ppps[$pppid]['provider']);
$a_ppps[$pppid]['ondemand'] = $_POST['pppoe_dialondemand'] ? true : false;
if (!empty($_POST['idletimeout']))
$a_ppps[$pppid]['idletimeout'] = $_POST['pppoe_idletimeout'];
else
unset($a_ppps[$pppid]['idletimeout']);
if (!empty($_POST['pppoe-reset-type']))
$a_ppps[$pppid]['pppoe-reset-type'] = $_POST['pppoe-reset-type'];
else
unset($a_ppps[$pppid]['pppoe-reset-type']);
$wancfg['if'] = $_POST['type'].$_POST['ptpid'];
$wancfg['ipaddr'] = $_POST['type'];
if($gateway_item) {
$a_gateways[] = $gateway_item;
}
break;
case "pptp":
$wancfg['ipaddr'] = "pptp";
$wancfg['pptp_username'] = $_POST['pptp_username'];
$wancfg['pptp_password'] = $_POST['pptp_password'];
$wancfg['local'] = $_POST['pptp_local'];
$wancfg['subnet'] = $_POST['pptp_subnet'];
$wancfg['remote'] = $_POST['pptp_remote'];
$wancfg['ondemand'] = $_POST['pptp_dialondemand'] ? true : false;
$wancfg['timeout'] = $_POST['pptp_idletimeout'];
$a_ppps[$pppid]['ptpid'] = $_POST['ptpid'];
$a_ppps[$pppid]['type'] = $_POST['type'];
$a_ppps[$pppid]['if'] = $_POST['type'].$_POST['ptpid'];
if (isset($_POST['ppp_port']))
$a_ppps[$pppid]['ports'] = $_POST['ppp_port'];
else
$a_ppps[$pppid]['ports'] = $wancfg['if'];
$a_ppps[$pppid]['username'] = $_POST['pptp_username'];
$a_ppps[$pppid]['password'] = base64_encode($_POST['pptp_password']);
$a_ppps[$pppid]['localip'] = $_POST['pptp_local'];
$a_ppps[$pppid]['subnet'] = $_POST['pptp_subnet'];
$a_ppps[$pppid]['gateway'] = $_POST['pptp_remote'];
$a_ppps[$pppid]['ondemand'] = $_POST['pptp_dialondemand'] ? true : false;
if (!empty($_POST['idletimeout']))
$a_ppps[$pppid]['idletimeout'] = $_POST['pptp_idletimeout'];
else
unset($a_ppps[$pppid]['idletimeout']);
$wancfg['if'] = $_POST['type'].$_POST['ptpid'];
$wancfg['ipaddr'] = $_POST['type'];
if($gateway_item) {
$a_gateways[] = $gateway_item;
}
break;
case "none":
break;
}
handle_pppoe_reset();
/* reset cron items if necessary */
if (empty($_POST['pppoe_preset'])) {
/* test whether a cron item exists and unset() it if necessary */
$itemhash = getMPDCRONSettings();
$item = $itemhash['ITEM'];
if (isset($item))
unset($config['cron']['item'][$itemhash['ID']]);
}
handle_pppoe_reset($_POST);
if($_POST['blockpriv'] == "yes") {
$wancfg['blockpriv'] = true;
} else {
@ -589,6 +650,7 @@ if ($_POST) {
if (isset($wancfg['wireless'])) {
handle_wireless_post();
}
write_config();
mark_subsystem_dirty('interfaces');
/* regenerate cron settings/crontab file */
@ -597,96 +659,11 @@ if ($_POST) {
header("Location: interfaces.php?if={$if}");
exit;
}
} // end if($_POST)
function handle_pppoe_reset() {
global $_POST, $config, $g, $wancfg, $if;
/* perform a periodic reset? */
if(!isset($_POST['pppoe_preset'])) {
setup_pppoe_reset_file($if, false);
return;
}
if (!is_array($config['cron']['item']))
$config['cron']['item'] = array();
$itemhash = getMPDCRONSettings();
$item = $itemhash['ITEM'];
if (empty($item))
$item = array();
if (isset($_POST['pppoe_pr_type']) && $_POST['pppoe_pr_type'] == "custom") {
$wancfg['pppoe']['pppoe-reset-type'] = "custom";
$pconfig['pppoe_pr_custom'] = true;
$item['minute'] = $_POST['pppoe_resetminute'];
$item['hour'] = $_POST['pppoe_resethour'];
if (isset($_POST['pppoe_resetdate']) && $_POST['pppoe_resetdate'] <> "" && strlen($_POST['pppoe_resetdate']) == 10) {
$date = explode("/", $_POST['pppoe_resetdate']);
$item['mday'] = $date[1];
$item['month'] = $date[0];
} else {
$item['mday'] = "*";
$item['month'] = "*";
}
$item['wday'] = "*";
$item['who'] = "root";
$item['command'] = CRON_PPPOE_CMD_FILE;
} else if (isset($_POST['pppoe_pr_type']) && $_POST['pppoe_pr_type'] = "preset") {
$wancfg['pppoe']['pppoe-reset-type'] = "preset";
$pconfig['pppoe_pr_preset'] = true;
switch ($_POST['pppoe_pr_preset_val']) {
case "monthly":
$item['minute'] = "0";
$item['hour'] = "0";
$item['mday'] = "1";
$item['month'] = "*";
$item['wday'] = "*";
$item['who'] = "root";
$item['command'] = CRON_PPPOE_CMD_FILE;
break;
case "weekly":
$item['minute'] = "0";
$item['hour'] = "0";
$item['mday'] = "*";
$item['month'] = "*";
$item['wday'] = "0";
$item['who'] = "root";
$item['command'] = CRON_PPPOE_CMD_FILE;
break;
case "daily":
$item['minute'] = "0";
$item['hour'] = "0";
$item['mday'] = "*";
$item['month'] = "*";
$item['wday'] = "*";
$item['who'] = "root";
$item['command'] = CRON_PPPOE_CMD_FILE;
break;
case "hourly":
$item['minute'] = "0";
$item['hour'] = "*";
$item['mday'] = "*";
$item['month'] = "*";
$item['wday'] = "*";
$item['who'] = "root";
$item['command'] = CRON_PPPOE_CMD_FILE;
break;
} // end switch
} // end if
if (isset($itemhash['ID']))
$config['cron']['item'][$itemhash['ID']] = $item;
else
$config['cron']['item'][] = $item;
/* finally install the pppoerestart file */
if (isset($_POST['pppoe_preset'])) {
setup_pppoe_reset_file($if, true);
$wancfg['pppoe_reset'] = true;
$wancfg['pppoe_preset'] = true;
sigkillbypid("{$g['varrun_path']}/cron.pid", "HUP");
} else {
unset($wancfg['pppoe_reset']);
unset($wancfg['pppoe_preset']);
setup_pppoe_reset_file($if, false);
}
}
function handle_wireless_post() {
global $_POST, $config, $g, $wancfg, $if, $wl_countries_attr;
if (!is_array($wancfg['wireless']))
@ -832,7 +809,7 @@ $statusurl = "status_interfaces.php";
$closehead = false;
include("head.inc");
$types = array("none" => "None", "static" => "Static", "dhcp" => "DHCP", "pppoe" => "PPPoE", "pptp" => "PPTP" /* , "carpdev-dhcp" => "CarpDev"*/);
$types = array("none" => "None", "static" => "Static", "dhcp" => "DHCP", "ppp" => "PPP", "pppoe" => "PPPoE", "pptp" => "PPTP" /* , "carpdev-dhcp" => "CarpDev"*/);
?>
@ -842,21 +819,33 @@ $types = array("none" => "None", "static" => "Static", "dhcp" => "DHCP", "pppoe"
<link href="/javascript/datepicker/css/datepicker.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript">
function updateType(t){
function updateType(t) {
switch(t) {
<?php
/* OK, so this is sick using php to generate javascript, but it needed to be done */
foreach ($types as $key => $val) {
echo "case \"{$key}\": {\n";
$t = $types;
foreach ($t as $k => $v) {
if ($k != $key) {
echo "$('{$k}').hide();\n";
}
case "none": {
$('static','dhcp','pppoe','pptp', 'ppp').invoke('hide');
break;
}
case "static": {
$('none','dhcp','pppoe','pptp', 'ppp').invoke('hide');
break;
}
case "dhcp": {
$('none','static','pppoe','pptp', 'ppp').invoke('hide');
break;
}
case "ppp": {
$('none','static','dhcp','pptp', 'pppoe').invoke('hide');
country_list();
break;
}
case "pppoe": {
$('none','static','dhcp','pptp', 'ppp').invoke('hide');
break;
}
case "pptp": {
$('none','static','dhcp','pppoe', 'ppp').invoke('hide');
break;
}
echo "}\n";
}
?>
}
$(t).show();
}
@ -867,14 +856,20 @@ $types = array("none" => "None", "static" => "Static", "dhcp" => "DHCP", "pppoe"
else
$('allcfg').hide();
}
function show_periodic_reset(obj) {
if (obj.checked)
$('presetwrap').show();
else
$('presetwrap').hide();
}
function show_reset_settings(reset_type) {
if (reset_type == 'preset') {
Effect.Appear('pppoepresetwrap', { duration: 0.0 });
Effect.Fade('pppoecustomwrap', { duration: 0.0 });
}
else if (reset_type == 'custom') {
Effect.Appear('pppoecustomwrap', { duration: 0.0 });
Effect.Fade('pppoepresetwrap', { duration: 0.0 });
} else {
Effect.Fade('pppoecustomwrap', { duration: 0.0 });
Effect.Fade('pppoepresetwrap', { duration: 0.0 });
}
}
function show_mon_config() {
document.getElementById("showmonbox").innerHTML='';
aodiv = document.getElementById('showmon');
@ -888,6 +883,90 @@ $types = array("none" => "None", "static" => "Static", "dhcp" => "DHCP", "pppoe"
else
return true;
}
function country_list() {
$('country').childElements().each(function(node) { node.remove(); });
$('provider').childElements().each(function(node) { node.remove(); });
$('providerplan').childElements().each(function(node) { node.remove(); });
new Ajax.Request("getserviceproviders.php",{
onSuccess: function(response) {
var responseTextArr = response.responseText.split("\n");
responseTextArr.sort();
responseTextArr.each( function(value) {
var option = new Element('option');
country = value.split(":");
option.text = country[0];
option.value = country[1];
$('country').insert({ bottom : option });
});
}
});
$('trcountry').setStyle({display : "table-row"});
}
function providers_list() {
$('provider').childElements().each(function(node) { node.remove(); });
$('providerplan').childElements().each(function(node) { node.remove(); });
new Ajax.Request("getserviceproviders.php",{
parameters: {country : $F('country')},
onSuccess: function(response) {
var responseTextArr = response.responseText.split("\n");
responseTextArr.sort();
responseTextArr.each( function(value) {
var option = new Element('option');
option.text = value;
option.value = value;
$('provider').insert({ bottom : option });
});
}
});
$('trprovider').setStyle({display : "table-row"});
$('trproviderplan').setStyle({display : "none"});
}
function providerplan_list() {
$('providerplan').childElements().each(function(node) { node.remove(); });
$('providerplan').insert( new Element('option') );
new Ajax.Request("getserviceproviders.php",{
parameters: {country : $F('country'), provider : $F('provider')},
onSuccess: function(response) {
var responseTextArr = response.responseText.split("\n");
responseTextArr.sort();
responseTextArr.each( function(value) {
if(value != "") {
providerplan = value.split(":");
var option = new Element('option');
option.text = providerplan[0] + " - " + providerplan[1];
option.value = providerplan[1];
$('providerplan').insert({ bottom : option });
}
});
}
});
$('trproviderplan').setStyle({display : "table-row"});
}
function prefill_provider() {
new Ajax.Request("getserviceproviders.php",{
parameters: {country : $F('country'), provider : $F('provider'), plan : $F('providerplan')},
onSuccess: function(response) {
var xmldoc = response.responseXML;
var provider = xmldoc.getElementsByTagName('connection')[0];
$('username').setValue('');
$('password').setValue('');
if(provider.getElementsByTagName('apn')[0].firstChild.data == "CDMA") {
$('phone').setValue('*777');
$('apn').setValue('');
} else {
$('phone').setValue('*99#');
$('apn').setValue(provider.getElementsByTagName('apn')[0].firstChild.data);
}
$('username').setValue(provider.getElementsByTagName('username')[0].firstChild.data);
$('password').setValue(provider.getElementsByTagName('password')[0].firstChild.data);
}
});
}
</script>
</head>
<body link="#0000CC" vlink="#0000CC" alink="#0000CC">
@ -923,7 +1002,6 @@ $types = array("none" => "None", "static" => "Static", "dhcp" => "DHCP", "pppoe"
<br><span class="vexpl">Enter a description (name) for the interface here.</span>
</td>
</tr>
<? if(!$wancfg['serialport']): ?>
<tr>
<td valign="middle" class="vncell"><strong>Type</strong></td>
<td class="vtable">
@ -940,7 +1018,6 @@ $types = array("none" => "None", "static" => "Static", "dhcp" => "DHCP", "pppoe"
</select>
</td>
</tr>
<?php endif; ?>
<tr>
<td valign="top" class="vncell">MAC address</td>
<td class="vtable">
@ -1117,6 +1194,103 @@ $types = array("none" => "None", "static" => "Static", "dhcp" => "DHCP", "pppoe"
</table>
</td>
</tr>
<tr style="display:none;" name="ppp" id="ppp">
<td colspan="2" style="padding: 0px;">
<table width="100%" border="0" cellpadding="6" cellspacing="0">
<tr>
<td colspan="2" valign="top" class="listtopic">PPP configuration</td>
</tr>
<tr name="ppp_provider" id="ppp_provider">
<td width="22%" valign="top" class="vncell"><?= gettext("Service Provider"); ?></td>
<td width="78%" class="vtable">
<table border="0" cellpadding="0" cellspacing="0">
<tr id="trcountry">
<td><?= gettext("Country"); ?> :&nbsp;&nbsp;</td>
<td>
<select class="formselect" name="country" id="country" onChange="providers_list()">
<option></option>
</select>
</td>
</tr>
<tr id="trprovider" style="display:none">
<td><?= gettext("Provider"); ?> :&nbsp;&nbsp;</td>
<td>
<select class="formselect" name="provider" id="provider" onChange="providerplan_list()">
<option></option>
</select>
</td>
</tr>
<tr id="trproviderplan" style="display:none">
<td><?= gettext("Plan"); ?> :&nbsp;&nbsp;</td>
<td>
<select class="formselect" name="providerplan" id="providerplan" onChange="prefill_provider()">
<option></option>
</select>
</td>
</tr>
</table>
<br/><span class="vexpl"><?= gettext("Select to fill in data for your service provider."); ?></span>
</td>
</tr>
<tr>
<td width="22%" valign="top" class="vncell"><?= gettext("Username"); ?></td>
<td width="78%" class="vtable">
<input name="username" type="text" class="formfld user" id="username" size="20" value="<?=htmlspecialchars($pconfig['username']);?>">
</td>
</tr>
<tr>
<td width="22%" valign="top" class="vncell"><?= gettext("Password"); ?></td>
<td width="78%" class="vtable">
<input name="password" type="password" class="formfld pwd" id="password" size="20" value="<?=htmlspecialchars($pconfig['password']);?>">
</td>
</tr>
<tr name="phone_num" id="phone_num">
<td width="22%" valign="top" class="vncellreq"><?= gettext("Phone Number"); ?></td>
<td width="78%" class="vtable">
<input name="phone" type="text" class="formfld unknown" id="phone" size="12" value="<?=htmlspecialchars($pconfig['phone']);?>">
</td>
</tr>
<tr name="apn_" id="apn_">
<td width="22%" valign="top" class="vncell"><?= gettext("Access Point Name (APN)"); ?></td>
<td width="78%" class="vtable">
<input name="apn" type="text" class="formfld unknown" id="apn" size="40" value="<?=htmlspecialchars($pconfig['apn']);?>">
</td>
</tr>
<tr name="interface" id="interface" >
<td width="22%" valign="top" class="vncellreq"><?= gettext("Modem Port"); ?></td>
<td width="78%" class="vtable">
<select name="port" id="port" class="formselect">
<?php
$portlist = glob("/dev/cua*");
$modems = glob("/dev/modem*");
$portlist = array_merge($portlist, $modems);
foreach ($portlist as $port) {
if(preg_match("/\.(lock|init)$/", $port))
continue;
echo "<option value=\"".trim($port)."\"";
if ($pconfig['port'] == $port)
echo "selected";
echo ">{$port}</option>";
}?>
</select>
</td>
</tr>
<td width="22%" valign="top" class="vncell"><?= gettext("Advanced PPP"); ?></td>
<?php if (isset($pconfig['pppid'])): ?>
<td width="78%" class="vtable">
<a href="/interfaces_ppps_edit.php?id=<?=htmlspecialchars($pconfig['pppid']);?>" class="navlnk">Click here</a>
to edit PPP configuration.
</td>
<? else: ?>
<td width="78%" class="vtable">
<a href="/interfaces_ppps_edit.php" class="navlnk">Click here</a>
to create a PPP configuration.
</td>
<? endif; ?>
</tr>
</table>
</td>
</tr>
<tr style="display:none;" name="pppoe" id="pppoe">
<td colspan="2" style="padding:0px;">
<table width="100%" border="0" cellpadding="6" cellspacing="0">
@ -1158,63 +1332,71 @@ $types = array("none" => "None", "static" => "Static", "dhcp" => "DHCP", "pppoe"
<tr>
<td width="22%" valign="top" class="vncell"><?=gettext("Periodic reset");?></td>
<td width="78%" class="vtable">
<input name="pppoe_preset" type="checkbox" id="pppoe_preset" value="yes" <?php if ($pconfig['pppoe_preset']) echo "checked=\"checked\""; ?> onclick="show_periodic_reset(this);" />
<?= gettext("enable periodic PPPoE resets"); ?>
<br />
<?php if ($pconfig['pppoe_preset']): ?>
<table id="presetwrap" cellspacing="0" cellpadding="0" width="100%">
<?php else: ?>
<table id="presetwrap" cellspacing="0" cellpadding="0" width="100%" style="display: none;">
<table id="presetwrap" cellspacing="0" cellpadding="0" width="100%">
<tr>
<td align="left" valign="top">
<p style="margin: 4px; padding: 4px 0 4px 0; width: 94%;">
<select valign="top" id="reset_type" name="pppoe-reset-type" class="formselect" onChange="show_reset_settings(this.value);">
<option value = ""><?= gettext("Disabled"); ?></option>
<option value="custom" <?php if ($pconfig['pppoe-reset-type'] == "custom") echo "selected"; ?>><?= gettext("Custom"); ?></option>
<option value="preset" <?php if ($pconfig['pppoe-reset-type'] == "preset") echo "selected"; ?>><?= gettext("Pre-Set"); ?></option>
</select> <?= gettext("Select a reset timing type"); ?>
</p>
<?php if ($pconfig['pppoe_pr_custom']): ?>
<p style="margin: 2px; padding: 4px; width: 94%;" id="pppoecustomwrap">
<?php else: ?>
<p style="margin: 2px; padding: 4px; width: 94%; display: none;" id="pppoecustomwrap">
<?php endif; ?>
<tr>
<td align="left" valign="top">
<p style="margin: 4px; padding: 4px 0 4px 0; width: 94%;">
<input name="pppoe_pr_type" type="radio" id="pppoe_pr_custom" value="custom" <?php if ($pconfig['pppoe_pr_custom']) echo "checked=\"checked\""; ?> onclick="if (this.checked) { Effect.Appear('pppoecustomwrap', { duration: 0.0 }); Effect.Fade('pppoepresetwrap', { duration: 0.0 }); }" />
<?= gettext("provide a custom reset time"); ?>
<br />
<input name="pppoe_pr_type" type="radio" id="pppoe_pr_preset" value="preset" <?php if ($pconfig['pppoe_pr_preset']) echo "checked=\"checked\""; ?> onclick="if (this.checked) { Effect.Appear('pppoepresetwrap', { duration: 0.0 }); Effect.Fade('pppoecustomwrap', { duration: 0.0 }); }" />
<?= gettext("select reset time from a preset"); ?>
</p>
<?php if ($pconfig['pppoe_pr_custom']): ?>
<p style="margin: 2px; padding: 4px; width: 94%;" id="pppoecustomwrap">
<?php else: ?>
<p style="margin: 2px; padding: 4px; width: 94%; display: none;" id="pppoecustomwrap">
<?php endif; ?>
<input type="text" name="pppoe_resethour" class="fd_incremental_inp_range_0_23 fd_increment_1 fd_classname_dec_buttonDec fd_classname_inc_buttonInc" maxlength="2" id="pppoe_resethour" value="<?= $pconfig['pppoe_resethour']; ?>" size="3" />
<?= gettext("hour (0-23)"); ?><br />
<input type="text" name="pppoe_resetminute" class="fd_incremental_inp_range_0_59 fd_increment_1 fd_classname_dec_buttonDec fd_classname_inc_buttonInc" maxlength="2" id="pppoe_resetminute" value="<?= $pconfig['pppoe_resetminute']; ?>" size="3" />
<?= gettext("minute (0-59)"); ?><br />
<input name="pppoe_resetdate" type="text" class="w8em format-m-d-y highlight-days-67" id="pppoe_resetdate" maxlength="10" size="10" value="<?=htmlspecialchars($pconfig['pppoe_resetdate']);?>" />
<?= gettext("reset at a specific date (mm/dd/yyyy)"); ?>
<br />&nbsp;<br />
<span class="red"><strong>Note: </strong></span>
If you leave the date field empty, the reset will be executed each day at the time you did specify using the minutes and hour field.
</p>
<?php if ($pconfig['pppoe_pr_preset']): ?>
<p style="margin: 2px; padding: 4px; width: 94%;" id="pppoepresetwrap">
<?php else: ?>
<p style="margin: 2px; padding: 4px; width: 94%; display: none;" id="pppoepresetwrap">
<?php endif; ?>
<input name="pppoe_pr_preset_val" type="radio" id="pppoe_monthly" value="monthly" <?php if ($pconfig['pppoe_monthly']) echo "checked=\"checked\""; ?> />
<?= gettext("reset at each month ('0 0 1 * *')"); ?>
<br />
<input name="pppoe_pr_preset_val" type="radio" id="pppoe_weekly" value="weekly" <?php if ($pconfig['pppoe_weekly']) echo "checked=\"checked\""; ?> />
<?= gettext("reset at each week ('0 0 * * 0')"); ?>
<br />
<input name="pppoe_pr_preset_val" type="radio" id="pppoe_daily" value="daily" <?php if ($pconfig['pppoe_daily']) echo "checked=\"checked\""; ?> />
<?= gettext("reset at each day ('0 0 * * *')"); ?>
<br />
<input name="pppoe_pr_preset_val" type="radio" id="pppoe_hourly" value="hourly" <?php if ($pconfig['pppoe_hourly']) echo "checked=\"checked\""; ?> />
<?= gettext("reset at each hour ('0 * * * *')"); ?>
</p>
</td>
</tr>
</table>
</td>
</tr>
</table>
<input type="text" name="pppoe_resethour" class="fd_incremental_inp_range_0_23 fd_increment_1 fd_classname_dec_buttonDec fd_classname_inc_buttonInc" maxlength="2" id="pppoe_resethour" value="<?= $pconfig['pppoe_resethour']; ?>" size="3" />
<?= gettext("hour (0-23)"); ?><br />
<input type="text" name="pppoe_resetminute" class="fd_incremental_inp_range_0_59 fd_increment_1 fd_classname_dec_buttonDec fd_classname_inc_buttonInc" maxlength="2" id="pppoe_resetminute" value="<?= $pconfig['pppoe_resetminute']; ?>" size="3" />
<?= gettext("minute (0-59)"); ?><br />
<input name="pppoe_resetdate" type="text" class="w8em format-m-d-y highlight-days-67" id="pppoe_resetdate" maxlength="10" size="10" value="<?=htmlspecialchars($pconfig['pppoe_resetdate']);?>" />
<?= gettext("reset at a specific date (mm/dd/yyyy)"); ?>
<br />&nbsp;<br />
<span class="red"><strong>Note: </strong></span>
<?= gettext("If you leave the date field empty, the reset will be executed each day at the time you did specify using the minutes and hour field."); ?>
</p>
<?php if ($pconfig['pppoe_pr_preset']): ?>
<p style="margin: 2px; padding: 4px; width: 94%;" id="pppoepresetwrap">
<?php else: ?>
<p style="margin: 2px; padding: 4px; width: 94%; display: none;" id="pppoepresetwrap">
<?php endif; ?>
<input name="pppoe_pr_preset_val" type="radio" id="pppoe_monthly" value="monthly" <?php if ($pconfig['pppoe_monthly']) echo "checked=\"checked\""; ?> />
<?= gettext("reset at each month ('0 0 1 * *')"); ?>
<br />
<input name="pppoe_pr_preset_val" type="radio" id="pppoe_weekly" value="weekly" <?php if ($pconfig['pppoe_weekly']) echo "checked=\"checked\""; ?> />
<?= gettext("reset at each week ('0 0 * * 0')"); ?>
<br />
<input name="pppoe_pr_preset_val" type="radio" id="pppoe_daily" value="daily" <?php if ($pconfig['pppoe_daily']) echo "checked=\"checked\""; ?> />
<?= gettext("reset at each day ('0 0 * * *')"); ?>
<br />
<input name="pppoe_pr_preset_val" type="radio" id="pppoe_hourly" value="hourly" <?php if ($pconfig['pppoe_hourly']) echo "checked=\"checked\""; ?> />
<?= gettext("reset at each hour ('0 * * * *')"); ?>
</p>
</td>
</tr>
</table>
</td>
</tr>
<tr>
<td width="22%" valign="top" class="vncell">Advanced and MLPPP</td>
<?php if (isset($pconfig['pppid'])): ?>
<td width="78%" class="vtable">
<a href="/interfaces_ppps_edit.php?id=<?=htmlspecialchars($pconfig['pppid']);?>" class="navlnk">Click here</a>
for additional PPPoE configuration options. Save first if you made changes.
</td>
<? else: ?>
<td width="78%" class="vtable">
<a href="/interfaces_ppps_edit.php" class="navlnk">Click here</a>
for advanced PPPoE configuration options and MLPPP configuration.
</td>
<? endif; ?>
</tr>
</table>
</td>
</tr>
<tr style="display:none;" name="pptp" id="pptp">
<td colspan="2" style="padding:0px;">
<table width="100%" border="0" cellpadding="6" cellspacing="0">
@ -1241,8 +1423,7 @@ $types = array("none" => "None", "static" => "Static", "dhcp" => "DHCP", "pppoe"
<select name="pptp_subnet" class="formselect" id="pptp_subnet">
<?php for ($i = 31; $i > 0; $i--): ?>
<option value="<?=$i;?>" <?php if ($i == $pconfig['pptp_subnet']) echo "selected"; ?>>
<?=$i;?>
</option>
<?=$i;?></option>
<?php endfor; ?>
</select>
</td>
@ -1684,9 +1865,9 @@ $types = array("none" => "None", "static" => "Static", "dhcp" => "DHCP", "pppoe"
and obviously should not appear as the source address in any packets you receive.
</td>
</tr>
</tr>
</table>
</div>
</table> <!-- End "allcfg" table -->
</div> <!-- End "allcfg" div -->
<table width="100%" border="0" cellpadding="6" cellspacing="0">
<tr>
<td width="100" valign="top">
@ -1697,14 +1878,21 @@ $types = array("none" => "None", "static" => "Static", "dhcp" => "DHCP", "pppoe"
<input id="save" name="Submit" type="submit" class="formbtn" value="Save">
<input id="cancel" type="button" class="formbtn" value="Cancel" onclick="history.back()">
<input name="if" type="hidden" id="if" value="<?=$if;?>">
<?php if ($wancfg['if'] == $a_ppps[$pppid]['if']) : ?>
<input name="ppp_port" type="hidden" value="<?=$pconfig['port'];?>">
<?php endif; ?>
<input name="ptpid" type="hidden" value="<?=$pconfig['ptpid'];?>">
</td>
</tr>
</table>
</td>
</table>
</tr>
</table>
<!--
</div>
</td></tr>
</table>
-->
</form>
<script type="text/javascript">
var gatewayip;
@ -1777,10 +1965,10 @@ $types = array("none" => "None", "static" => "Static", "dhcp" => "DHCP", "pppoe"
}
<?php
if ($if == "wan" || $if == "lan")
echo "\$('allcfg').show();";
echo "\$('allcfg').show();\n";
else
echo "show_allcfg(document.iform.enable);";
echo "updateType('{$pconfig['type']}')";
echo "updateType('{$pconfig['type']}');\n";
?>
</script>
<?php include("fend.inc"); ?>

View File

@ -130,10 +130,16 @@ if (is_array($config['qinqs']['qinqentry']) && count($config['qinqs']['qinqentry
/* add PPP interfaces */
if (is_array($config['ppps']['ppp']) && count($config['ppps']['ppp'])) {
foreach ($config['ppps']['ppp'] as $pppid => $ppp) {
$portname = basename($ppp['port']);
$portname = $ppp['if'];
$portlist[$portname] = $ppp;
$portlist[$portname]['isppp'] = true;
$portlist[$portname]['descr'] = "PPP " . basename($ppp['port']);
$ports_base = basename($ppp['ports']);
if (isset($ppp['descr']))
$portlist[$portname]['descr'] = strtoupper($ppp['if']). "({$ports_base}) - {$ppp['descr']}";
else if (isset($ppp['username']))
$portlist[$portname]['descr'] = strtoupper($ppp['if']). "({$ports_base}) - {$ppp['username']}";
else
$portlist[$portname]['descr'] = strtoupper($ppp['if']). "({$ports_base})";
}
}
@ -203,11 +209,9 @@ if ($_POST['apply']) {
$reloadif = true;
}
$config['interfaces'][$ifname]['if'] = $ifport;
if (file_exists("/dev/{$ifport}")) {
$config['interfaces'][$ifname]['if'] = basename($portlist[$ifport]['port']);
$config['interfaces'][$ifname]['ipaddr'] = "ppp";
}
if (isset($portlist[$ifport]['isppp']))
$config['interfaces'][$ifname]['ipaddr'] = $portlist[$ifport]['type'];
/* check for wireless interfaces, set or clear ['wireless'] */
if (preg_match($g['wireless_regex'], $ifport)) {
if (!is_array($config['interfaces'][$ifname]['wireless']))
@ -219,6 +223,7 @@ if ($_POST['apply']) {
/* make sure there is a descr for all interfaces */
if (!isset($config['interfaces'][$ifname]['descr']))
$config['interfaces'][$ifname]['descr'] = strtoupper($ifname);
if ($reloadif == true) {
if (preg_match($g['wireless_regex'], $ifport))
interface_sync_wireless_clones($config['interfaces'][$ifname], false);
@ -265,23 +270,23 @@ if ($_GET['act'] == "del") {
}
if (count($config['filter']['rule']) > 0) {
foreach ($config['filter']['rule'] as $x => $rule) {
if($rule['interface'] == $id)
unset($config['filter']['rule'][$x]);
foreach ($config['filter']['rule'] as $x => $rule) {
if($rule['interface'] == $id)
unset($config['filter']['rule'][$x]);
}
}
if (is_array($config['nat']['advancedoutbound']) && count($config['nat']['advancedoutbound']['rule']) > 0) {
foreach ($config['nat']['advancedoutbound']['rule'] as $x => $rule) {
if($rule['interface'] == $id)
unset($config['nat']['advancedoutbound']['rule'][$x]['interface']);
foreach ($config['nat']['advancedoutbound']['rule'] as $x => $rule) {
if($rule['interface'] == $id)
unset($config['nat']['advancedoutbound']['rule'][$x]['interface']);
}
}
if (is_array($config['nat']['rule']) && count($config['nat']['rule']) > 0) {
foreach ($config['nat']['rule'] as $x => $rule) {
if($rule['interface'] == $id)
unset($config['nat']['rule'][$x]['interface']);
if (is_array($config['nat']['rule']) && count($config['nat']['rule']) > 0) {
foreach ($config['nat']['rule'] as $x => $rule) {
if($rule['interface'] == $id)
unset($config['nat']['rule'][$x]['interface']);
}
}
}
write_config();
@ -394,11 +399,11 @@ if(file_exists("/var/run/interface_mismatch_reboot_needed"))
$tab_array[2] = array("Wireless", false, "interfaces_wireless.php");
$tab_array[3] = array("VLANs", false, "interfaces_vlan.php");
$tab_array[4] = array("QinQs", false, "interfaces_qinq.php");
$tab_array[5] = array("PPP", false, "interfaces_ppp.php");
$tab_array[6] = array("GRE", false, "interfaces_gre.php");
$tab_array[7] = array("GIF", false, "interfaces_gif.php");
$tab_array[8] = array("Bridges", false, "interfaces_bridge.php");
$tab_array[9] = array("LAGG", false, "interfaces_lagg.php");
$tab_array[5] = array("PPPs", false, "interfaces_ppps.php");
$tab_array[7] = array("GRE", false, "interfaces_gre.php");
$tab_array[8] = array("GIF", false, "interfaces_gif.php");
$tab_array[9] = array("Bridges", false, "interfaces_bridge.php");
$tab_array[10] = array("LAGG", false, "interfaces_lagg.php");
display_top_tabs($tab_array);
?>
</td></tr>
@ -422,45 +427,44 @@ if(file_exists("/var/run/interface_mismatch_reboot_needed"))
<td valign="middle" class="listr">
<select name="<?=$ifname;?>" id="<?=$ifname;?>">
<?php foreach ($portlist as $portname => $portinfo): ?>
<option value="<?=$portname;?>" <?php if ($portname == $iface['if']) echo "selected";?>>
<?php if ($portinfo['isvlan']) {
$descr = "VLAN {$portinfo['tag']} on {$portinfo['if']}";
if ($portinfo['descr'])
$descr .= " (" . $portinfo['descr'] . ")";
echo htmlspecialchars($descr);
} elseif ($portinfo['iswlclone']) {
$descr = $portinfo['cloneif'];
if ($portinfo['descr'])
$descr .= " (" . $portinfo['descr'] . ")";
echo htmlspecialchars($descr);
} elseif ($portinfo['isppp']) {
echo htmlspecialchars($portinfo['descr']);
} elseif ($portinfo['isbridge']) {
$descr = strtoupper($portinfo['bridgeif']);
if ($portinfo['descr'])
$descr .= " (" . $portinfo['descr'] . ")";
echo htmlspecialchars($descr);
} elseif ($portinfo['isgre']) {
$descr = "GRE {$portinfo['remote-addr']}";
if ($portinfo['descr'])
$descr .= " (" . $portinfo['descr'] . ")";
echo htmlspecialchars($descr);
} elseif ($portinfo['isgif']) {
$descr = "GRE {$portinfo['remote-addr']}";
if ($portinfo['descr'])
$descr .= " (" . $portinfo['descr'] . ")";
echo htmlspecialchars($descr);
} elseif ($portinfo['islagg']) {
$descr = strtoupper($portinfo['laggif']);
if ($portinfo['descr'])
$descr .= " (" . $portinfo['descr'] . ")";
echo htmlspecialchars($descr);
} elseif ($portinfo['isqinq']) {
echo htmlspecialchars($portinfo['descr']);
} else
echo htmlspecialchars($portname . " (" . $portinfo['mac'] . ")");
?>
</option>
<option value="<?=$portname;?>" <?php if ($portname == $iface['if']) echo " selected";?>>
<?php if ($portinfo['isvlan']) {
$descr = "VLAN {$portinfo['tag']} on {$portinfo['if']}";
if ($portinfo['descr'])
$descr .= " (" . $portinfo['descr'] . ")";
echo htmlspecialchars($descr);
} elseif ($portinfo['iswlclone']) {
$descr = $portinfo['cloneif'];
if ($portinfo['descr'])
$descr .= " (" . $portinfo['descr'] . ")";
echo htmlspecialchars($descr);
} elseif ($portinfo['isppp']) {
echo htmlspecialchars($portinfo['descr']);
} elseif ($portinfo['isbridge']) {
$descr = strtoupper($portinfo['bridgeif']);
if ($portinfo['descr'])
$descr .= " (" . $portinfo['descr'] . ")";
echo htmlspecialchars($descr);
} elseif ($portinfo['isgre']) {
$descr = "GRE {$portinfo['remote-addr']}";
if ($portinfo['descr'])
$descr .= " (" . $portinfo['descr'] . ")";
echo htmlspecialchars($descr);
} elseif ($portinfo['isgif']) {
$descr = "GRE {$portinfo['remote-addr']}";
if ($portinfo['descr'])
$descr .= " (" . $portinfo['descr'] . ")";
echo htmlspecialchars($descr);
} elseif ($portinfo['islagg']) {
$descr = strtoupper($portinfo['laggif']);
if ($portinfo['descr'])
$descr .= " (" . $portinfo['descr'] . ")";
echo htmlspecialchars($descr);
} elseif ($portinfo['isqinq']) {
echo htmlspecialchars($portinfo['descr']);
} else
echo htmlspecialchars($portname . " (" . $portinfo['mac'] . ")");
?></option>
<?php endforeach; ?>
</select>
</td>

View File

@ -91,7 +91,7 @@ include("head.inc");
$tab_array[2] = array("Wireless", false, "interfaces_wireless.php");
$tab_array[3] = array("VLANs", false, "interfaces_vlan.php");
$tab_array[4] = array("QinQs", false, "interfaces_qinq.php");
$tab_array[5] = array("PPP", false, "interfaces_ppp.php");
$tab_array[5] = array("PPPs", false, "interfaces_ppps.php");
$tab_array[6] = array("GRE", false, "interfaces_gre.php");
$tab_array[7] = array("GIF", false, "interfaces_gif.php");
$tab_array[8] = array("Bridges", true, "interfaces_bridge.php");

View File

@ -73,7 +73,7 @@ if ($_GET['act'] == "del") {
}
}
$pgtitle = array("Interfaces","gif");
$pgtitle = array("Interfaces","GIF");
include("head.inc");
?>
@ -90,7 +90,7 @@ include("head.inc");
$tab_array[2] = array("Wireless", false, "interfaces_wireless.php");
$tab_array[3] = array("VLANs", false, "interfaces_vlan.php");
$tab_array[4] = array("QinQs", false, "interfaces_qinq.php");
$tab_array[5] = array("PPP", false, "interfaces_ppp.php");
$tab_array[5] = array("PPPs", false, "interfaces_ppps.php");
$tab_array[6] = array("GRE", false, "interfaces_gre.php");
$tab_array[7] = array("GIF", true, "interfaces_gif.php");
$tab_array[8] = array("Bridges", false, "interfaces_bridge.php");

View File

@ -90,7 +90,7 @@ include("head.inc");
$tab_array[2] = array("Wireless", false, "interfaces_wireless.php");
$tab_array[3] = array("VLANs", false, "interfaces_vlan.php");
$tab_array[4] = array("QinQs", false, "interfaces_qinq.php");
$tab_array[5] = array("PPP", false, "interfaces_ppp.php");
$tab_array[5] = array("PPPs", false, "interfaces_ppps.php");
$tab_array[6] = array("GRE", true, "interfaces_gre.php");
$tab_array[7] = array("GIF", false, "interfaces_gif.php");
$tab_array[8] = array("Bridges", false, "interfaces_bridge.php");

View File

@ -70,18 +70,18 @@ include("head.inc");
<table width="100%" border="0" cellpadding="0" cellspacing="0">
<tr><td>
<?php
$tab_array = array();
$tab_array[0] = array("Interface assignments", false, "interfaces_assign.php");
$tab_array = array();
$tab_array[0] = array("Interface assignments", false, "interfaces_assign.php");
$tab_array[1] = array("Interface Groups", true, "interfaces_groups.php");
$tab_array[2] = array("Wireless", false, "interfaces_wireless.php");
$tab_array[3] = array("VLANs", false, "interfaces_vlan.php");
$tab_array[4] = array("QinQs", false, "interfaces_qinq.php");
$tab_array[5] = array("PPP", false, "interfaces_ppp.php");
$tab_array[6] = array("GRE", false, "interfaces_gre.php");
$tab_array[7] = array("GIF", false, "interfaces_gif.php");
$tab_array[8] = array("Bridges", false, "interfaces_bridge.php");
$tab_array[9] = array("LAGG", false, "interfaces_lagg.php");
display_top_tabs($tab_array);
$tab_array[3] = array("VLANs", false, "interfaces_vlan.php");
$tab_array[4] = array("QinQs", false, "interfaces_qinq.php");
$tab_array[5] = array("PPPs", false, "interfaces_ppps.php");
$tab_array[6] = array("GRE", false, "interfaces_gre.php");
$tab_array[7] = array("GIF", false, "interfaces_gif.php");
$tab_array[8] = array("Bridges", false, "interfaces_bridge.php");
$tab_array[9] = array("LAGG", false, "interfaces_lagg.php");
display_top_tabs($tab_array);
?>
</td></tr>
<tr>

View File

@ -96,11 +96,11 @@ include("head.inc");
$tab_array[2] = array("Wireless", false, "interfaces_wireless.php");
$tab_array[3] = array("VLANs", false, "interfaces_vlan.php");
$tab_array[4] = array("QinQs", false, "interfaces_qinq.php");
$tab_array[5] = array("PPP", false, "interfaces_ppp.php");
$tab_array[5] = array("PPPs", false, "interfaces_ppps.php");
$tab_array[6] = array("GRE", false, "interfaces_gre.php");
$tab_array[7] = array("GIF", false, "interfaces_gif.php");
$tab_array[8] = array("Bridges", false, "interfaces_bridge.php");
$tab_array[9] = array("LAGG", true, "interfaces_lagg.php");
$tab_array[9] = array("LAGG", true, "interfaces_lagg.php");
display_top_tabs($tab_array);
?>
</td></tr>

View File

@ -1,328 +0,0 @@
<?php
/*
interfaces_ppp_edit.php
part of pfSense(http://pfsense.org)
Originally written by Adam Lebsack <adam at holonyx dot com>
Changes by Chris Buechler <cmb at pfsense dot org>
Additions by Scott Ullrich <sullrich@pfsense.org>
Copyright (C) 2004-2009 BSD Perimeter LLC.
Copyright (C) 2009 Scott Ullrich
All rights reserved.
Redistribution and use in source and binary forms, with or without
modification, are permitted provided that the following conditions are met:
1. Redistributions of source code must retain the above copyright notice,
this list of conditions and the following disclaimer.
2. Redistributions in binary form must reproduce the above copyright
notice, this list of conditions and the following disclaimer in the
documentation and/or other materials provided with the distribution.
THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES,
INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY
AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY,
OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
POSSIBILITY OF SUCH DAMAGE.
*/
/*
pfSense_MODULE: interfaces
*/
##|+PRIV
##|*IDENT=page-interfaces-ppp-edit
##|*NAME=Interfaces: PPP: Edit page
##|*DESCR=Allow access to the 'Interfaces: PPP: Edit' page.
##|*MATCH=interfaces_ppp_edit.php*
##|-PRIV
require("guiconfig.inc");
if (!is_array($config['ppps']['ppp']))
$config['ppps']['ppp'] = array();
$a_ppps = &$config['ppps']['ppp'];
$id = $_GET['id'];
if (isset($_POST['id']))
$id = $_POST['id'];
if (isset($id) && $a_ppps[$id]) {
$pconfig['port'] = $a_ppps[$id]['port'];
$pconfig['initstr'] = base64_decode($a_ppps[$id]['initstr']);
$pconfig['simpin'] = $a_ppps[$id]['simpin'];
$pconfig['pin-wait'] = $a_ppps[$id]['pin-wait'];
$pconfig['apn'] = $a_ppps[$id]['apn'];
$pconfig['apnum'] = $a_ppps[$id]['apnum'];
$pconfig['phone'] = $a_ppps[$id]['phone'];
$pconfig['username'] = $a_ppps[$id]['username'];
$pconfig['password'] = $a_ppps[$id]['password'];
$pconfig['localip'] = $a_ppps[$id]['localip'];
$pconfig['gateway'] = $a_ppps[$id]['gateway'];
if (isset($a_ppps[$id]['defaultgw']))
$pconfig['defaultgw'] = true;
$pconfig['connect-timeout'] = $a_ppps[$id]['connect-timeout'];
$pconfig['descr'] = $a_ppps[$id]['descr'];
}
if ($_POST) {
unset($input_errors);
$pconfig = $_POST;
/* input validation */
$reqdfields = explode(" ", "port");
$reqdfieldsn = explode(",", "Serial Port");
do_input_validation($_POST, $reqdfields, $reqdfieldsn, &$input_errors);
foreach ($a_ppps as $ppp) {
if (isset($id) && ($a_ppps[$id]) && ($a_ppps[$id] === $ppp))
continue;
if ($ppp['port'] == $_POST['port']) {
$input_errors[] = "Port is in use";
break;
}
}
if (!$input_errors) {
$ppp = array();
$ppp['port'] = $_POST['port'];
if ($_POST['initstr'] <> "")
$ppp['initstr'] = base64_encode($_POST['initstr']);
else
unset($ppp['initstr']);
if ($_POST['simpin'] <> "") {
$ppp['simpin'] = $_POST['simpin'];
$ppp['pin-wait'] = $_POST['pin-wait'];
} else {
unset($ppp['simpin']);
unset($ppp['pin-wait']);
}
$ppp['apn'] = $_POST['apn'];
if ($ppp['apn'] <> ""){
if ($_POST['apnum'] <> "")
$ppp['apnum'] = $_POST['apnum'];
else
$ppp['apnum'] = "1";
} else {
unset($ppp['apn']);
unset($ppp['apnum']);
}
$ppp['phone'] = $_POST['phone'];
$ppp['username'] = $_POST['username'];
$ppp['password'] = $_POST['password'];
$ppp['localip'] = $_POST['localip'];
$ppp['gateway'] = $_POST['gateway'];
if ($_POST['defaultgw'] == "on")
$ppp['defaultgw'] = true;
else
unset($ppp['defaultgw']);
if ($_POST['connect-timeout'] <> "")
$ppp['connect-timeout'] = $_POST['connect-timeout'];
else
unset($ppp['connect-timeout']);
$ppp['descr'] = $_POST['descr'];
$iflist = get_configured_interface_list();
foreach ($iflist as $if) {
if ($config['interfaces'][$if]['if'] == basename($a_ppps[$id]['port'])) {
$config['interfaces'][$if]['if'] = basename($ppp['port']);
$thisif = $if;
}
}
if (isset($id) && $a_ppps[$id])
$a_ppps[$id] = $ppp;
else
$a_ppps[] = $ppp;
write_config();
if (!empty($thisif))
interface_ppp_configure($thisif);
header("Location: interfaces_ppp.php");
exit;
}
}
$pgtitle = "Interfaces: PPP: Edit";
include("head.inc");
?>
<body link="#0000CC" vlink="#0000CC" alink="#0000CC">
<?php include("fbegin.inc"); ?>
<?php if ($input_errors) print_input_errors($input_errors); ?>
<form action="interfaces_ppp_edit.php" method="post" name="iform" id="iform">
<script src="/javascript/scriptaculous/prototype.js" type="text/javascript">
</script>
<script type="text/javascript">
function prefill_att() {
$('initstr').value = "Q0V1E1S0=0&C1&D2+FCLASS=0";
$('apn').value = "ISP.CINGULAR";
$('apnum').value = "1";
$('phone').value = "*99#";
$('username').value = "att";
$('password').value = "att";
}
function prefill_sprint() {
$('initstr').value = "E1Q0";
$('apn').value = "";
$('apnum').value = "";
$('phone').value = "#777";
$('username').value = "sprint";
$('password').value = "sprint";
}
function prefill_vzw() {
$('initstr').value = "E1Q0s7=60";
$('apn').value = "";
$('apnum').value = "";
$('phone').value = "#777";
$('username').value = "123@vzw3g.com";
$('password').value = "vzw";
}
</script>
<table width="100%" border="0" cellpadding="6" cellspacing="0">
<tr>
<td colspan="2" valign="top" class="listtopic">PPP configuration</td>
</tr>
<tr>
<td width="22%" valign="top" class="vncellreq">Parent interface</td>
<td width="78%" class="vtable">
<select name="port" id="port" class="formselect">
<?php
$portlist = glob("/dev/cua*");
$modems = glob("/dev/modem*");
$portlist = array_merge($portlist, $modems);
foreach ($portlist as $port) {
if(preg_match("/\.(lock|init)$/", $port))
continue;
echo "<option value=\"".trim($port)."\"";
if ($pconfig['port'] == $port)
echo "selected";
echo ">{$port}</option>";
}
?>
</select>
<p/>
Pre-fill connection information:
<a href='#' onClick='javascript:prefill_att();'>ATT</A>
<a href='#' onClick='javascript:prefill_sprint();'>Sprint</A>
<a href='#' onClick='javascript:prefill_vzw();'>Verizon</A>
</td>
</tr>
<tr>
<td width="22%" valign="top" class="vncell">Link Type</td>
<td width="78%" class="vtable">
<input type="checkbox" value="on" id="defaultgw" name="defaultgw" <?php if (isset($pconfig['defaultgw'])) echo "checked"; ?>>This link will be used as the default gateway.
</td>
</tr>
<tr>
<td width="22%" valign="top" class="vncell">Init String</td>
<td width="78%" class="vtable">
<input type="text" size="40" class="formfld unknown" id="initstr" name="initstr" value="<?=htmlspecialchars($pconfig['initstr']);?>">
<br><span class="vexpl">Note: Enter the modem initialization string here. Do NOT include the "AT" string at the beginning of the command.</span>
</td>
</tr>
<tr>
<td width="22%" valign="top" class="vncell">Sim PIN</td>
<td width="78%" class="vtable">
<input name="simpin" type="text" class="formfld unknown" id="simpin" size="12" value="<?=htmlspecialchars($pconfig['simpin']);?>">
</td>
</tr>
<tr>
<td width="22%" valign="top" class="vncell">Sim PIN wait</td>
<td width="78%" class="vtable">
<input name="pin-wait" type="text" class="formfld unknown" id="pin-wait" size="2" value="<?=htmlspecialchars($pconfig['pin-wait']);?>">
<br><span class="vexpl">Note: Time to wait for SIM to discover network after PIN is sent to SIM (seconds).</span>
</td>
</tr>
<tr>
<td width="22%" valign="top" class="vncell">Access Point Name (APN)</td>
<td width="78%" class="vtable">
<input name="apn" type="text" class="formfld unknown" id="apn" size="40" value="<?=htmlspecialchars($pconfig['apn']);?>">
</td>
</tr>
<tr>
<td width="22%" valign="top" class="vncell">APN number (optional)</td>
<td width="78%" class="vtable">
<input name="apnum" type="text" class="formfld unknown" id="apnum" size="2" value="<?=htmlspecialchars($pconfig['apnum']);?>">
<br><span class="vexpl">Note: Defaults to 1 if you set APN above. Ignored if you set no APN above.</span>
</td>
</tr>
<tr>
<td width="22%" valign="top" class="vncell">Phone Number</td>
<td width="78%" class="vtable">
<input name="phone" type="text" class="formfld unknown" id="phone" size="40" value="<?=htmlspecialchars($pconfig['phone']);?>">
<br><span class="vexpl">Note: Typically (*99# or *99***# or *99***1#) for GSM networks and *777 for CDMA networks</span>
</td>
</tr>
<tr>
<td width="22%" valign="top" class="vncell">Username</td>
<td width="78%" class="vtable">
<input name="username" type="text" class="formfld user" id="username" size="20" value="<?=htmlspecialchars($pconfig['username']);?>">
</td>
</tr>
<tr>
<td width="22%" valign="top" class="vncell">Password</td>
<td width="78%" class="vtable">
<input name="password" type="password" class="formfld pwd" id="password" value="<?=htmlspecialchars($pconfig['password']);?>">
</td>
</tr>
<tr>
<td width="22%" valign="top" class="vncell">Local IP</td>
<td width="78%" class="vtable">
<input name="localip" type="text" class="formfld unknown" id="localip" size="40" value="<?=htmlspecialchars($pconfig['localip']);?>">
<br><span class="vexpl">Note: Enter your IP address here if it is not automatically assigned.</span>
</td>
</tr>
<tr>
<td width="22%" valign="top" class="vncell">Remote IP (Gateway)</td>
<td width="78%" class="vtable">
<input name="gateway" type="text" class="formfld unknown" id="gateway" size="40" value="<?=htmlspecialchars($pconfig['gateway']);?>">
<br><span class="vexpl">Note: Enter the remote IP here if not automatically assigned. This is where the packets will be routed.</span>
</td>
</tr>
<tr>
<tr>
<td width="22%" valign="top" class="vncell">Connection Timeout</td>
<td width="78%" class="vtable">
<input name="connect-timeout" type="text" class="formfld unknown" id="connect-timeout" size="2" value="<?=htmlspecialchars($pconfig['connect-timeout']);?>">
<br><span class="vexpl">Note: Enter timeout in seconds for connection to be established (sec.) Default is 45 sec.</span>
</td>
</tr>
<tr>
<td width="22%" valign="top" class="vncell">Description</td>
<td width="78%" class="vtable">
<input name="descr" type="text" class="formfld unknown" id="descr" size="40" value="<?=htmlspecialchars($pconfig['descr']);?>">
<br><span class="vexpl">You may enter a description here for your reference (not parsed).</span>
</td>
</tr>
<tr>
<td width="22%" valign="top">&nbsp;</td>
<td width="78%">
<input name="Submit" type="submit" class="formbtn" value="Save">
<input type="button" value="Cancel" onclick="history.back()">
<?php if (isset($id) && $a_ppps[$id]): ?>
<input name="id" type="hidden" value="<?=$id;?>">
<?php endif; ?>
</td>
</tr>
</table>
</form>
<?php include("fend.inc"); ?>
</body>
</html>

View File

@ -1,13 +1,10 @@
<?php
/* $Id$ */
/*
interfaces_lan.php
part of pfSense(http://pfsense.org)
interfaces_ppps.php
part of m0n0wall (http://m0n0.ch/wall)
Originally written by Adam Lebsack <adam at holonyx dot com>
Changes by Chris Buechler <cmb at pfsense dot org>
Copyright (C) 2004-2008 BSD Perimeter LLC.
Copyright (C) 2004-2009 Scott Ullrich
Copyright (C) 2003-2004 Manuel Kasper <mk@neon1.net>.
All rights reserved.
Redistribution and use in source and binary forms, with or without
@ -32,15 +29,15 @@
POSSIBILITY OF SUCH DAMAGE.
*/
/*
pfSense_BUILDER_BINARIES: /bin/kill /sbin/ifconfig
pfSense_BUILDER_BINARIES: /sbin/ifconfig
pfSense_MODULE: interfaces
*/
##|+PRIV
##|*IDENT=page-interfaces-ppp
##|*NAME=Interfaces: PPP page
##|*DESCR=Allow access to the 'Interfaces: PPP' page.
##|*MATCH=interfaces_ppp.php*
##|*IDENT=page-interfaces-ppps
##|*NAME=Interfaces: ppps page
##|*DESCR=Allow access to the 'Interfaces: ppps' page.
##|*MATCH=interfaces_ppps.php*
##|-PRIV
require("guiconfig.inc");
@ -54,7 +51,7 @@ function ppp_inuse($num) {
global $config, $g, $a_ppps;
$iflist = get_configured_interface_list(false, true);
foreach ($iflist as $if) {
if ($config['interfaces'][$if]['if'] == $a_ppps[$num]['port'])
if (isset($config['interfaces'][$if]['ptpid']) && $config['interfaces'][$if]['ptpid'] == $a_ppps[$num]['ptpid'])
return true;
}
return false;
@ -63,16 +60,18 @@ function ppp_inuse($num) {
if ($_GET['act'] == "del") {
/* check if still in use */
if (ppp_inuse($_GET['id'])) {
$input_errors[] = "This PPP interface cannot be deleted because it is still being used as an interface.";
$input_errors[] = "This point-to-point link cannot be deleted because it is still being used as an interface.";
} else {
unset($a_ppps[$_GET['id']]['pppoe-reset-type']);
handle_pppoe_reset($a_ppps[$_GET['id']]);
unset($a_ppps[$_GET['id']]);
write_config();
header("Location: interfaces_ppp.php");
header("Location: interfaces_ppps.php");
exit;
}
}
$pgtitle = "Interfaces: PPP";
$pgtitle = "Interfaces: PPPs";
include("head.inc");
?>
@ -89,7 +88,7 @@ include("head.inc");
$tab_array[2] = array("Wireless", false, "interfaces_wireless.php");
$tab_array[3] = array("VLANs", false, "interfaces_vlan.php");
$tab_array[4] = array("QinQs", false, "interfaces_qinq.php");
$tab_array[5] = array("PPP", true, "interfaces_ppp.php");
$tab_array[5] = array("PPPs", false, "interfaces_ppps.php");
$tab_array[6] = array("GRE", false, "interfaces_gre.php");
$tab_array[7] = array("GIF", false, "interfaces_gif.php");
$tab_array[8] = array("Bridges", false, "interfaces_bridge.php");
@ -102,25 +101,29 @@ include("head.inc");
<div id="mainarea">
<table class="tabcont" width="100%" border="0" cellpadding="0" cellspacing="0">
<tr>
<td width="20%" class="listhdrr">Serial Port</td>
<td width="20%" class="listhdrr">Type</td>
<td width="20%" class="listhdrr">Interface(s)/Port(s)</td>
<td width="40%" class="listhdr">Description</td>
<td width="10%" class="list"></td>
</tr>
<?php $i = 0; foreach ($a_ppps as $id => $ppp): ?>
<tr ondblclick="document.location='interfaces_ppp_edit.php?id=<?=$i;?>'">
<tr ondblclick="document.location='interfaces_ppps_edit.php?id=<?=$i;?>'">
<td class="listr">
<?=htmlspecialchars($ppp['if']);?>
</td>
<td class="listr">
<?=htmlspecialchars($ppp['port']);?>
<?=htmlspecialchars($ppp['ports']);?>
</td>
<td class="listbg">
<?=htmlspecialchars($ppp['descr']);?>&nbsp;
</td>
<td valign="middle" nowrap class="list"> <a href="interfaces_ppp_edit.php?id=<?=$i;?>"><img src="./themes/<?= $g['theme']; ?>/images/icons/icon_e.gif" width="17" height="17" border="0"></a>
&nbsp;<a href="interfaces_ppp.php?act=del&id=<?=$i;?>" onclick="return confirm('Do you really want to delete this PPP interface?')"><img src="./themes/<?= $g['theme']; ?>/images/icons/icon_x.gif" width="17" height="17" border="0"></a></td>
<td valign="middle" nowrap class="list"> <a href="interfaces_ppps_edit.php?id=<?=$i;?>"><img src="./themes/<?= $g['theme']; ?>/images/icons/icon_e.gif" width="17" height="17" border="0"></a>
&nbsp;<a href="interfaces_ppps.php?act=del&id=<?=$i;?>" onclick="return confirm('Do you really want to delete this PPP interface?')"><img src="./themes/<?= $g['theme']; ?>/images/icons/icon_x.gif" width="17" height="17" border="0"></a></td>
</tr>
<?php $i++; endforeach; ?>
<tr>
<td class="list" colspan="2">&nbsp;</td>
<td class="list"> <a href="interfaces_ppp_edit.php"><img src="./themes/<?= $g['theme']; ?>/images/icons/icon_plus.gif" width="17" height="17" border="0"></a></td>
<td class="list" colspan="3">&nbsp;</td>
<td class="list"> <a href="interfaces_ppps_edit.php"><img src="./themes/<?= $g['theme']; ?>/images/icons/icon_plus.gif" width="17" height="17" border="0"></a></td>
</tr>
</table>
</div>

View File

@ -0,0 +1,789 @@
<?php
/* $Id$ */
/*
interfaces_ppps_edit.php
part of m0n0wall (http://m0n0.ch/wall)
Copyright (C) 2003-2004 Manuel Kasper <mk@neon1.net>.
All rights reserved.
Copyright (C) 2010 Gabriel B. <gnoahb@gmail.com>.
All rights reserved.
Redistribution and use in source and binary forms, with or without
modification, are permitted provided that the following conditions are met:
1. Redistributions of source code must retain the above copyright notice,
this list of conditions and the following disclaimer.
2. Redistributions in binary form must reproduce the above copyright
notice, this list of conditions and the following disclaimer in the
documentation and/or other materials provided with the distribution.
THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES,
INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY
AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY,
OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
POSSIBILITY OF SUCH DAMAGE.
*/
/*
pfSense_MODULE: interfaces
*/
##|+PRIV
##|*IDENT=page-interfaces-ppps-edit
##|*NAME=Interfaces: PPPs: Edit page
##|*DESCR=Allow access to the 'Interfaces: PPPs: Edit' page.
##|*MATCH=interfaces_ppps_edit.php*
##|-PRIV
require("guiconfig.inc");
require("functions.inc");
define("CRON_MONTHLY_PATTERN", "0 0 1 * *");
define("CRON_WEEKLY_PATTERN", "0 0 * * 0");
define("CRON_DAILY_PATTERN", "0 0 * * *");
define("CRON_HOURLY_PATTERN", "0 * * * *");
if (!is_array($config['ppps']['ppp']))
$config['ppps']['ppp'] = array();
$a_ppps = &$config['ppps']['ppp'];
$portlist = get_interface_list();
$id = $_GET['id'];
if (isset($_POST['id']))
$id = $_POST['id'];
if (isset($id) && $a_ppps[$id]) {
$pconfig['ptpid'] = $a_ppps[$id]['ptpid'];
$pconfig['type'] = $a_ppps[$id]['type'];
//$pconfig['if'] = $a_ppps[$id]['if'];
$pconfig['interfaces'] = $a_ppps[$id]['ports'];
$pconfig['username'] = $a_ppps[$id]['username'];
$pconfig['password'] = base64_decode($a_ppps[$id]['password']);
if (isset($a_ppps[$id]['ondemand']))
$pconfig['ondemand'] = true;
$pconfig['idletimeout'] = $a_ppps[$id]['idletimeout'];
$pconfig['uptime'] = $a_ppps[$id]['uptime'];
$pconfig['descr'] = $a_ppps[$id]['descr'];
$pconfig['bandwidth'] = explode(",",$a_ppps[$id]['bandwidth']);
$pconfig['mtu'] = explode(",",$a_ppps[$id]['mtu']);
$pconfig['mru'] = explode(",",$a_ppps[$id]['mru']);
$pconfig['mrru'] = $a_ppps[$id]['mrru'];
if (isset($a_ppps[$id]['shortseq']))
$pconfig['shortseq'] = true;
if (isset($a_ppps[$id]['acfcomp']))
$pconfig['acfcomp'] = true;
if (isset($a_ppps[$id]['protocomp']))
$pconfig['protocomp'] = true;
if (isset($a_ppps[$id]['vjcomp']))
$pconfig['vjcomp'] = true;
if (isset($a_ppps[$id]['tcpmssfix']))
$pconfig['tcpmssfix'] = true;
switch($a_ppps[$id]['type']) {
case "ppp":
$pconfig['initstr'] = base64_decode($a_ppps[$id]['initstr']);
$pconfig['simpin'] = $a_ppps[$id]['simpin'];
$pconfig['pin-wait'] = $a_ppps[$id]['pin-wait'];
$pconfig['apn'] = $a_ppps[$id]['apn'];
$pconfig['apnum'] = $a_ppps[$id]['apnum'];
$pconfig['phone'] = $a_ppps[$id]['phone'];
$pconfig['connect-timeout'] = $a_ppps[$id]['connect-timeout'];
$pconfig['localip'] = explode(",",$a_ppps[$id]['localip']);
$pconfig['gateway'] = explode(",",$a_ppps[$id]['gateway']);
break;
case "l2tp":
case "pptp":
$pconfig['localip'] = explode(",",$a_ppps[$id]['localip']);
foreach ($pconfig['localip'] as $key => $value){
if ($value == "dhcp")
$pconfig['localip'][$key] = "";
}
$pconfig['subnet'] = explode(",",$a_ppps[$id]['subnet']);
$pconfig['gateway'] = explode(",",$a_ppps[$id]['gateway']);
if (isset($a_ppps[$id]['dhcp']))
$pconfig['pptp_dhcp'] = true;
break;
case "pppoe":
$pconfig['provider'] = $a_ppps[$id]['provider'];
/* ================================================ */
/* = force a connection reset at a specific time? = */
/* ================================================ */
if (isset($a_ppps[$id]['pppoe-reset-type'])) {
$pconfig['pppoe-reset-type'] = $a_ppps[$id]['pppoe-reset-type'];
$itemhash = getMPDCRONSettings($a_ppps[$id]['if']);
$cronitem = $itemhash['ITEM'];
if (isset($cronitem)) {
$resetTime = "{$cronitem['minute']} {$cronitem['hour']} {$cronitem['mday']} {$cronitem['month']} {$cronitem['wday']}";
} else {
$resetTime = NULL;
}
if ($a_ppps[$id]['pppoe-reset-type'] == "custom") {
$resetTime_a = split(" ", $resetTime);
$pconfig['pppoe_pr_custom'] = true;
$pconfig['pppoe_resetminute'] = $resetTime_a[0];
$pconfig['pppoe_resethour'] = $resetTime_a[1];
/* just initialize $pconfig['pppoe_resetdate'] if the
* coresponding item contains appropriate numeric values.
*/
if ($resetTime_a[2] <> "*" && $resetTime_a[3] <> "*")
$pconfig['pppoe_resetdate'] = "{$resetTime_a[3]}/{$resetTime_a[2]}/" . date("Y");
} else if ($a_ppps[$id]['pppoe-reset-type'] == "preset") {
$pconfig['pppoe_pr_preset'] = true;
switch ($resetTime) {
case CRON_MONTHLY_PATTERN:
$pconfig['pppoe_monthly'] = true;
break;
case CRON_WEEKLY_PATTERN:
$pconfig['pppoe_weekly'] = true;
break;
case CRON_DAILY_PATTERN:
$pconfig['pppoe_daily'] = true;
break;
case CRON_HOURLY_PATTERN:
$pconfig['pppoe_hourly'] = true;
break;
}
}
}
break;
}
} else
$pconfig['ptpid'] = interfaces_ptpid_next();
if ($_POST) {
unset($input_errors);
$pconfig = $_POST;
/* okay first of all, cause we are just hiding the PPPoE HTML
* fields releated to PPPoE resets, we are going to unset $_POST
* vars, if the reset feature should not be used. Otherwise the
* data validation procedure below, may trigger a false error
* message.
*/
if (empty($_POST['pppoe-reset-type'])) {
unset($_POST['pppoe_resethour']);
unset($_POST['pppoe_resetminute']);
unset($_POST['pppoe_resetdate']);
unset($_POST['pppoe_pr_preset_val']);
}
/* input validation */
switch($_POST['type']) {
case "ppp":
$reqdfields = explode(" ", "interfaces phone");
$reqdfieldsn = explode(",", "Link Interface(s),Phone Number");
do_input_validation($_POST, $reqdfields, $reqdfieldsn, &$input_errors);
break;
case "pppoe":
if ($_POST['ondemand']) {
$reqdfields = explode(" ", "interfaces username password ondemand idletimeout");
$reqdfieldsn = explode(",", "Link Interface(s),Username,Password,Dial on demand,Idle timeout value");
} else {
$reqdfields = explode(" ", "interfaces username password");
$reqdfieldsn = explode(",", "Link Interface(s),Username,Password");
}
do_input_validation($_POST, $reqdfields, $reqdfieldsn, &$input_errors);
break;
case "l2tp":
case "pptp":
if ($_POST['ondemand']) {
$reqdfields = explode(" ", "interfaces username password localip subnet gateway ondemand idletimeout");
$reqdfieldsn = explode(",", "Link Interface(s),Username,Password,Local IP address,Subnet,Remote IP address,Dial on demand,Idle timeout value");
} else {
$reqdfields = explode(" ", "interfaces username password localip subnet gateway");
$reqdfieldsn = explode(",", "Link Interface(s),Username,Password,Local IP address,Subnet,Remote IP address");
}
do_input_validation($_POST, $reqdfields, $reqdfieldsn, &$input_errors);
break;
default:
$input_errors[] = "Please choose a Link Type.";
break;
}
if ($_POST['type'] == "ppp" && count($_POST['interfaces']) > 1)
$input_errors[] = "Multilink connections (MLPPP) using the PPP link type is not currently supported. Please select only one Link Interface.";
if (($_POST['provider'] && !is_domain($_POST['provider'])))
$input_errors[] = "The service name contains invalid characters.";
if (($_POST['idletimeout'] != "") && !is_numericint($_POST['idletimeout']))
$input_errors[] = "The idle timeout value must be an integer.";
if ($_POST['pppoe-reset-type'] == "custom" && $_POST['pppoe_resethour'] <> "" && !is_numericint($_POST['pppoe_resethour']) &&
$_POST['pppoe_resethour'] >= 0 && $_POST['pppoe_resethour'] <=23)
$input_errors[] = gettext("A valid PPPoE reset hour must be specified (0-23).");
if ($_POST['pppoe-reset-type'] == "custom" && $_POST['pppoe_resetminute'] <> "" && !is_numericint($_POST['pppoe_resetminute']) &&
$_POST['pppoe_resetminute'] >= 0 && $_POST['pppoe_resetminute'] <=59)
$input_errors[] = gettext("A valid PPPoE reset minute must be specified (0-59).");
if ($_POST['pppoe-reset-type'] == "custom" && $_POST['pppoe_resetdate'] <> "" && !is_numeric(str_replace("/", "", $_POST['pppoe_resetdate'])))
$input_errors[] = gettext("A valid PPPoE reset date must be specified (mm/dd/yyyy).");
if ($_POST['pppoe-reset-type'] == "custom" && $_POST['pppoe_resetdate'] <> "" && is_numeric(str_replace("/", "", $_POST['pppoe_resetdate']))){
$date_nums = explode("/",$_POST['pppoe_resetdate']);
if ($date_nums[0] < 1 || $date_nums[0] > 12)
$input_errors[] = gettext("A valid PPPoE reset month must be specified (1-12) in the Custom PPPoE Periodic reset fields.");
if ($date_nums[1] < 1 || $date_nums[1] > 31)
$input_errors[] = gettext("A valid PPPoE reset day of month must be specified (1-31) in the Custom PPPoE Periodic reset fields. No checks are done on valid # of days per month");
if ($date_nums[2] < date("Y"))
$input_errors[] = gettext("A valid PPPoE reset year must be specified. Don't select a year in the past!");
}
foreach($_POST['interfaces'] as $iface){
if ($_POST['localip'][$iface] && !is_ipaddr($_POST['localip'][$iface]))
$input_errors[] = "A valid local IP address must be specified for {$iface}.";
if ($_POST['gateway'][$iface] && !is_ipaddr($_POST['gateway'][$iface]) && !is_hostname($_POST['gateway'][$iface]))
$input_errors[] = "A valid gateway IP address OR hostname must be specified for {$iface}.";
if ($_POST['bandwidth'][$iface] && !is_numericint($_POST['bandwidth'][$iface]))
$input_errors[] = "The bandwidth value for {$iface} must be an integer.";
if ($_POST['mtu'][$iface] && ($_POST['mtu'][$iface] < 576))
$input_errors[] = "The MTU for {$iface} must be greater than 576 bytes.";
if ($_POST['mru'][$iface] && ($_POST['mru'][$iface] < 576))
$input_errors[] = "The MRU for {$iface} must be greater than 576 bytes.";
}
/*
foreach ($a_ppps as $ppp) {
if (isset($id) && ($a_ppps[$id]) && ($a_ppps[$id] === $ppp))
continue;
if ($ppp['serialport'] == $_POST['serialport']) {
$input_errors[] = "Serial port is in use";
break;
}
}
*/
if (!$input_errors) {
$ppp = array();
$ppp['ptpid'] = $_POST['ptpid'];
$ppp['type'] = $_POST['type'];
$ppp['if'] = $ppp['type'].$ppp['ptpid'];
$ppp['ports'] = implode(',',$_POST['interfaces']);
$ppp['username'] = $_POST['username'];
$ppp['password'] = base64_encode($_POST['password']);
$ppp['ondemand'] = $_POST['ondemand'] ? true : false;
if (!empty($_POST['idletimeout']))
$ppp['idletimeout'] = $_POST['idletimeout'];
else
unset($ppp['idletimeout']);
$ppp['uptime'] = $_POST['uptime'] ? true : false;
if (!empty($_POST['descr']))
$ppp['descr'] = $_POST['descr'];
else
unset($ppp['descr']);
// Loop through fields associated with a individual link/port and make an array of the data
$port_fields = array("localip", "gateway", "subnet", "bandwidth", "mtu", "mru", "mrru");
foreach($_POST['interfaces'] as $iface){
foreach($port_fields as $field_label){
if (isset($_POST[$field_label][$iface]))
$port_data[$field_label][] = $_POST[$field_label][$iface];
}
}
switch($_POST['type']) {
case "ppp":
if (!empty($_POST['initstr']))
$ppp['initstr'] = base64_encode($_POST['initstr']);
else
unset($ppp['initstr']);
if (!empty($_POST['simpin'])) {
$ppp['simpin'] = $_POST['simpin'];
$ppp['pin-wait'] = $_POST['pin-wait'];
} else {
unset($ppp['simpin']);
unset($ppp['pin-wait']);
}
if (!empty($_POST['apn'])){
$ppp['apn'] = $_POST['apn'];
$ppp['apnum'] = $_POST['apnum'];
} else {
unset($ppp['apn']);
unset($ppp['apnum']);
}
$ppp['phone'] = $_POST['phone'];
$ppp['localip'] = implode(',',$port_data['localip']);
$ppp['gateway'] = implode(',',$port_data['gateway']);
if (!empty($_POST['connect-timeout']))
$ppp['connect-timeout'] = $_POST['connect-timeout'];
else
unset($ppp['connect-timeout']);
break;
case "pppoe":
if (!empty($_POST['provider']))
$ppp['provider'] = $_POST['provider'];
else
unset($ppp['provider']);
if (!empty($_POST['pppoe-reset-type']))
$ppp['pppoe-reset-type'] = $_POST['pppoe-reset-type'];
else
unset($ppp['pppoe-reset-type']);
break;
case "pptp":
case "l2tp":
$ppp['dhcp'] = $_POST['pptp_dhcp'] ? true : false;
foreach ($port_data['localip'] as $key => $value){
if (empty($value)){
$port_data['localip'][$key] = "dhcp";
$port_data['subnet'][$key] = "";
}
}
$ppp['localip'] = implode(',',$port_data['localip']);
$ppp['subnet'] = implode(',',$port_data['subnet']);
$ppp['gateway'] = implode(',',$port_data['gateway']);
break;
default:
break;
}
$ppp['shortseq'] = $_POST['shortseq'] ? true : false;
$ppp['acfcomp'] = $_POST['acfcomp'] ? true : false;
$ppp['protocomp'] = $_POST['protocomp'] ? true : false;
$ppp['vjcomp'] = $_POST['vjcomp'] ? true : false;
$ppp['tcpmssfix'] = $_POST['tcpmssfix'] ? true : false;
$ppp['bandwidth'] = implode(',', $port_data['bandwidth']);
$ppp['mtu'] = implode(',', $port_data['mtu']);
$ppp['mru'] = implode(',', $port_data['mru']);
/* handle_pppoe_reset is called here because if user changes Link Type from PPPoE to another type we
must be able to clear the config data in the <cron> section of config.xml if it exists
*/
handle_pppoe_reset($_POST);
$iflist = get_configured_interface_list();
foreach ($iflist as $if) {
if ($config['interfaces'][$if]['if'] == $ppp['if']){
$thisif = $if;
break;
}
}
if (isset($id) && $a_ppps[$id])
$a_ppps[$id] = $ppp;
else
$a_ppps[] = $ppp;
write_config();
configure_cron();
if (isset($thisif)){
interface_ppps_configure($thisif);
}
header("Location: interfaces_ppps.php");
exit;
}
} // end if($_POST)
$closehead = false;
$pgtitle = array("Interfaces","PPPs","Edit");
include("head.inc");
$types = array("select" => "Select", "ppp" => "PPP", "pppoe" => "PPPoE", "pptp" => "PPTP", "l2tp" => "L2TP"/*, "tcp" => "TCP", "udp" => "UDP"*/ );
?>
<script type="text/javascript" src="/javascript/numericupdown/js/numericupdown.js"></script>
<link href="/javascript/numericupdown/css/numericupdown.css" rel="stylesheet" type="text/css" />
<script type="text/javascript" src="/javascript/datepicker/js/datepicker.js"></script>
<link href="/javascript/datepicker/css/datepicker.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" >
document.observe("dom:loaded", function() { updateType(<?php echo "'{$pconfig['type']}'";?>); });
</script>
</head>
<body link="#0000CC" vlink="#0000CC" alink="#0000CC" >
<?php include("fbegin.inc"); ?>
<?php if ($input_errors) print_input_errors($input_errors); ?>
<form action="interfaces_ppps_edit.php" method="post" name="iform" id="iform">
<table id="interfacetable" width="100%" border="0" cellpadding="6" cellspacing="0">
<tr>
<td colspan="2" valign="top" class="listtopic"><?= gettext("PPPs configuration"); ?></td>
</tr>
<tr>
<td valign="middle" class="vncell"><strong><?= gettext("Link Type"); ?></strong></td>
<td class="vtable">
<select name="type" onChange="updateType(this.value);" class="formselect" id="type">
<?php
foreach ($types as $key => $opt) {
echo "<option onClick=\"updateType('{$key}');\"";
if ($key == $pconfig['type'])
echo " selected";
echo " value=\"{$key}\" >" . htmlspecialchars($opt) . "</option>";
}
?>
</select>
</td>
</tr>
<tr name="interface" id="interface" >
<td width="22%" valign="top" class="vncellreq"><?= gettext("Link interface(s)"); ?></td>
<td width="78%" class="vtable">
<select valign="top" name="interfaces[]" multiple="true" class="formselect" size="4" onChange="show_hide_linkfields(this.options);">
<option></option>
</select>
<br/><span class="vexpl"><?= gettext("Select at least two interfaces for Multilink (MLPPP) connections."); ?></span>
</td>
</tr>
<tr style="display:none" name="portlists" id="portlists">
<td id="serialports"><?php
$selected_ports = explode(',',$pconfig['interfaces']);
$serial = glob("/dev/cua*");
$modems = glob("/dev/modem*");
$serialports = array_merge($serial, $modems);
$serport_count = 0;
foreach ($serialports as $port) {
if(preg_match("/\.(lock|init)$/", $port))
continue;
$serport_count++;
echo $port.",".trim($port);
if (in_array($port,$selected_ports))
echo ",1|";
else
echo ",|";
}
echo $serport_count;
?></td>
<td id="ports"><?php
$port_count = 0;
foreach ($portlist as $ifn => $ifinfo){
$port_count++;
echo htmlspecialchars($ifn . " (" . $ifinfo['mac'] . ")") . ",{$ifn}";
if (in_array($ifn,$selected_ports))
echo ",1|";
else
echo ",|";
}
echo $port_count;
if($serport_count > $port_count)
$port_count=$serport_count;
?></td>
<td style="display:none" name="port_count" id="port_count"><?=htmlspecialchars($port_count);?></td>
</tr>
<tr>
<td width="22%" valign="top" class="vncell"><?= gettext("Description"); ?></td>
<td width="78%" class="vtable">
<input name="descr" type="text" class="formfld unknown" id="descr" size="40" value="<?=htmlspecialchars($pconfig['descr']);?>">
<br/> <span class="vexpl"><?= gettext("You may enter a description here for your reference. Description will appear in the \"Interfaces Assign\" select lists."); ?></span>
</td>
</tr>
<tr style="display:none" name="select" id="select"></tr>
<?php $k=0; ?>
<tr style="display:none" name="ppp_provider" id="ppp_provider">
<td width="22%" valign="top" class="vncell"><?= gettext("Service Provider"); ?></td>
<td width="78%" class="vtable">
<table border="0" cellpadding="0" cellspacing="0">
<tr id="trcountry" style="display:none">
<td><?= gettext("Country"); ?> :&nbsp;&nbsp;</td>
<td>
<select class="formselect" name="country" id="country" onChange="providers_list()">
<option></option>
</select>
</td>
</tr>
<tr id="trprovider" style="display:none">
<td><?= gettext("Provider"); ?> :&nbsp;&nbsp;</td>
<td>
<select class="formselect" name="provider" id="provider" onChange="providerplan_list()">
<option></option>
</select>
</td>
</tr>
<tr id="trproviderplan" style="display:none">
<td><?= gettext("Plan"); ?> :&nbsp;&nbsp;</td>
<td>
<select class="formselect" name="providerplan" id="providerplan" onChange="prefill_provider()">
<option></option>
</select>
</td>
</tr>
</table>
<br/><span class="vexpl"><?= gettext("Select to fill in data for your service provider."); ?></span>
</td>
</tr>
<tr>
<td width="22%" valign="top" class="vncell"><?= gettext("Username"); ?></td>
<td width="78%" class="vtable">
<input name="username" type="text" class="formfld user" id="username" size="20" value="<?=htmlspecialchars($pconfig['username']);?>">
</td>
</tr>
<tr>
<td width="22%" valign="top" class="vncell"><?= gettext("Password"); ?></td>
<td width="78%" class="vtable">
<input name="password" type="password" class="formfld pwd" id="password" size="20" value="<?=htmlspecialchars($pconfig['password']);?>">
</td>
</tr>
<tr style="display:none" name="phone_num" id="phone_num">
<td width="22%" valign="top" class="vncell"><?= gettext("Phone Number"); ?></td>
<td width="78%" class="vtable">
<input name="phone" type="text" class="formfld unknown" id="phone" size="40" value="<?=htmlspecialchars($pconfig['phone']);?>">
<br/><span class="vexpl"><?= gettext("Note: Typically (*99# for GSM networks and *777 for CDMA networks"); ?></span>
</td>
</tr>
<tr style="display:none" name="apn_" id="apn_">
<td width="22%" valign="top" class="vncell"><?= gettext("Access Point Name (APN)"); ?></td>
<td width="78%" class="vtable">
<input name="apn" type="text" class="formfld unknown" id="apn" size="40" value="<?=htmlspecialchars($pconfig['apn']);?>">
</td>
</tr>
<tr style="display:none" name="ppp" id="ppp">
<td colspan="2" style="padding:0px;">
<table width="100%" border="0" cellpadding="6" cellspacing="0">
<tr style="display:none" id="advanced_<?=$k;?>" name="advanced_<?=$k;$k++;?>">
<td width="22%" valign="top" class="vncell"><?= gettext("APN number (optional)"); ?></td>
<td width="78%" class="vtable">
<input name="apnum" type="text" class="formfld unknown" id="apnum" size="2" value="<?=htmlspecialchars($pconfig['apnum']);?>">
<br/><span class="vexpl"><?= gettext("Note: Defaults to 1 if you set APN above. Ignored if you set no APN above."); ?></span>
</td>
</tr>
<tr style="display:none" id="advanced_<?=$k;?>" name="advanced_<?=$k;$k++;?>">
<td width="22%" valign="top" class="vncell"><?= gettext("Sim PIN"); ?></td>
<td width="78%" class="vtable">
<input name="simpin" type="text" class="formfld unknown" id="simpin" size="12" value="<?=htmlspecialchars($pconfig['simpin']);?>">
</td>
</tr>
<tr style="display:none" id="advanced_<?=$k;?>" name="advanced_<?=$k;$k++;?>">
<td width="22%" valign="top" class="vncell"><?= gettext("Sim PIN wait"); ?></td>
<td width="78%" class="vtable">
<input name="pin-wait" type="text" class="formfld unknown" id="pin-wait" size="2" value="<?=htmlspecialchars($pconfig['pin-wait']);?>">
<br/><span class="vexpl"><?= gettext("Note: Time to wait for SIM to discover network after PIN is sent to SIM (seconds)."); ?></span>
</td>
</tr>
<tr style="display:none" id="advanced_<?=$k;?>" name="advanced_<?=$k;$k++;?>">
<td width="22%" valign="top" class="vncell"><?= gettext("Init String"); ?></td>
<td width="78%" class="vtable">
<input type="text" size="40" class="formfld unknown" id="initstr" name="initstr" value="<?=htmlspecialchars($pconfig['initstr']);?>">
<br/><span class="vexpl"><?= gettext("Note: Enter the modem initialization string here. Do NOT include the \"AT\"
string at the beginning of the command. Many modern USB 3G modems don't need an initialization string."); ?></span>
</td>
</tr>
<tr style="display:none" id="advanced_<?=$k;?>" name="advanced_<?=$k;$k++;?>">
<td width="22%" valign="top" class="vncell"><?= gettext("Connection Timeout"); ?></td>
<td width="78%" class="vtable">
<input name="connect-timeout" type="text" class="formfld unknown" id="connect-timeout" size="2" value="<?=htmlspecialchars($pconfig['connect-timeout']);?>">
<br/><span class="vexpl"><?= gettext("Note: Enter timeout in seconds for connection to be established (sec.) Default is 45 sec."); ?></span>
</td>
</tr>
<tr style="display:none" id="advanced_<?=$k;?>" name="advanced_<?=$k;$k++;?>">
<td valign="top" class="vncell"><?= gettext("Uptime Logging"); ?></td>
<td class="vtable">
<input type="checkbox" value="on" id="uptime" name="uptime" <?php if (isset($pconfig['uptime'])) echo "checked"; ?>> <?= gettext("Enable persistent logging of connection uptime."); ?>
<br/> <span class="vexpl"><?= gettext("This option causes cumulative uptime to be recorded and displayed on the Status Interfaces page."); ?></span>
</td>
</tr>
</table>
</td>
</tr>
<tr style="display:none" name="pppoe" id="pppoe">
<td colspan="2" style="padding:0px;">
<table width="100%" border="0" cellpadding="6" cellspacing="0">
<tr>
<td width="22%" valign="top" class="vncell"><?= gettext("Service name"); ?></td>
<td width="78%" class="vtable"><input name="provider" type="text" class="formfld unknown" id="provider" size="20" value="<?=htmlspecialchars($pconfig['provider']);?>">
<br/> <span class="vexpl"><?= gettext("Hint: this field can usually be left empty"); ?></span>
</td>
</tr>
<tr style="display:none" id="advanced_<?=$k;?>" name="advanced_<?=$k;$k++;?>">
<td width="22%" valign="top" class="vncell"><?=gettext("Periodic reset");?></td>
<td width="78%" class="vtable">
<table id="presetwrap" cellspacing="0" cellpadding="0" width="100%">
<tr>
<td align="left" valign="top">
<p style="margin: 4px; padding: 4px 0 4px 0; width: 94%;">
<select valign="top" id="reset_type" name="pppoe-reset-type" class="formselect" onChange="show_reset_settings(this.value);">
<option value = ""><?= gettext("Disabled"); ?></option>
<option value="custom" <?php if ($pconfig['pppoe-reset-type'] == "custom") echo "selected"; ?>><?= gettext("Custom"); ?></option>
<option value="preset" <?php if ($pconfig['pppoe-reset-type'] == "preset") echo "selected"; ?>><?= gettext("Pre-Set"); ?></option>
</select> <?= gettext("Select a reset timing type"); ?>
</p>
<?php if ($pconfig['pppoe_pr_custom']): ?>
<p style="margin: 2px; padding: 4px; width: 94%;" id="pppoecustomwrap">
<?php else: ?>
<p style="margin: 2px; padding: 4px; width: 94%; display: none;" id="pppoecustomwrap">
<?php endif; ?>
<input type="text" name="pppoe_resethour" class="fd_incremental_inp_range_0_23 fd_increment_1 fd_classname_dec_buttonDec fd_classname_inc_buttonInc" maxlength="2" id="pppoe_resethour" value="<?= $pconfig['pppoe_resethour']; ?>" size="3" />
<?= gettext("hour (0-23)"); ?><br />
<input type="text" name="pppoe_resetminute" class="fd_incremental_inp_range_0_59 fd_increment_1 fd_classname_dec_buttonDec fd_classname_inc_buttonInc" maxlength="2" id="pppoe_resetminute" value="<?= $pconfig['pppoe_resetminute']; ?>" size="3" />
<?= gettext("minute (0-59)"); ?><br />
<input name="pppoe_resetdate" type="text" class="w8em format-m-d-y highlight-days-67" id="pppoe_resetdate" maxlength="10" size="10" value="<?=htmlspecialchars($pconfig['pppoe_resetdate']);?>" />
<?= gettext("reset at a specific date (mm/dd/yyyy)"); ?>
<br />&nbsp;<br />
<span class="red"><strong>Note: </strong></span>
<?= gettext("If you leave the date field empty, the reset will be executed each day at the time you did specify using the minutes and hour field."); ?>
</p>
<?php if ($pconfig['pppoe_pr_preset']): ?>
<p style="margin: 2px; padding: 4px; width: 94%;" id="pppoepresetwrap">
<?php else: ?>
<p style="margin: 2px; padding: 4px; width: 94%; display: none;" id="pppoepresetwrap">
<?php endif; ?>
<input name="pppoe_pr_preset_val" type="radio" id="pppoe_monthly" value="monthly" <?php if ($pconfig['pppoe_monthly']) echo "checked=\"checked\""; ?> />
<?= gettext("reset at each month ('0 0 1 * *')"); ?>
<br />
<input name="pppoe_pr_preset_val" type="radio" id="pppoe_weekly" value="weekly" <?php if ($pconfig['pppoe_weekly']) echo "checked=\"checked\""; ?> />
<?= gettext("reset at each week ('0 0 * * 0')"); ?>
<br />
<input name="pppoe_pr_preset_val" type="radio" id="pppoe_daily" value="daily" <?php if ($pconfig['pppoe_daily']) echo "checked=\"checked\""; ?> />
<?= gettext("reset at each day ('0 0 * * *')"); ?>
<br />
<input name="pppoe_pr_preset_val" type="radio" id="pppoe_hourly" value="hourly" <?php if ($pconfig['pppoe_hourly']) echo "checked=\"checked\""; ?> />
<?= gettext("reset at each hour ('0 * * * *')"); ?>
</p>
</td>
</tr>
</table>
</td>
</tr>
</table>
</td>
</tr>
<?php for($j=0; $j < $port_count; $j++) : ?>
<tr style="display:none" id="gw_fields<?=$j;?>">
<td width="22%" id="localiplabel<?=$j;?>" valign="top" class="vncell"><?= gettext("Local IP"); ?></td>
<td width="78%" class="vtable">
<input name="localip[]" type="text" class="formfld unknown" id="localip<?=$j;?>" size="20" value="<?=htmlspecialchars($pconfig['localip'][$j]);?>">
/
<select name="subnet[]" class="formselect" id="subnet<?=$j;?>" disabled="true">
<?php for ($i = 31; $i > 0; $i--): ?>
<option value="<?=$i;?>"<?php if ($i == $pconfig['subnet'][$j]) echo " selected"; ?>><?=$i;?></option>
<?php endfor; ?>
</select> <?= gettext("IP Address (Leave empty to enable DHCP)"); ?>
</td>
</tr>
<tr style="display:none" id="ip_fields<?=$j;?>">
<td width="22%" id="gatewaylabel<?=$j;?>" valign="top" class="vncell"></td>
<td width="78%" class="vtable">
<input name="gateway[]" type="text" class="formfld unknown" id="gateway<?=$j;?>" size="20" value="<?=htmlspecialchars($pconfig['gateway'][$j]);?>"><?= gettext("IP Address OR Hostname"); ?>
</td>
</tr><?php endfor; ?>
<tr style="display:none" id="advanced_<?=$k;?>" name="advanced_<?=$k;$k++;?>">
<td colspan="2" valign="top" height="16"></td>
</tr>
<tr style="display:none" id="advanced_<?=$k;?>" name="advanced_<?=$k;$k++;?>">
<td colspan="2" valign="top" class="listtopic"><?= gettext("Advanced Options"); ?></td>
</tr>
<tr style="display:none" id="advanced_<?=$k;?>" name="advanced_<?=$k;$k++;?>">
<td valign="top" class="vncell"><?= gettext("Dial On Demand"); ?></td>
<td class="vtable">
<input type="checkbox" value="on" id="ondemand" name="ondemand" <?php if (isset($pconfig['ondemand'])) echo "checked"; ?>> <?= gettext("Enable Dial-on-Demand mode"); ?>
<br/> <span class="vexpl"><?= gettext("This option causes the interface to operate in dial-on-demand mode, allowing you to have a virtual full time connection.
The interface is configured, but the actual connection of the link is delayed until qualifying outgoing traffic is detected."); ?> </span>
</td>
</tr>
<tr style="display:none" id="advanced_<?=$k;?>" name="advanced_<?=$k;$k++;?>">
<td valign="top" class="vncell"><?= gettext("Idle Timeout"); ?></td>
<td class="vtable">
<input name="idletimeout" type="text" class="formfld unknown" id="idletimeout" size="12" value="<?=htmlspecialchars($pconfig['idletimeout']);?>"> <?= gettext("(seconds) Default is 0, which disables the timeout feature."); ?>
<br/> <span class="vexpl"><?= gettext("If no incoming or outgoing packets are transmitted for the entered number of seconds the connection is brought down.
<br/>When the idle timeout occurs, if the dial-on-demand option is enabled, mpd goes back into dial-on-demand mode. Otherwise, the interface is brought down and all associated routes removed."); ?></span>
</td>
</tr>
<tr style="display:none" id="advanced_<?=$k;?>" name="advanced_<?=$k;$k++;?>">
<td width="22%" valign="top" class="vncell"><?= gettext("Compression"); ?></td>
<td width="78%" class="vtable">
<input type="checkbox" value="on" id="vjcomp" name="vjcomp" <?php if (isset($pconfig['vjcomp'])) echo "checked"; ?>>&nbsp;<?= gettext("Disable vjcomp(compression) (enabled by default)."); ?>
<br/> <span class="vexpl">This option enables Van Jacobson TCP header compression, which saves several bytes per TCP data packet.
You almost always want this option. This compression ineffective for TCP connections with enabled modern extensions like time
stamping or SACK, which modify TCP options between sequential packets.</span>
</td>
</tr>
<tr style="display:none" id="advanced_<?=$k;?>" name="advanced_<?=$k;$k++;?>">
<td width="22%" valign="top" class="vncell"><?= gettext("TCPmssFix"); ?></td>
<td width="78%" class="vtable">
<input type="checkbox" value="on" id="tcpmssfix" name="tcpmssfix" <?php if (isset($pconfig['tcpmssfix'])) echo "checked"; ?>>&nbsp;<?= gettext("Disable tcpmssfix (enabled by default)."); ?>
<br/> <span class="vexpl">This option causes mpd to adjust incoming and outgoing TCP SYN segments so that the requested maximum segment size is not greater than the amount
allowed by the interface MTU. This is necessary in many setups to avoid problems caused by routers that drop ICMP Datagram Too Big messages. Without these messages,
the originating machine sends data, it passes the rogue router then hits a machine that has an MTU that is not big enough for the data. Because the IP Don't Fragment option is set,
this machine sends an ICMP Datagram Too Big message back to the originator and drops the packet. The rogue router drops the ICMP message and the originator never
gets to discover that it must reduce the fragment size or drop the IP Don't Fragment option from its outgoing data.</span>
</td>
</tr>
<tr style="display:none" id="advanced_<?=$k;?>" name="advanced_<?=$k;$k++;?>">
<td width="22%" valign="top" class="vncell">ShortSeq</td>
<td width="78%" class="vtable">
<input type="checkbox" value="on" id="shortseq" name="shortseq" <?php if (isset($pconfig['shortseq'])) echo "checked"; ?>>&nbsp;<?= gettext("Disable shortseq (enabled by default)."); ?>
<br/> <span class="vexpl"><?= gettext("This option is only meaningful if multi-link PPP is negotiated. It proscribes shorter multi-link fragment headers, saving two bytes on every frame.
It is not necessary to disable this for connections that are not multi-link."); ?></span>
</td>
</tr>
<tr style="display:none" id="advanced_<?=$k;?>" name="advanced_<?=$k;$k++;?>">
<td width="22%" valign="top" class="vncell">ACFComp</td>
<td width="78%" class="vtable">
<input type="checkbox" value="on" id="acfcomp" name="acfcomp" <?php if (isset($pconfig['acfcomp'])) echo "checked"; ?>>&nbsp;<?= gettext("Disable acfcomp(compression) (enabled by default)."); ?>
<br/> <span class="vexpl"><?= gettext("Address and control field compression. This option only applies to asynchronous link types. It saves two bytes per frame."); ?></span>
</td>
</tr>
<tr style="display:none" id="advanced_<?=$k;?>" name="advanced_<?=$k;$k++;?>">
<td width="22%" valign="top" class="vncell">ProtoComp</td>
<td width="78%" class="vtable">
<input type="checkbox" value="on" id="protocomp" name="protocomp" <?php if (isset($pconfig['protocomp'])) echo "checked"; ?>>&nbsp;<?= gettext("Disable protocomp(compression) (enabled by default)."); ?>
<br/> <span class="vexpl"><?= gettext("Protocol field compression. This option saves one byte per frame for most frames."); ?></span>
</td>
</tr>
<tr id="advanced_" name="advanced_">
<td>&nbsp;</td>
<td>
<p><input type="button" onClick="show_advanced(1)" value="Show advanced options"></p>
</td>
<td style="display:none" id="adv_rows" name="adv_rows"><?=$k;?></td>
<td style="display:none" id="adv_show" name="adv_show">0</td>
</tr>
<tr>
<?php for($i=0; $i < $port_count; $i++) : ?>
<tr style="display:none" id="link<?=$i;?>">
<td width="22%" valign="top" id="linklabel<?=$i;?>" class="vncell"> Link Parameters</td>
<td class="vtable">
<table name="link_parameters" border="0" cellpadding="6" cellspacing="0">
<tr>
<td width="22%" id="bwlabel<?=$i;?>" valign="top"class="vncell"> Bandwidth</td>
<td width="78%" class="vtable">
<br/><input name="bandwidth[]" id="bandwidth<?=$i;?>" type="text" class="formfld unknown" size="40" value="<?=htmlspecialchars($pconfig['bandwidth'][$i]);?>">
<br/> <span class="vexpl">Set Bandwidth for each link ONLY for MLPPP connections and ONLY when links have different bandwidths.</span>
</td>
</tr>
<tr>
<td width="22%" id="mtulabel<?=$i;?>" valign="top" class="vncell"> MTU</td>
<td width="78%" class="vtable">
<input name="mtu[]" id="mtu<?=$i;?>" type="text" class="formfld unknown" size="6" value="<?=htmlspecialchars($pconfig['mtu'][$i]);?>">
<br> <span class="vexpl">MTU will default to 1492.</span>
</td>
</tr>
<tr>
<td width="22%" id="mrulabel<?=$i;?>" valign="top" class="vncell"> MRU</td>
<td width="78%" class="vtable">
<input name="mru[]" id="mru<?=$i;?>" type="text" class="formfld unknown" size="6" value="<?=htmlspecialchars($pconfig['mru'][$i]);?>">
<br> <span class="vexpl">MRU will default to 1492.</span>
</td>
</tr>
</table
</td>
</tr><?php endfor; ?>
<tr>
<td width="22%" valign="top">&nbsp;</td>
<td width="78%">
<input name="Submit" type="submit" class="formbtn" value="Save">
<input type="button" value="Cancel" onclick="history.back()">
<input name="ptpid" type="hidden" value="<?=htmlspecialchars($pconfig['ptpid']);?>">
<?php if (isset($id) && $a_ppps[$id]): ?>
<input name="id" type="hidden" value="<?=$id;?>">
<?php endif; ?>
</td>
</tr>
</table>
</form>
<?php include("fend.inc"); ?>
</body>
</html>

View File

@ -98,9 +98,9 @@ include("head.inc");
$tab_array[2] = array("Wireless", false, "interfaces_wireless.php");
$tab_array[3] = array("VLANs", false, "interfaces_vlan.php");
$tab_array[4] = array("QinQs", true, "interfaces_qinq.php");
$tab_array[5] = array("PPP", false, "interfaces_ppp.php");
$tab_array[6] = array("GRE", false, "interfaces_gre.php");
$tab_array[7] = array("GIF", false, "interfaces_gif.php");
$tab_array[5] = array("PPPs", false, "interfaces_ppps.php");
$tab_array[6] = array("GRE", false, "interfaces_gre.php");
$tab_array[7] = array("GIF", false, "interfaces_gif.php");
$tab_array[8] = array("Bridges", false, "interfaces_bridge.php");
$tab_array[9] = array("LAGG", false, "interfaces_lagg.php");
display_top_tabs($tab_array);

View File

@ -92,9 +92,9 @@ include("head.inc");
$tab_array[2] = array("Wireless", false, "interfaces_wireless.php");
$tab_array[3] = array("VLANs", true, "interfaces_vlan.php");
$tab_array[4] = array("QinQs", false, "interfaces_qinq.php");
$tab_array[5] = array("PPP", false, "interfaces_ppp.php");
$tab_array[6] = array("GRE", false, "interfaces_gre.php");
$tab_array[7] = array("GIF", false, "interfaces_gif.php");
$tab_array[5] = array("PPPs", false, "interfaces_ppps.php");
$tab_array[6] = array("GRE", false, "interfaces_gre.php");
$tab_array[7] = array("GIF", false, "interfaces_gif.php");
$tab_array[8] = array("Bridges", false, "interfaces_bridge.php");
$tab_array[9] = array("LAGG", false, "interfaces_lagg.php");
display_top_tabs($tab_array);

View File

@ -90,7 +90,7 @@ include("head.inc");
$tab_array[2] = array("Wireless", true, "interfaces_wireless.php");
$tab_array[3] = array("VLANs", false, "interfaces_vlan.php");
$tab_array[4] = array("QinQs", false, "interfaces_qinq.php");
$tab_array[5] = array("PPP", false, "interfaces_ppp.php");
$tab_array[5] = array("PPPs", false, "interfaces_ppps.php");
$tab_array[6] = array("GRE", false, "interfaces_gre.php");
$tab_array[7] = array("GIF", false, "interfaces_gif.php");
$tab_array[8] = array("Bridges", false, "interfaces_bridge.php");

View File

@ -0,0 +1,240 @@
function update_select_list(new_options, select_list){
var option_array = new_options.split("|");
var i = 0;
select_list.length = 0;
for(var j=0; j < option_array.length-1; j++){
var option = option_array[j].split(",");
var selected = Boolean(parseInt(option[2]));
select_list[j] = new Option(option[0], option[1], false, selected);
//for testing and debugging
//select_list.options[option_array.length-1+j] = new Option(option[2].toString() +" "+ selected.toString());
//select_list.options[option_array.length-1+j] = new Option("Link Label: " + linklabel + " Label Text:" + label_text);
}
show_hide_linkfields(select_list);
}
function show_advanced(hide){
var select_list = document.iform["interfaces[]"].options;
var adv_rows = parseInt($('adv_rows').innerHTML);
var adv_show = Boolean(parseInt($('adv_show').innerHTML));
var status = Boolean(parseInt(hide));
if (status){
$('advanced_').hide();
for(var j=0; j < adv_rows; j++){
var advanced = "advanced_" + j.toString();
$(advanced).show();
}
$('adv_show').innerHTML = "1";
show_hide_linkfields(select_list);
} else {
$('advanced_').show();
for(var j=0; j < adv_rows; j++){
var advanced = "advanced_" + j.toString();
$(advanced).hide();
}
$('adv_show').innerHTML = "0";
show_hide_linkfields(select_list);
}
}
function show_hide_linkfields(options){
var i = 0;
var port_count = parseInt($('port_count').innerHTML);
var adv_show = Boolean(parseInt($('adv_show').innerHTML));
for(var j=0; j < port_count; j++){
var count = j.toString();
var type = $('type').value;
var link = "link" + count;
var lnklabel = "linklabel" + count;
var bw = "bandwidth" + count;
var bwlabel = "bwlabel" + count;
var mtu = "mtu" + count;
var mru = "mru" + count;
var ipfields = "ip_fields" + count;
var gwfields = "gw_fields" + count;
var localip = "localip" + count;
var localiplabel = "localiplabel" + count;
var subnet = "subnet" + count;
var gateway = "gateway" + count;
var gatewaylabel = "gatewaylabel" + count;
$(ipfields, gwfields ,link).invoke('hide');
$(subnet).disabled = true;
$(bw).name = "bandwidth[]";
$(mtu).name = "mtu[]";
$(mru).name = "mru[]";
$(localip).name = "localip[]";
$(subnet).name = "subnet[]";
$(gateway).name = "gateway[]";
while(i < options.length){
if (options[i].selected ){
$(lnklabel).innerHTML = "Link Parameters (" + options[i].value + ")";
$(bwlabel).innerHTML = "Bandwidth (" + options[i].value + ")";
$(bw).name = "bandwidth[" + options[i].value + "]";
$(mtu).name = "mtu[" + options[i].value + "]";
$(mru).name = "mru[" + options[i].value + "]";
$(localiplabel).innerHTML = "Local IP (" + options[i].value + ")";
$(gatewaylabel).innerHTML = "Gateway (" + options[i].value + ")";
$(localip).name = "localip[" + options[i].value + "]";
$(subnet).name = "subnet[" + options[i].value + "]";
$(gateway).name = "gateway[" + options[i].value + "]";
if (type == 'ppp' && adv_show){
$(ipfields, gwfields).invoke('show');
}
if (type == 'pptp' || type == 'l2tp'){
$(subnet).disabled = false;
$(ipfields, gwfields).invoke('show');
}
if (adv_show){
$(link).show();
}
i++;
break;
}
i++;
}
}
}
function updateType(t){
var serialports = $('serialports').innerHTML;
var ports = $('ports').innerHTML;
var select_list = document.iform["interfaces[]"].options;
$('adv_show').innerHTML = "0";
show_advanced('0');
switch(t) {
case "select": {
$('ppp','pppoe','ppp_provider','phone_num','apn_').invoke('hide');
select_list.length = 0;
select_list[0] = new Option("Select Link Type First","");
break;
}
case "ppp": {
update_select_list(serialports, select_list);
$('select','pppoe').invoke('hide');
$('ppp_provider','phone_num','apn_').invoke('show');
country_list();
break;
}
case "pppoe": {
update_select_list(ports, select_list);
$('select','ppp','ppp_provider','phone_num','apn_').invoke('hide');
break;
}
case "l2tp":
case "pptp": {
update_select_list(ports, select_list);
$('select','ppp','pppoe','ppp_provider','phone_num','apn_').invoke('hide');
break;
}
default:
select_list.length = 0;
select_list[0] = new Option("Select Link Type First","");
break;
}
if (t == "pppoe" || t == "ppp"){
$(t).show();
}
}
function show_reset_settings(reset_type) {
if (reset_type == 'preset') {
Effect.Appear('pppoepresetwrap', { duration: 0.0 });
Effect.Fade('pppoecustomwrap', { duration: 0.0 });
}
else if (reset_type == 'custom') {
Effect.Appear('pppoecustomwrap', { duration: 0.0 });
Effect.Fade('pppoepresetwrap', { duration: 0.0 });
} else {
Effect.Fade('pppoecustomwrap', { duration: 0.0 });
Effect.Fade('pppoepresetwrap', { duration: 0.0 });
}
}
function country_list() {
$('country').childElements().each(function(node) { node.remove(); });
$('provider').childElements().each(function(node) { node.remove(); });
$('providerplan').childElements().each(function(node) { node.remove(); });
new Ajax.Request("getserviceproviders.php",{
onSuccess: function(response) {
var responseTextArr = response.responseText.split("\n");
responseTextArr.sort();
responseTextArr.each( function(value) {
var option = new Element('option');
country = value.split(":");
option.text = country[0];
option.value = country[1];
$('country').insert({ bottom : option });
});
}
});
$('trcountry').setStyle({display : "table-row"});
}
function providers_list() {
$('provider').childElements().each(function(node) { node.remove(); });
$('providerplan').childElements().each(function(node) { node.remove(); });
new Ajax.Request("getserviceproviders.php",{
parameters: {country : $F('country')},
onSuccess: function(response) {
var responseTextArr = response.responseText.split("\n");
responseTextArr.sort();
responseTextArr.each( function(value) {
var option = new Element('option');
option.text = value;
option.value = value;
$('provider').insert({ bottom : option });
});
}
});
$('trprovider').setStyle({display : "table-row"});
$('trproviderplan').setStyle({display : "none"});
}
function providerplan_list() {
$('providerplan').childElements().each(function(node) { node.remove(); });
$('providerplan').insert( new Element('option') );
new Ajax.Request("getserviceproviders.php",{
parameters: {country : $F('country'), provider : $F('provider')},
onSuccess: function(response) {
var responseTextArr = response.responseText.split("\n");
responseTextArr.sort();
responseTextArr.each( function(value) {
if(value != "") {
providerplan = value.split(":");
var option = new Element('option');
option.text = providerplan[0] + " - " + providerplan[1];
option.value = providerplan[1];
$('providerplan').insert({ bottom : option });
}
});
}
});
$('trproviderplan').setStyle({display : "table-row"});
}
function prefill_provider() {
new Ajax.Request("getserviceproviders.php",{
parameters: {country : $F('country'), provider : $F('provider'), plan : $F('providerplan')},
onSuccess: function(response) {
var xmldoc = response.responseXML;
var provider = xmldoc.getElementsByTagName('connection')[0];
$('username').setValue('');
$('password').setValue('');
if(provider.getElementsByTagName('apn')[0].firstChild.data == "CDMA") {
$('phone').setValue('*777');
$('apn').setValue('');
} else {
$('phone').setValue('*99#');
$('apn').setValue(provider.getElementsByTagName('apn')[0].firstChild.data);
}
$('username').setValue(provider.getElementsByTagName('username')[0].firstChild.data);
$('password').setValue(provider.getElementsByTagName('password')[0].firstChild.data);
}
});
}

View File

@ -116,29 +116,24 @@ include("head.inc");
echo "<tr>";
$c = 1;
while($c <= $priority_count) {
$monitor = lookup_gateway_monitor_ip_by_name($member);
if($p == $c) {
$monitor = lookup_gateway_monitor_ip_by_name($member);
switch($gateways_status[$monitor]['status']) {
case "None":
$online = "Online";
$bgcolor = "lightgreen";
break;
case "\"down\"":
$online = "Offline";
$bgcolor = "lightcoral";
break;
case "\"delay\"":
$online = "Latency";
$bgcolor = "khaki";
break;
case "\"loss\"":
$online = "Packetloss";
$bgcolor = "khaki";
break;
default:
$online = "Unknown";
$bgcolor = "lightblue";
break;
$status = $gateways_status[$monitor]['status'];
if (stristr($status, "down")) {
$online = "Offline";
$bgcolor = "lightcoral";
} elseif (stristr($status, "loss")) {
$online = "Warning, Packetloss";
$bgcolor = "khaki";
} elseif (stristr($status, "delay")) {
$online = "Warning, Latency";
$bgcolor = "khaki";
} elseif (stristr($status, "none")) {
$online = "Online";
$bgcolor = "lightgreen";
} else {
$online = "Unknown";
$bgcolor = "lightblue";
}
echo "<td bgcolor='$bgcolor'>". htmlspecialchars($member) .", $online</td>";
} else {

View File

@ -42,7 +42,6 @@
require("guiconfig.inc");
$a_gateways = return_gateways_array();
$gateways_status = array();
$gateways_status = return_gateways_status();
@ -76,51 +75,36 @@ include("head.inc");
<td width="30%" class="listhdrr">Status</td>
<td width="30%" class="listhdr">Description</td>
</tr>
<?php foreach ($a_gateways as $gateway) {
$i = 2;
<?php foreach ($gateways_status as $target => $gateway) {
?>
<tr>
<td class="listlr">
<?=strtoupper($gateway['name']);?>
</td>
<td class="listr" align="center" >
<?=$gateway['gateway'];?>
<?php echo lookup_gateway_ip_by_name($gateway['name']);?>
</td>
<td class="listr" align="center" >
<?=$gateway['monitor'];?>
<?=$target;?>
</td>
<td class="listr" >
<table border="0" cellpadding="0" cellspacing="2">
<?php
if($gateway['gateway'] == "dynamic") {
$gateway['monitor'] = "127.0.0.{$i}";
$i++;
if (stristr($gateway['status'], "down")) {
$online = "Offline";
$bgcolor = "lightcoral";
} elseif (stristr($gateway['status'], "loss")) {
$online = "Warning, Packetloss";
$bgcolor = "khaki";
} elseif (stristr($gateway['status'], "delay")) {
$online = "Warning, Latency";
$bgcolor = "khaki";
} elseif (stristr($gateway['status'], "none")) {
$online = "Online";
$bgcolor = "lightgreen";
}
$monitor = $gateway['monitor'];
if(empty($monitor)) {
$monitor = $gateway['gateway'];
}
switch($gateways_status[$monitor]['status']) {
case "None":
$online = "Online";
$bgcolor = "lightgreen";
break;
case "\"down\"":
$online = "Offline";
$bgcolor = "lightcoral";
break;
case "\"delay\"":
$online = "Warning, Latency";
$bgcolor = "khaki";
break;
case "\"loss\"":
$online = "Warning, Packetloss";
$bgcolor = "khaki";
break;
}
PRINT "<tr><td bgcolor=\"$bgcolor\" > $online </td><td>";
$lastchange = $gateways_status[$monitor]['lastcheck'];
echo "<tr><td bgcolor=\"$bgcolor\" > $online </td><td>";
$lastchange = $gateway['lastcheck'];
if(!empty($lastchange)) {
$lastchange = explode(" ", $lastchange);
array_shift($lastchange);
@ -130,13 +114,11 @@ include("head.inc");
} else {
print "Gathering data";
}
PRINT "</td></tr>";
echo "</td></tr>";
?>
</table>
</td>
<td class="listbg" >
<?=$gateway['descr'];?></font>
</td>
<td class="listbg"> <?=$a_gateway[$gateway['name']]['descr']; ?></td>
</tr>
<?php } ?>
</table>

View File

@ -76,9 +76,7 @@ include("head.inc");
<?php endif; ?>
<tr>
<td colspan="2" class="listtopic">
<?=htmlspecialchars($ifname);?>
interface
(<?=($ifinfo['hwif']);?>)
<?=htmlspecialchars($ifname);?> interface (<?=htmlspecialchars($ifinfo['hwif']);?>)
</td>
</tr>
<tr>

View File

@ -193,8 +193,12 @@ if ($_POST) {
if (!$input_errors) {
$reloadif = false;
$save = false;
if ($_POST['weight'] > 1 || $_POST['latencylow'] || $_POST['latencyhigh'] || $_POST['losslow'] || $_POST['losshigh'] || $_POST['down'] ||
$_POST['defaultgw'])
$save = true;
/* if we are processing a system gateway only save the monitorip */
if ($_POST['weight'] == 1 && (($_POST['attribute'] == "system" && empty($_POST['defaultgw'])) || (empty($_POST['interface']) && empty($_POST['gateway']) && empty($_POST['defaultgw'])))) {
if (!$save && empty($_POST['interface']) && empty($_POST['gateway'])) {
if (is_ipaddr($_POST['monitor'])) {
if (empty($_POST['interface']))
$interface = $pconfig['friendlyiface'];

View File

@ -214,7 +214,7 @@ function enable_change(enable_over) {
document.iform.radius_nasip.disabled = 0;
document.iform.radiusissueips.disabled = 0;
document.iform.radius_nasip.disabled = 0;
document.iform.radius_acct_update = 0;
document.iform.radius_acct_update.disabled = 0;
document.iform.radiussecenable.disabled = 0;
if (document.iform.radiussecenable.checked || enable_over) {
document.iform.radiusserver2.disabled = 0;
@ -236,7 +236,7 @@ function enable_change(enable_over) {
document.iform.radiusserveracctport.disabled = 1;
document.iform.radiusissueips.disabled = 1;
document.iform.radius_nasip.disabled = 1;
document.iform.radius_acct_update = 1;
document.iform.radius_acct_update.disabled = 1;
document.iform.radiussecenable.disabled = 1;
}
} else {
@ -260,7 +260,7 @@ function enable_change(enable_over) {
document.iform.radiusserver2acctport.disabled = 1;
document.iform.radiusissueips.disabled = 1;
document.iform.radius_nasip.disabled = 1;
document.iform.radius_acct_update = 1;
document.iform.radius_acct_update.disabled = 1;
}
}
//-->
@ -366,7 +366,7 @@ function enable_change(enable_over) {
<tr>
<td width="22%" valign="top" class="vncellreq">DNS servers</td>
<td width="78%" class="vtable">
<?=$mandfldhtml;?><input name="pppoe_dns1" type="text" class="formfld unkown" id="pppoe_dns1" size="20" value="<?=htmlspecialchars($pconfig['pppoe_dns1']);?>">
<?=$mandfldhtml;?><input name="pppoe_dns1" type="text" class="formfld unknown" id="pppoe_dns1" size="20" value="<?=htmlspecialchars($pconfig['pppoe_dns1']);?>">
<br>
<input name="pppoe_dns2" type="text" class="formfld unknown" id="pppoe_dns2" size="20" value="<?=htmlspecialchars($pconfig['pppoe_dns2']);?>">
<br>

View File

@ -30,8 +30,6 @@ require_once("guiconfig.inc");
require_once("pfsense-utils.inc");
require_once("functions.inc");
$a_gateways = return_gateways_array();
$gateways_status = array();
$gateways_status = return_gateways_status();
@ -46,57 +44,47 @@ $counter = 1;
<td width="10%" class="listhdrr">Loss</td>
<td width="30%" class="listhdrr">Status</td>
</tr>
<?php foreach ($a_gateways as $gateway) { ?>
<?php foreach ($gateways_status as $target => $gateway) { ?>
<?php
$monitor = $gateway['monitor'];
if(empty($monitor)) {
$monitor = $gateway['gateway'];
}
?>
$monitor = $target;
if(empty($monitor)) {
$monitor = $gateway['gateway'];
}
?>
<tr>
<td class="listlr" id="gateway<?= $counter; ?>">
<?=$gateway['name'];?>
<?php $counter++; ?>
</td>
<td class="listr" align="center" id="gateway<?= $counter; ?>">
<?=$gateway['gateway'];?>
<?php echo lookup_gateway_ip_by_name($gateway['name']);?>
<?php $counter++; ?>
</td>
<td class="listr" align="center" id="gateway<?= $counter; ?>">
<?=$gateways_status[$monitor]['delay'];?>
<?=$gateway['delay'];?>
<?php $counter++; ?>
</td>
<td class="listr" align="center" id="gateway<?= $counter; ?>">
<?=$gateways_status[$monitor]['loss'];?>
<?=$gateway['loss'];?>
<?php $counter++; ?>
</td>
<td class="listr" id=\"gateway<?=$counter?>\" >
<table border="0" cellpadding="0" cellspacing="2">
<?php
$monitor = $gateway['monitor'];
if(empty($monitor)) {
$monitor = $gateway['gateway'];
}
switch($gateways_status[$monitor]['status']) {
case "None":
$online = "Online";
$bgcolor = "lightgreen";
break;
case "\"down\"":
$online = "Offline";
$bgcolor = "lightcoral";
break;
case "\"delay\"":
$online = "Warning, Latency";
$bgcolor = "khaki";
break;
case "\"loss\"":
$online = "Warning, Packetloss";
$bgcolor = "khaki";
break;
default:
$online = "Gathering data";
}
if (stristr($gateway['status'], "down")) {
$online = "Offline";
$bgcolor = "lightcoral";
} elseif (stristr($gateway['status'], "loss")) {
$online = "Warning, Packetloss";
$bgcolor = "khaki";
} elseif (stristr($gateway['status'], "delay")) {
$online = "Warning, Latency";
$bgcolor = "khaki";
} elseif (stristr($gateway['status'], "none")) {
$online = "Online";
$bgcolor = "lightgreen";
} else
$online = "Gathering data";
echo "<tr><td bgcolor=\"$bgcolor\" > $online </td>";
$counter++;
?>
@ -104,7 +92,6 @@ $counter = 1;
</td>
</tr>
<?php
$i++;
}
?>
</table>

View File

@ -365,7 +365,10 @@ function showchange() {
$arraynum = "[" . $field['arraynum'] . "]";
foreach ($field_split as $f)
$field_conv .= "['" . $f . "']";
$toeval = "if (isset(\$config" . $field_conv . $arraynum . ")) { \$value = \$config" . $field_conv . $arraynum . "; if (empty(\$value)) \$value = true; }";
if($field['type'] == "checkbox")
$toeval = "if (isset(\$config" . $field_conv . $arraynum . ")) { \$value = \$config" . $field_conv . $arraynum . "; if (empty(\$value)) \$value = true; }";
else
$toeval = "if (isset(\$config" . $field_conv . $arraynum . ")) \$value = \$config" . $field_conv . $arraynum . ";";
eval($toeval);
}