Handle hostnames with upper-case letters
[webmin.git] / pptp-client / save_opts.cgi
1 #!/usr/local/bin/perl
2 # save_opts.cgi
3 # Save global PPTP PPP options
4
5 require './pptp-client-lib.pl';
6 &ReadParse();
7 &error_setup($text{'opts_err'});
8
9 &lock_file($config{'pptp_options'});
10 @opts = &parse_ppp_options($config{'pptp_options'});
11 if ($in{'mtu_def'}) {
12         &save_ppp_option(\@opts, $config{'pptp_options'}, "mtu", undef);
13         }
14 else {
15         $in{'mtu'} =~ /^\d+$/ || &error($text{'opts_emtu'});
16         &save_ppp_option(\@opts, $config{'pptp_options'}, "mtu",
17                          { 'name' => 'mtu', 'value' => $in{'mtu'} });
18         }
19 if ($in{'mru_def'}) {
20         &save_ppp_option(\@opts, $config{'pptp_options'}, "mru", undef);
21         }
22 else {
23         $in{'mru'} =~ /^\d+$/ || &error($text{'opts_emru'});
24         &save_ppp_option(\@opts, $config{'pptp_options'}, "mru",
25                          { 'name' => 'mru', 'value' => $in{'mru'} });
26         }
27 &parse_mppe_options(\@opts, $config{'pptp_options'});
28 &flush_file_lines();
29 &unlock_file($config{'pptp_options'});
30 &webmin_log("opts");
31
32 &redirect("");
33