-
-
Notifications
You must be signed in to change notification settings - Fork 4.7k
Fixes #7175 - Allow to search for email address in user management #7419
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
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
|
|
Not sure why the test case failed, please let me know if there is anything I've to do or change. |
Fixed in master: #7433 |
|
It works, however I'D appreciate "unit" tests in |
|
@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>
|
@blizzz , @MorrisJobke - Couple of things,
|
|
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> | ||
|
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is fine.
.htaccess
Outdated
| <IfModule pagespeed_module> | ||
| ModPagespeed Off | ||
| </IfModule> | ||
| </IfModule> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
That change should be undone. We usually have a new line at the end of files.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Fixed, added the newline back. Will keep in mind for future.
Signed-off-by: Abijeet <abijeetpatro@gmail.com>
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>
|
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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Literal cannot be hidden from consumers?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
All plain strings are used as column names
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We need to use Literal to explicitly tell the query builder that the string is safe to use
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
ok
|
@icewind1991 just the other question, looks good otherwise and is working |
Signed-off-by: Robin Appelman <robin@icewind.nl>
|
needs another reviewer |
MorrisJobke
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Tested and works 👍
| * | ||
| * @param mixed $field | ||
| * @return IQueryFunction | ||
| * @since 13.0.0 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
See #8696
|
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