Export missed variables
[webmin.git] / web-lib.pl
1 =head1 web-lib.pl
2
3 This file must be included by all Webmin CGI scripts, either directly or via
4 another module-specific .pl file. For example :
5
6  do '../web-lib.pl';
7  init_config();
8  do '../ui-lib.pl';
9  ui_print_header(undef, 'My Module', '');
10
11 This file in turn includes web-lib-funcs.pl, which is where the majority of
12 the Webmin API functions are defined.
13
14 =cut
15
16 $remote_error_handler = "error";
17 @INC = &unique(@INC, ".");
18 %month_to_number_map = ( 'jan' => 0, 'feb' => 1, 'mar' => 2, 'apr' => 3,
19                          'may' => 4, 'jun' => 5, 'jul' => 6, 'aug' => 7,
20                          'sep' => 8, 'oct' => 9, 'nov' =>10, 'dec' =>11 );
21 %number_to_month_map = reverse(%month_to_number_map);
22 $main::initial_process_id ||= $$;
23 $main::http_cache_directory = $ENV{'WEBMIN_VAR'}."/cache";
24 $main::default_debug_log_size = 10*1024*1024;
25 $main::default_debug_log_file = $ENV{'WEBMIN_VAR'}."/webmin.debug";
26
27 $webmin_feedback_address = "feedback\@webmin.com";
28 $default_lang = "en";
29 $default_charset = "iso-8859-1";
30 $osdn_download_host = "prdownloads.sourceforge.net";
31 $osdn_download_port = 80;
32
33 =head2 unique(string, ...)
34
35 Returns the unique elements of some array, passed as its parameters.
36
37 =cut
38 sub unique
39 {
40 my (%found, @rv);
41 foreach my $e (@_) {
42         if (!$found{$e}++) { push(@rv, $e); }
43         }
44 return @rv;
45 }
46
47 if (!$done_web_lib_funcs) {
48         my $script = -r '../web-lib-funcs.pl' ? '../web-lib-funcs.pl'
49                                                  : 'web-lib-funcs.pl';
50         do $script;
51         }
52
53 1;
54