SPX-GC
SPX-GC copied to clipboard
Search filter doesn't search for field "mail" in 1.4-dev
Describe the bug As I see in LDAP query, it's only search for cn, uid, description, givenName, sn. In 1.3 it works by email searching
To Reproduce Steps to reproduce the behavior:
- Go to Users
- Type an email in search field
- Press "Apply filter"
Expected behavior A search result with user which email typed
Desktop (please complete the following information):
- OS: [Unix/Linux]
- PHP: [7.3/7.4]
- PHP provenance: [Debian]
Additional context In 1.3 search filters is in plugins/admin/groups/*-filter.xml it's simple to fix it, but in 1.4 version this files was removed and I can't figure out, where now this filters? Could anybody explain, where it moved? Thanks.
hello @skeletorgithub
did you install the mail plugin in 1.4 the filter are contextual to the field provided by the plugin
Cheers
hello @skeletorgithub
did you install the mail plugin in 1.4 the filter are contextual to the field provided by the plugin
Cheers
Hello, yes, sure. But nothing has changed.
Hello @skeletorgithub,
I have reproduced what you are experimenting. It is indeed possible to filter based on an email input within the filter field in V1.3 but does not work anymore in V1.4. (Both version with plugin mail installed).
I will open a ticket on our side, and we will look for a way to fix this.
To answer your question about the missing file "plugins/admin/groups/*-filter.xml": The overall structure of FD 1.4 in terms of filtering management has been re-designed completely. New classes are now handling what was once handled by reading XML files.
Kind regards.
Hi @skeletorgithub,
After reflection, if you add a new column within the menu "Users" ("Configure Management List") with below details :
- Type : Column
- Attribute : Mail
- Label : Mail (example)
- Persistent (optional).
You'll be able to use the quick filter for the emails registered.
Please let me know if this solution resolves your problem.
Kind regards.
@tdockx thanks for reply and interesting my issue. I have fixed it by my local patch:
--- include/management/class_managementFilter.inc 2022-05-12 08:16:37.570337580 +0000
+++ include/management/class_managementFilter.inc 2022-05-16 12:37:27.630298650 +0000
@@ -205,6 +205,14 @@
$elementFilters[] = $this->search;
} else {
$searchAttributesTmp = $this->searchAttributes[$type];
+
+# patched by skeletor
+ if (isset($this->searchAttributes["USER"])) {
+ $searchAttributesTmp[]='mail';
+ $searchAttributesTmp[]='gosaMailAlternateAddress';
+ }
+# end patch
+
if ($this->showTemplates) {
$searchAttributesTmp[] = '_template_cn';
}
Now, I can able to use search in email or alias (gosaMailAlternateAddress).
@skeletorgithub, perfect.
I am glad it is then resolved.
I am closing this ticket.
Kind regards.