Follow along with the video below to see how to install our site as a web app on your home screen.
Note: This feature may not be available in some browsers.
sub GetLogon {
my($authtype,$authstring) = split(' ', $ENV{'HTTP_AUTHORIZATION'});
return "unknown" unless $authtype =~ /basic/i;
# You COULD use the following two lines, but it would
# include other code that you don't really need.
#use MIME::Base64 ();
#$decoded = MIME::Base64::decode($encoded);
# The following code comes from perlfaq9
# remove non-base64 chars
$authstring =~ tr[A-Za-z0-9+/][]cd;
# convert to uuencoded format
$authstring =~ tr[A-Za-z0-9+/][ -_];
# compute length byte
$len = pack("c", 32 + 0.75*length($authstring));
# uudecode
my $authstring = unpack("u", $len . $authstring);
# Now we have userid:password. Split off just the userid
my ($user,undef) = split(':', $authstring);
return $user;
} # GetLogon