From 9d8e49b0af022cf9a1d691c12abbb304a258dec3 Mon Sep 17 00:00:00 2001 From: Florian Forster Date: Thu, 15 Jun 2006 18:12:48 +0200 Subject: [PATCH] Make `die' messages more meaningfull. Also read `./licom.conf' if it exists. --- licom.cgi | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/licom.cgi b/licom.cgi index cd02690..2a9c7c9 100755 --- a/licom.cgi +++ b/licom.cgi @@ -68,11 +68,15 @@ our %Actions = save_group => [\&html_start, \&action_save_group, \&html_end] ); -read_config (); +{ + my @files = (qw(/etc/licom/licom.conf)); + push (@files, './licom.conf') if (-r './licom.conf'); + read_config (@files); +} # make sure AuthLDAPRemoteUserIsDN is enabled. die unless ($ENV{'REMOTE_USER'}); -set_config ('base_dn', $ENV{'REMOTE_USER'}); +#set_config ('base_dn', $ENV{'REMOTE_USER'}); die unless (defined (get_config ('uri')) and defined (get_config ('base_dn')) @@ -84,7 +88,7 @@ LiCoM::Connection->connect uri => get_config ('uri'), bind_dn => get_config ('bind_dn'), password => get_config ('password') -) or die; +) or die ("LiCoM::Connection->connect failed."); our ($UserCN, $UserID) = LiCoM::Person->get_user ($ENV{'REMOTE_USER'}); @@ -95,7 +99,7 @@ if (!$UserID and $Action ne 'save') if (!$UserCN) { - die; + die ("UserCN is not set. Make sure `AuthLDAPRemoteUserIsDN' in enabled."); } if (!defined ($Actions{$Action})) -- 2.11.0