diff --git a/docs/changelog/7.x.x.txt b/docs/changelog/7.x.x.txt index 8c2edff3b..94b8636a8 100644 --- a/docs/changelog/7.x.x.txt +++ b/docs/changelog/7.x.x.txt @@ -2,6 +2,7 @@ - fixed #11289: Gallery with pending version tag causes search engine indexer to puke. - fixed #11292: Search function limited to onje search? - fixed #11286: Workflow Instance deleted when reaching an Activity that fails to load + - fixed #11296: listLDAPLinks op permissions problems 7.8.7 - fixed #11278: Wrong test for Template::Toolkit in testEnvironment.pl diff --git a/lib/WebGUI/LDAPLink.pm b/lib/WebGUI/LDAPLink.pm index 2d6008f04..cdb40e5d5 100644 --- a/lib/WebGUI/LDAPLink.pm +++ b/lib/WebGUI/LDAPLink.pm @@ -107,9 +107,10 @@ sub connectToLDAP { $self->{_uri} = $uri; my $ldap = Net::LDAP->new($uri->host, port => $uri->port, #Port will default to 389 or 636 - scheme => $uri->scheme + scheme => $uri->scheme, + timeout => 15, ); - + unless($ldap) { $self->{_error} = 103; return undef; @@ -167,7 +168,7 @@ A valid ldap error code. sub getErrorMessage { my $self = shift; - my $errorCode = shift || $self->getErrorMessage; + my $errorCode = shift || $self->getErrorCode; return "" unless $errorCode; my $i18nCode = "LDAPLink_".$errorCode; my $i18n = WebGUI::International->new($self->session,"AuthLDAP"); @@ -231,9 +232,7 @@ Disconnect cleanly from the current databaseLink. =cut sub unbind { - my ($self, $value); - $self = shift; - $value = shift; + my $self = shift; if (defined $self->{_connection}) { $self->{_connection}->unbind; } diff --git a/lib/WebGUI/Operation/LDAPLink.pm b/lib/WebGUI/Operation/LDAPLink.pm index 5d7e8690a..6d8f31f4e 100644 --- a/lib/WebGUI/Operation/LDAPLink.pm +++ b/lib/WebGUI/Operation/LDAPLink.pm @@ -380,13 +380,14 @@ sub www_listLDAPLinks { my $ldapLink = WebGUI::LDAPLink->new($session,$data->{ldapLinkId}); my $status = $i18n->get("LDAPLink_1078"); - if ($ldapLink->bind && $ldapLink->getErrorCode == 0) { - $status = $i18n->get("LDAPLink_1079"); - } else { - $session->errorHandler->warn($ldapLink->getErrorMessage()); + if ($ldapLink->bind && $ldapLink->getErrorCode == 0) { + $status = $i18n->get("LDAPLink_1079"); + $ldapLink->unbind; + } + else { + $session->errorHandler->warn($ldapLink->getErrorMessage()); $status .= ": ".$ldapLink->getErrorMessage(); - } - $ldapLink->unbind; + } $row[$i] .= '