Uh oh!
There was an error while loading. Please reload this page.
Fixes #7175 - Allow to search for email address in user management - #7419
Conversation
Codecov Report
@@ Coverage Diff @@## master #7419 +/- ##
=============================================
- Coverage 52.87% 34.77% -18.11% - Complexity 23658 24885 +1227
=============================================
Files 1449 1602 +153 Lines 80454 94750 +14296 Branches 0 1368 +1368 =============================================
- Hits 42541 32949 -9592 - Misses 37913 61801 +23888
|
Abijeet
commented
Dec 8, 2017
Not sure why the test case failed, please let me know if there is anything I've to do or change. |
MorrisJobke
commented
Dec 8, 2017
Fixed in master: #7433 |
blizzz
commented
Dec 12, 2017
It works, however I'D appreciate "unit" tests in |
Abijeet
commented
Dec 16, 2017
@blizzz - Thank you. I'll add the test cases some time today. |
Fixes#7175. - Updated the query to fetch the users in users > everyone tab. - Updated the query to fetch the users in users > admin tab. - Tested to ensure that the disabled users are also being fetched. - Added test cases. Signed-off-by: Abijeet <abijeetpatro@gmail.com>
Abijeet
commented
Dec 16, 2017
@blizzz , @MorrisJobke - Couple of things,
|
Abijeet
commented
Dec 16, 2017
Also I noticed one more thing, searching with So for example, if there is a user with If you search for this user in the view with the following search term - admin_, you'll not get any value in the response. This is because Not sure if this is a known issue. |
| Header set Cache-Control "max-age=15778463" | ||
| </FilesMatch> | ||
| <IfModule pagespeed_module> | ||
| ModPagespeed Off | ||
| </IfModule> | ||
| </IfModule> No newline at end of file |
There was a problem hiding this comment.
That change should be undone. We usually have a new line at the end of files.
There was a problem hiding this comment.
Fixed, added the newline back. Will keep in mind for future.
Signed-off-by: Abijeet <abijeetpatro@gmail.com>
blizzz
commented
Dec 19, 2017
This was added for security reasons, since % and _ act as wildcards in SQL. The \ is necessary to escape them so user input does not act like a wildcard. For sqlite to work it requires an additional |
add additional user searching tests Signed-off-by: Robin Appelman <robin@icewind.nl>
icewind1991
commented
Dec 20, 2017
Took the opportunity to refactor the user searching code and fixed the @blizzz please re-review |
| ->from('users', 'u') | ||
| ->leftJoin('u', 'preferences', 'p', $query->expr()->andX( | ||
| $query->expr()->eq('userid', 'uid')), | ||
| $query->expr()->eq('appid', new Literal('settings')), |
There was a problem hiding this comment.
Literal cannot be hidden from consumers?
There was a problem hiding this comment.
All plain strings are used as column names
There was a problem hiding this comment.
I mean whether everywhere where we use strings in queries they need to be instances of Literal or whether it can be abstracted away?
There was a problem hiding this comment.
We need to use Literal to explicitly tell the query builder that the string is safe to use
blizzz
commented
Jan 12, 2018
@icewind1991 just the other question, looks good otherwise and is working |
Signed-off-by: Robin Appelman <robin@icewind.nl>
blizzz
commented
Jan 17, 2018
needs another reviewer |
| * | ||
| * @param mixed $field | ||
| * @return IQueryFunction | ||
| * @since 13.0.0 |
Abijeet
commented
Mar 10, 2018
Finally :) |
Greetings,
@MorrisJobke - Please find the merge request that fixes#7175
I've done the following,
Tested with SQLite.
Signed-off-by: Abijeet abijeetpatro@gmail.com