Handle hostnames with upper-case letters
[webmin.git] / servers / login.cgi
1 #!/usr/local/bin/perl
2 # login.cgi
3 # Store the username and password for a server in a cookie
4
5 use strict;
6 use warnings;
7 require './servers-lib.pl';
8 our (%in);
9 &ReadParse();
10 my $enc = &encode_base64($in{'user'}.":".$in{'pass'});
11 $enc =~ s/\r|\n//g;
12 print "Set-Cookie: $in{'id'}=$enc; path=/";
13 if (uc($ENV{'HTTPS'}) eq 'ON') {
14         print "; secure";
15         }
16 print "\n";
17 &redirect("link.cgi/$in{'id'}/");
18