From 3a0599e20f9ca155dfc4049fd4f5f8b4cf185bae Mon Sep 17 00:00:00 2001 From: Megan Watson Date: Thu, 28 Feb 2008 09:06:58 +0000 Subject: [PATCH] KTS-3090 "Get an error when trying to view all groups on your active directory server." Fixed. Added error checking. --- plugins/ktstandard/ldap/ldapbaseauthenticationprovider.inc.php | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/plugins/ktstandard/ldap/ldapbaseauthenticationprovider.inc.php b/plugins/ktstandard/ldap/ldapbaseauthenticationprovider.inc.php index 5631f68..f13f4f2 100644 --- a/plugins/ktstandard/ldap/ldapbaseauthenticationprovider.inc.php +++ b/plugins/ktstandard/ldap/ldapbaseauthenticationprovider.inc.php @@ -504,11 +504,15 @@ class KTLDAPBaseAuthenticationProvider extends KTAuthenticationProvider { $fields = array(); $fields[] = new KTStringWidget(_kt("Group's name"), _kt("The group's name, or part thereof, to find the group that you wish to add"), 'name', '', $this->oPage, true); - $oAuthenticator = $this->getAuthenticator($oSource); $name = KTUtil::arrayGet($_REQUEST, 'name'); if (!empty($name)) { $oAuthenticator = $this->getAuthenticator($oSource); $aSearchResults = $oAuthenticator->searchGroups($name); + + if(PEAR::isError($aSearchResults)){ + $this->addErrorMessage($aSearchResults->getMessage()); + $aSearchResults = array(); + } } $aTemplateData = array( @@ -973,6 +977,11 @@ class KTLDAPBaseAuthenticator extends Authenticator { } $sFilter = sprintf('(&(objectClass=group)(cn=*%s*))', $sSearch); $oResults = $this->oLdap->search($rootDn, $sFilter, $aParams); + + if(PEAR::isError($oResults)){ + return $oResults; + } + $aRet = array(); foreach($oResults->entries() as $oEntry) { $aAttr = $oEntry->attributes(); -- libgit2 0.21.4