projects
/
mirror
/
userdir-ldap-cgi.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Use $config{sslcafile} instead of hardcoding the path to the SSL CA in Util.pm.
[mirror/userdir-ldap-cgi.git]
/
login.cgi
diff --git
a/login.cgi
b/login.cgi
index
cfe7380
..
aa9df4a
100755
(executable)
--- a/
login.cgi
+++ b/
login.cgi
@@
-10,8
+10,7
@@
use strict;
use CGI;
use Util;
use URI::Escape;
use CGI;
use Util;
use URI::Escape;
-use Crypt::Blowfish;
-use Net::LDAP qw(:all);
+use Net::LDAP qw(LDAP_SUCCESS LDAP_PROTOCOL_ERROR);
my %config = &Util::ReadConfigFile;
my %config = &Util::ReadConfigFile;
@@
-23,10
+22,6
@@
if ($proto eq "http" || !($query->param('username')) || !($query->param('passwor
exit;
}
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';
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
}
## END HACK HACK HACK
- my $
cryptid = &Util::SavePasswordToFile($username, $password, $cipher
);
+ my $
authtoken = &Util::SavePasswordToFile($username, $password
);
if ($query->param('update')) {
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 {
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";
}
print "Location: $url\n\n";
}