From 2e506660f8188d1b315b4dd7907ab0ef07484c39 Mon Sep 17 00:00:00 2001 From: Roy Johnson Date: Wed, 18 Oct 2006 21:15:48 +0000 Subject: [PATCH] fix - Cannot manage user accounts in 7.1.0. See the comments in Auth/LDAP.pm. We really need a more robust fix. --- docs/changelog/7.x.x.txt | 1 + docs/upgrades/upgrade_7.1.0-7.1.1.pl | 8 ++++++++ lib/WebGUI/Auth/LDAP.pm | 8 ++++++++ 3 files changed, 17 insertions(+) diff --git a/docs/changelog/7.x.x.txt b/docs/changelog/7.x.x.txt index b5a425896..618e77aae 100644 --- a/docs/changelog/7.x.x.txt +++ b/docs/changelog/7.x.x.txt @@ -6,6 +6,7 @@ - add: asset exporter making appropriate symlinks for extras, uploads, and root URL - change: asset exporter now uses one session per asset to avoid breaking state in between - fix: Lineage length is not checked (Martin Kamerbeek / Procolix) + - fix: Cannot manage user accounts in 7.1.0 7.1.0 - fix: mysql and mysqldump were transposed in upgrade.pl --help diff --git a/docs/upgrades/upgrade_7.1.0-7.1.1.pl b/docs/upgrades/upgrade_7.1.0-7.1.1.pl index ee1f33b0d..4df3c5d7e 100644 --- a/docs/upgrades/upgrade_7.1.0-7.1.1.pl +++ b/docs/upgrades/upgrade_7.1.0-7.1.1.pl @@ -21,9 +21,17 @@ my $quiet; # this line required my $session = start(); # this line required fixSurvey(); +fixLDAP(); finish($session); # this line required +#------------------------------------------------- +sub fixLDAP { + print "\tFixing the ldap connection setting.\n" unless ($quiet); + # Set the LDAP connection setting to the default ldap link if it's not set to anything + my $ldapConnection = $session->setting->get("ldapConnection"); + $session->setting->set("ldapConnection", "1uBbhUm686mkFZ1ghv7Lag") if ($ldapConnection eq ""); +} #------------------------------------------------- sub fixSurvey { diff --git a/lib/WebGUI/Auth/LDAP.pm b/lib/WebGUI/Auth/LDAP.pm index 456c6a5eb..543fb43f6 100644 --- a/lib/WebGUI/Auth/LDAP.pm +++ b/lib/WebGUI/Auth/LDAP.pm @@ -198,6 +198,14 @@ sub authenticate { #------------------------------------------------------------------- sub connectToLDAP { + + # This method needs to do some excpetion handling when we try to create an LDAPLink object + # Lot's to do though because then everything calling connectToLDAP must also handle exceptions on up + # + # Problem is that $connectionId may not have a value or the object creation may fail for other reasons. + # Quick fix for now is to ensure the ldapConnection setting is set in the settings table with the id of + # the default ldap connection. + my $self = shift; my $connectionId = $self->session->form->process("connection") || $self->session->setting->get("ldapConnection"); my $ldapLink = WebGUI::LDAPLink->new($self->session,$connectionId);