From 9d4fcadf807c36fbd997515c244f53b06e756688 Mon Sep 17 00:00:00 2001
From: kevin_fourie
'.
+ _kt('The list may be long and take some time to load if the search is not filtered and there are a number of users in the system.')
+ , 'massimport', $isMassImport, $this->oPage, true);
$oAuthenticator = $this->getAuthenticator($oSource);
$name = KTUtil::arrayGet($_REQUEST, 'ldap_name');
- if (!empty($name)) {
+
+ if (!empty($name) || $isMassImport) {
$aSearchResults = $oAuthenticator->searchUsers($name, array('cn', 'dn', $sIdentifierField));
if (PEAR::isError($aSearchResults)) {
$this->oPage->addError($aSearchResults->getMessage());
@@ -468,8 +476,6 @@ class KTLDAPBaseAuthenticationProvider extends KTAuthenticationProvider {
}
}
- $massimport = KTUtil::arrayGet($_REQUEST, 'massimport');
-
$aTemplateData = array(
'context' => &$this,
'fields' => $fields,
@@ -910,7 +916,7 @@ class KTLDAPBaseAuthenticator extends Authenticator {
foreach ($this->aSearchAttributes as $sSearchAttribute) {
$sSearchAttributes .= sprintf('(%s=*%s*)', trim($sSearchAttribute), $sSearch);
}
- $sFilter = sprintf('(&(%s)(%s))', $sObjectClasses, $sSearchAttributes);
+ $sFilter = !empty($sSearch) ? sprintf('(&(%s)(%s))', $sObjectClasses, $sSearchAttributes) : null;
$default->log->debug("Search filter is: " . $sFilter);
$oResult = $this->oLdap->search($rootDn, $sFilter, $aParams);
diff --git a/templates/ktstandard/authentication/ldapsearchuser.smarty b/templates/ktstandard/authentication/ldapsearchuser.smarty
index 3a28d2d..ee59c56 100644
--- a/templates/ktstandard/authentication/ldapsearchuser.smarty
+++ b/templates/ktstandard/authentication/ldapsearchuser.smarty
@@ -30,7 +30,7 @@ begin.{/i18n}
| + | {if $massimport}{/if} | {i18n}Name{/i18n} | {i18n}Distinguished Name (LDAP DN){/i18n} |
|---|