Handle hostnames with upper-case letters
[webmin.git] / web-lib.pl
1
2 @INC = &unique(@INC, ".");
3 %month_to_number_map = ( 'jan' => 0, 'feb' => 1, 'mar' => 2, 'apr' => 3,
4                          'may' => 4, 'jun' => 5, 'jul' => 6, 'aug' => 7,
5                          'sep' => 8, 'oct' => 9, 'nov' =>10, 'dec' =>11 );
6 %number_to_month_map = reverse(%month_to_number_map);
7 $main::default_debug_log_size = 10*1024*1024;
8
9 $webmin_feedback_address = "feedback\@webmin.com";
10 $default_lang = "en";
11 $default_charset = "iso-8859-1";
12
13 =head2 unique(string, ...)
14
15 Returns the unique elements of some array, passed as its parameters.
16
17 =cut
18 sub unique
19 {
20 my (%found, @rv);
21 foreach my $e (@_) {
22         if (!$found{$e}++) { push(@rv, $e); }
23         }
24 return @rv;
25 }
26
27 if (!$done_web_lib_funcs) {
28         my $script = -r '../web-lib-funcs.pl' ? '../web-lib-funcs.pl'
29                                                  : 'web-lib-funcs.pl';
30         do $script;
31         }
32
33 # Has to be set after error is defined
34 $remote_error_handler = \&error;
35
36 1;
37