Handle hostnames with upper-case letters
[webmin.git] / mysql / save_vars.cgi
1 #!/usr/local/bin/perl
2 # Either return to the list_vars.cgi page with new variables for editing,
3 # or save those that were edited
4
5 require './mysql-lib.pl';
6 $access{'perms'} == 1 || &error($text{'vars_ecannot'});
7 &ReadParse();
8 @d = split(/\0/, $in{'d'});
9 if ($in{'save'} || !@d) {
10         # Update edited
11         $count = 0;
12         foreach $v (keys %in) {
13                 if ($v =~ /^value_(\S+)$/) {
14                         &execute_sql_logged($master_db,
15                                             "set global $1 = $in{$v}");
16                         $first ||= $1;
17                         $count++;
18                         }
19                 }
20         &webmin_log("set", undef, $count);
21         &redirect("list_vars.cgi?search=".&urlize($in{'search'})."#$first");
22         }
23 else {
24         # Return to list page, but in edit mode
25         &redirect("list_vars.cgi?search=".&urlize($in{'search'})."&".
26                 join("&", map { "d=".&urlize($_) } @d).
27                 "#".$d[0]);
28         }
29
30