Mailing List Archive

Empty web page after authenticating via LDAP
Hi all

I'm in the process of setting up a brand new DAViCal installation. I have
advanced to the point where I can successfully login with the
auto-generated "admin" user, using normal database authentication.

I'm now attempting to configure DAViCal to use LDAP authentication, but
here I encountered the following problem: After I enter the *correct* LDAP
password for the "admin" user, I am redirected to a completely empty web
page - no error, nothing, it's really empty, I even looked at the page
source in Firefox.


I have tried a few things already, but before I tell you about those, let
me quickly describe my system setup:
- Debian system configured for testing
- DAViCal installed from APT source "http://debian.mcmillan.net.nz/debian
lenny"
- Package versions: davical 0.9.7.6-0, libawl-php 0.38-0
- DAViCal runs under Apache and has an entire Virtual Host to its own
- I pretty much followed the installation instructions on
http://davical.org/installation.php


The situation is this:
* At the moment the "admin" user exists both in the database and in LDAP
* The database and LDAP have different passwords set up for "admin"
* When I try to login using a wrong user name / password, I get the
correct error page
* When I try to login using the correct DB password, the login succeeds
* When I try to login using the correct LDAP password, the problem occurs


I have set this in DAViCal's configuration:
$c->dbg['ALL'] = 1;

Then looked at Apache's error log, where I can see that LDAP
authentication succeeded. The log entry that tells me this:

[Sat Oct 31 21:04:59 2009] [error] [client 192.168.1.8] davical: ALL:
LDAP:drivers_ldap : Bound to user cn=admin,ou=users,dc=herzbube,dc=ch
using password SECRET, referer:
http://davical.localnet.herzbube.ch/index.php?logout

The Apache log contains 30-40 lines more, but nothing looks suspicious to me.

At the moment I'm a bit stumped. Any pointer to what could be wrong would
be very welcome.

Thanks in advance
Patrick


PS: No need to cc, I'm reading the list
Empty web page after authenticating via LDAP [ In reply to ]
Hi again

I have tracked my issue further and arrived at a pseudo-solution (sorry,
should have done that before writing the first email).

I sprinkled a few PHP statements throughout the DAViCal code:

die("argh");

With those I was able to narrow down the problem to line 127 in
auth-functions.php, where the function sql_from_object() is being used.
The name of the function triggered my memory, and I recalled that the
previous poster on this mailing list (Arnaud) also had problems with this
function. I found it strange that he had seen an error message, while I
only got a blank page. I then commented out the following line in Apache's
Virtual Host configuration:

php_value error_reporting "E_ALL & ~E_NOTICE"

I then made another login attempt, and voil?, I also had Arnaud's error
message. Next, I returned to auth-functions.php and made sure that I had
the version of the file where Arnaud's problem has been fixed. Yes, line
28 looked like this:

if ( function_exists('CreateHomeCalendar') ) return(true);

I then commented out the line, and voil?, I was able to login. I then
removed the comment from the line, and... I was still able to login! At
first I found this strange, but on second thought I guess that the reason
for this is that DAViCal knows that it has already sync'ed the user with
LDAP and therefore does not need to do so anymore.

I tested this theory by modifying the user DN in LDAP, assuming this would
update the DN's attribute "modifyTimestamp", which in turn would trigger
DAViCal's sync functionality. I then tried to login to DAViCal, and yes, I
got the error again! From this observation I conclude that only those
people will have a problem whose LDAP user DNs have been modified more
recently than their users in the DAViCal database.


The question remains, though: What should I do to prevent the problem from
occurring in the future? I have read Arnaud's thread and seen that towards
the end there was some discussion concerning require/require_once vs.
include, but from my understanding there was no definite conclusion.

Until further notice, I will leave the line with function_exists()
commented out.

Cheers
Patrick

PS: If it is of any interest, my system uses PHP 5.2.11 (package php5
version 5.2.11.dfsg.1-1)