From: Florian Forster Date: Thu, 15 Jun 2006 16:12:48 +0000 (+0200) Subject: Make `die' messages more meaningfull. X-Git-Url: https://git.verplant.org/?a=commitdiff_plain;h=9d8e49b0af022cf9a1d691c12abbb304a258dec3;p=licom.git Make `die' messages more meaningfull. Also read `./licom.conf' if it exists. --- 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}))