X-Git-Url: https://git.adam-barratt.org.uk/?a=blobdiff_plain;f=web%2FUtil.pm;h=1127c63d9f1f32e8f7ab7368779b159fe8219227;hb=7a0e9808163461d1e1ff7e2e0ee9c5e69ed33b9b;hp=d7ba4a7e021919962e1631dd34d918ee4f9e5b21;hpb=3b0b777cbb6450e191d34f3919e184c6af62cfad;p=mirror%2Fuserdir-ldap.git diff --git a/web/Util.pm b/web/Util.pm index d7ba4a7..1127c63 100644 --- a/web/Util.pm +++ b/web/Util.pm @@ -5,7 +5,7 @@ use strict; my $blocksize = 8; # A blowfish block is 8 bytes my $configfile = "/etc/userdir-ldap/userdir-ldap.conf"; -#my $configfile = "/home/randolph/projects/userdir-ldap/userdir-ldap.conf"; +#my $configfile = "/home/randolph/html/debian/perl/userdir-ldap.conf"; my %config = &ReadConfigFile; @@ -134,13 +134,13 @@ sub CheckAuthToken { } sub ClearAuthToken { - my ($id, $hrkey) = split(/:/, shift, 2); + my ($id, $hrkey) = split(/,/, shift, 2); $id =~ y/\//_/; # switch / to _ unlink "$config{authtokenpath}/$id" || &HTMLError("Error removing authtoken: $!"); } sub UpdateAuthToken { - my ($id, $hrkey) = split(/:/, shift, 2); + my ($id, $hrkey) = split(/,/, shift, 2); my $password = shift; my $key = pack("H".(length($hrkey)), $hrkey); $id =~ y/\//_/; # switch / to _ @@ -265,8 +265,8 @@ sub ReadConfigFile { ($attr, $setting) = split(/=/, $_, 2); $setting =~ s/"//g; #" $setting =~ s/;$//; - $attr =~ s/^ +//; $attr =~ s/ +$//; - $setting =~ s/^ +//; $setting =~ s/ +$//; + $attr =~ s/^\s+//; $attr =~ s/\s+$//; + $setting =~ s/^\s+//; $setting =~ s/\s+$//; $config{$attr} = $setting; } }