X-Git-Url: https://git.adam-barratt.org.uk/?p=mirror%2Fuserdir-ldap-cgi.git;a=blobdiff_plain;f=login.cgi;h=aa9df4ae6191f8f9ecb8dbb166cb3a0dcb217e5a;hp=d820af29e989c55680e7028331e0c54479bc9fdf;hb=b33011c65aeb65e4b06b127077d6a225f764d042;hpb=b0f8e57cce2bf0ab7a693ffac1ab1cc62f59b13c diff --git a/login.cgi b/login.cgi index d820af2..aa9df4a 100755 --- a/login.cgi +++ b/login.cgi @@ -10,7 +10,6 @@ use strict; use CGI; use Util; use URI::Escape; -use Crypt::Blowfish; use Net::LDAP qw(LDAP_SUCCESS LDAP_PROTOCOL_ERROR); my %config = &Util::ReadConfigFile; @@ -23,10 +22,6 @@ if ($proto eq "http" || !($query->param('username')) || !($query->param('passwor exit; } -my $key = &Util::CreateKey($config{blowfishkeylen}); # human-readable version of the key -my $hrkey = unpack("H".($config{blowfishkeylen}*2), $key); -my $cipher = new Crypt::Blowfish $key; - my $ldap = Net::LDAP->new($config{ldaphost}) || &Util::HTMLError($!); &Util::UpgradeConnection($ldap) unless $config{usessl} eq 'False'; @@ -57,14 +52,13 @@ if ($mesg->code == LDAP_SUCCESS) { } ## END HACK HACK HACK - my $cryptid = &Util::SavePasswordToFile($username, $password, $cipher); + my $authtoken = &Util::SavePasswordToFile($username, $password); if ($query->param('update')) { - my $url = "$proto://$ENV{SERVER_NAME}/$config{webupdateurl}?id=$username&authtoken=$cryptid,$hrkey&editdn="; - $url .= uri_escape("uid=$username,$config{basedn}", "\x00-\x40\x7f-\xff"); + my $url = "$proto://$ENV{SERVER_NAME}/$config{webupdateurl}?id=$username;authtoken=$authtoken"; print "Location: $url\n\n"; } else { - my $url = "$proto://$ENV{SERVER_NAME}/$config{websearchurl}?id=$username&authtoken=$cryptid,$hrkey"; + my $url = "$proto://$ENV{SERVER_NAME}/$config{websearchurl}?id=$username;authtoken=$authtoken"; print "Location: $url\n\n"; }