Handle hostnames with upper-case letters
[webmin.git] / webmin / change_mobile.cgi
1 #!/usr/local/bin/perl
2 # Display options specific to mobile devices
3
4 require './webmin-lib.pl';
5 &ReadParse();
6 &error_setup($text{'mobile_err'});
7
8 &lock_file($ENV{'MINISERV_CONFIG'});
9 &lock_file("$config_directory/config");
10 &get_miniserv_config(\%miniserv);
11
12 # Validate and store inputs
13 if ($in{'theme'} eq '*') {
14         delete($miniserv{'mobile_preroot'});
15         delete($gconfig{'mobile_theme'});
16         }
17 else {
18         $miniserv{'mobile_preroot'} = $in{'theme'};
19         $gconfig{'mobile_theme'} = $in{'theme'};
20         }
21 $miniserv{'mobile_nosession'} = $in{'nosession'};
22 $in{'agents'} =~ s/\r//g;
23 $miniserv{'mobile_agents'} = join("\t", split(/\n+/, $in{'agents'}));
24 $miniserv{'mobile_prefixes'} = $in{'prefixes'};
25
26 # Write out files
27 &put_miniserv_config(\%miniserv);
28 &unlock_file($ENV{'MINISERV_CONFIG'});
29 &write_file("$config_directory/config", \%gconfig);
30 &unlock_file("$config_directory/config");
31
32 &reload_miniserv();
33 &webmin_log('mobile', undef, undef, \%in);
34 &redirect("");
35
36