Handle hostnames with upper-case letters
[webmin.git] / phpini / save_dirs.cgi
1 #!/usr/local/bin/perl
2 # Update options related to PHP directories
3
4 require './phpini-lib.pl';
5 &error_setup($text{'dirs_err'});
6 &ReadParse();
7 &can_php_config($in{'file'}) || &error($text{'list_ecannot'});
8
9 &lock_file($in{'file'});
10 $conf = &get_config($in{'file'});
11
12 # Validate and save inputs
13 if ($in{'include_def'}) {
14         &save_directive($conf, "include_path", undef);
15         }
16 else {
17         @incs = split(/\r?\n/, $in{'include'});
18         @incs || &error($text{'dirs_eincs'});
19         &save_directive($conf, "include_path", join(":", @incs));
20         }
21
22 $in{'ext_def'} || $in{'ext'} =~ /\S/ || &error($text{'dirs_eext'});
23 &save_directive($conf, "extension_dir", $in{'ext_def'} ? undef : $in{'ext'});
24
25 &save_directive($conf, "file_uploads", $in{'file_uploads'} || undef);
26
27 $in{'utmp_def'} || -d $in{'utmp'} || &error($text{'dirs_eutmp'});
28 &save_directive($conf, "upload_tmp_dir", $in{'utmp_def'} ? undef : $in{'utmp'});
29
30 &flush_file_lines_as_user($in{'file'});
31 &unlock_file($in{'file'});
32 &graceful_apache_restart();
33 &webmin_log("dirs", undef, $in{'file'});
34
35 &redirect("list_ini.cgi?file=".&urlize($in{'file'}));
36