Add dynamic user search to LDAP synchronization - #5362
nilsteampassnet merged 4 commits into
Conversation
|
@guerricv, thanks for this, it's a genuinely useful addition to a page that gets unwieldy on large directories, and the implementation is careful. A few things I'd like adjusted before merging: 1. Please revert the button label change. 2. Please add the roles to the search index. const searchText = [
userLogin,
entry.displayname !== undefined ? entry.displayname[0] : '',
entry.givenname !== undefined ? entry.givenname[0] : '',
entry.sn !== undefined ? entry.sn[0] : '',
entry.mail !== undefined ? entry.mail[0] : '',
(entry.ldap_user_groups || []).join(' ')
].join(' ')
Minor, take them or leave them:
What I specifically checked and found correct, so you don't have to re-verify it: htmlEncode() escapes both quote characters, so data-search can't be broken out of by a directory-supplied value, and jQuery.attr() hands back the decoded string so matching still works on the raw text. The wrapper visibility is handled at all four #ldap-users-table toggle sites, the filter is correctly reapplied after the AJAX re-render, .hidden is the TeamPass class (not the one Bootstrap 4 dropped), and all four language keys exist in both english.php and french.php. That's the part that usually goes wrong on this page, and it's right here. |
|
Thanks for the thorough review. I addressed the feedback in commit
The existing |
|
Reviewed Verified locally against
Merging. Thanks for the clean iteration and for keeping the escaping and the post-AJAX filter reapplication untouched, that was the delicate part. |
Description
Adds a dynamic client-side search to the LDAP synchronization user list.
htmlEncode()before inserting them into the DOM.No LDAP query, database schema, translation, or AJAX endpoint is changed.
Related issue
None.
Type of change
How has this been tested?
git diff --checkpasses locally.tests/Unit/LdapSynchronizationSearchTest.phpfor regression coverage.Checklist
php app/vendor/bin/phpstan analyse --memory-limit=2G)php _tools/phpunit.phar— see CONTRIBUTING.md for the one-time setup)var_dump()orconsole.log()was added by this changeapp/sources/*.queries.phpfiles have a matchingpublic/sources/proxy shim (not applicable: no handler was added)teampassclasseswere applied to both copies (app/includes/libraries/andapp/vendor/) (not applicable: no class was changed)app/vendor/composer/is in its production form (git checkout -- app/vendor/composer/)Impact on install / upgrade
install/upgrade_run_X.X.X.phpscript is included and the fresh install path was testedScreenshots
Not available in this environment because there is no local PHP/LDAP runtime.