From db8120a276143f2a2a18833c773867c0ad91463a Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?C=C3=B4me=20Chilliet?= <come.chilliet@fusiondirectory.org>
Date: Mon, 1 Mar 2021 14:45:23 +0100
Subject: [PATCH] :ambulance: fix(core) Fix LDAP size limit configuration
 dialog

issue #6154
---
 ihtml/themes/breezy/sizelimit.tpl | 8 ++++----
 include/class_ldapSizeLimit.inc   | 3 +--
 2 files changed, 5 insertions(+), 6 deletions(-)

diff --git a/ihtml/themes/breezy/sizelimit.tpl b/ihtml/themes/breezy/sizelimit.tpl
index 273dc5364..69050a608 100644
--- a/ihtml/themes/breezy/sizelimit.tpl
+++ b/ihtml/themes/breezy/sizelimit.tpl
@@ -1,4 +1,4 @@
-<h1>{$warning|escape}</h1>
+<h1>{t 1=$sizelimit}The size limit of %1 entries is exceeded!{/t}</h1>
 <p>
   {t}The size limit option makes LDAP operations faster and saves the LDAP server from getting too much load. The easiest way to handle big databases without long timeouts would be to limit your search to smaller values and use filters to get the entries you are looking for.{/t}
 </p>
@@ -7,11 +7,11 @@
 </p>
 
 <input type="radio" name="action" value="ignore" id="ignore"/>
-  <label for="ignore">{t}ignore this error and show all entries the LDAP server returns{/t}</label><br/>
+  <label for="ignore">{t}Ignore this error and show all entries the LDAP server returns{/t}</label><br/>
 <input type="radio" name="action" value="limited" checked="checked" id="limited"/>
-  <label for="limited">{t}ignore this error and show all entries that fit into the defined sizelimit and let me use filters instead{/t}</label><br/>
+  <label for="limited">{t}Ignore this error and show all entries that fit into the defined sizelimit and let me use filters instead{/t}</label><br/>
 <input type="radio" name="action" value="newlimit" id="newlimit"/>
-  {$limit_message|escape}
+  <label for="newlimit">{t}Change the size limit to: {/t}<input type="text" name="new_limit" maxlength="10" size="5" value="{$sizelimit + 100}"/></label>
 
 <p class="plugbottom">
  <input type=submit name="set_size_action" value="{t}Set{/t}"/>
diff --git a/include/class_ldapSizeLimit.inc b/include/class_ldapSizeLimit.inc
index 3d8c6000a..2badc90e0 100644
--- a/include/class_ldapSizeLimit.inc
+++ b/include/class_ldapSizeLimit.inc
@@ -111,8 +111,7 @@ class ldapSizeLimit
     /* Eventually show dialog */
     if ($this->limitExceeded) {
       $smarty = get_smarty();
-      $smarty->assign('warning', sprintf(_('The size limit of %d entries is exceed!'), $this->sizeLimit));
-      $smarty->assign('limit_message', sprintf(_('Set the new size limit to %s and show me this message if the limit still exceeds'), '<input type="text" name="new_limit" maxlength="10" size="5" value="'.($this->sizeLimit + 100).'"/>'));
+      $smarty->assign('sizelimit', $this->sizeLimit);
       return $smarty->fetch(get_template_path('sizelimit.tpl'));
     }
 
-- 
GitLab