projects
/
mirror
/
userdir-ldap-cgi.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
|
inline
| side by side (parent:
9f1d910
)
misc fixes; added log function to login to help diagnose errors
author
tausq
<>
Sat, 11 Dec 1999 06:03:45 +0000
(06:03 +0000)
committer
tausq
<>
Sat, 11 Dec 1999 06:03:45 +0000
(06:03 +0000)
Util.pm
patch
|
blob
|
history
login.cgi
patch
|
blob
|
history
search.cgi
patch
|
blob
|
history
diff --git
a/Util.pm
b/Util.pm
index
96ad4cd
..
1127c63
100644
(file)
--- a/
Util.pm
+++ b/
Util.pm
@@
-265,8
+265,8
@@
sub ReadConfigFile {
($attr, $setting) = split(/=/, $_, 2);
$setting =~ s/"//g; #"
$setting =~ s/;$//;
($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;
}
}
$config{$attr} = $setting;
}
}
diff --git
a/login.cgi
b/login.cgi
index
cf5a138
..
3da2b3a
100755
(executable)
--- a/
login.cgi
+++ b/
login.cgi
@@
-1,6
+1,6
@@
#!/usr/bin/perl
#!/usr/bin/perl
-# $Id: login.cgi,v 1.
3 1999/12/09 02:18:14
tausq Exp $
+# $Id: login.cgi,v 1.
4 1999/12/11 07:03:45
tausq Exp $
# (c) 1999 Randolph Chung. Licensed under the GPL. <tausq@debian.org>
use lib '.';
# (c) 1999 Randolph Chung. Licensed under the GPL. <tausq@debian.org>
use lib '.';
@@
-32,6
+32,9
@@
my $username = $query->param('username');
my $password = $query->param('password');
my $binddn = "uid=$username,$config{basedn}";
my $password = $query->param('password');
my $binddn = "uid=$username,$config{basedn}";
+&logf(sprintf("proto=[%s]; key=[%s]; hrkey=[%s]; username=[%s]; passwd=[%s]; binddn=[%s]",
+ $proto, $key, $hrkey, $username, ($password ? "shh!" : "(null)"), $binddn));
+
my $mesg = $ldap->bind($binddn, password => $password);
$mesg->sync;
my $mesg = $ldap->bind($binddn, password => $password);
$mesg->sync;
@@
-41,13
+44,29
@@
if ($mesg->code == LDAP_SUCCESS) {
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");
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");
+ &logf("redirect url = [$url]");
print "Location: $url\n\n";
} else {
print "Location: $url\n\n";
} else {
- print "Location: $proto://$ENV{SERVER_NAME}/$config{websearchurl}?id=$username&authtoken=$cryptid,$hrkey\n\n";
+ my $url = "$proto://$ENV{SERVER_NAME}/$config{websearchurl}?id=$username&authtoken=$cryptid,$hrkey";
+ &logf("redirect url = [$url]");
+ print "Location: $url\n\n";
}
$ldap->unbind;
} else {
}
$ldap->unbind;
} else {
+ &logf("bad auth");
print "Content-type: text/html\n\n";
print "<html><body><h1>Not authenticated</h1></body></html>\n";
}
print "Content-type: text/html\n\n";
print "<html><body><h1>Not authenticated</h1></body></html>\n";
}
+
+sub logf {
+ my $msg = shift;
+ my $t = localtime;
+
+ if (open(L, ">>$config{weblogfile}")) {
+ print L sprintf("[%s] %s: %s\n", $ENV{REMOTE_ADDR}, $t, $msg);
+ close L;
+ }
+}
+
+exit 0;
diff --git
a/search.cgi
b/search.cgi
index
aa8dce1
..
5bd31ec
100755
(executable)
--- a/
search.cgi
+++ b/
search.cgi
@@
-1,6
+1,6
@@
#!/usr/bin/perl
#!/usr/bin/perl
-# $Id: search.cgi,v 1.
2 1999/09/26 01:20:39
tausq Exp $
+# $Id: search.cgi,v 1.
3 1999/12/11 07:03:45
tausq Exp $
# (c) 1999 Randolph Chung. Licensed under the GPL. <tausq@debian.org>
use lib '.';
# (c) 1999 Randolph Chung. Licensed under the GPL. <tausq@debian.org>
use lib '.';
@@
-191,7
+191,7
@@
if (!$dosearch) {
# If this is ourselves, present a link to do mods
if ($auth && ($id eq $data->{uid}->[0])) { #TODO: extract this string into a url for translation...
# If this is ourselves, present a link to do mods
if ($auth && ($id eq $data->{uid}->[0])) { #TODO: extract this string into a url for translation...
- $outsub{searchresults} .= "<a href=\"$proto://$ENV{SERVER_NAME}/$config{webupdateurl}?id=$id&authtoken=$authtoken&editdn=".uri_escape($dn, "\x00-\x40\x7f-\xff")."\">Edit my settings</a>\n";
+
$outsub{searchresults} .= "<a href=\"$proto://$ENV{SERVER_NAME}/$config{webupdateurl}?id=$id&authtoken=$authtoken&editdn=".uri_escape($dn, "\x00-\x40\x7f-\xff")."\">Edit my settings</a>\n";
}
$outsub{searchresults} .= "<br><br><br>\n";
}
$outsub{searchresults} .= "<br><br><br>\n";
@@
-254,3
+254,5
@@
sub FormatEntry {
return "<tr><td align=right><b>$key:</b></td><td> $val</td></tr>\n";
}
return "<tr><td align=right><b>$key:</b></td><td> $val</td></tr>\n";
}
+
+exit 0;