Joas Schilling
aa5f037af7
chore: apply changes from Nextcloud coding standards 1.1.1
Signed-off-by: Joas Schilling <coding@schilljs.com>
Signed-off-by: Benjamin Gaussorgues <benjamin.gaussorgues@nextcloud.com>
7 months ago
Christoph Wurst
ea8f9a7e84
refactor: Repalce array_search with in_array in lib/
Signed-off-by: Christoph Wurst <christoph@winzerhof-wurst.at>
9 months ago
Côme Chilliet
d18bb7e9bb
Build query once instead of in-loop
Signed-off-by: Côme Chilliet <come.chilliet@nextcloud.com>
10 months ago
Christoph Wurst
312dd8ac6d
feat(ocp): Add types and strict typing to \OCP\Group\IGroup
Signed-off-by: Christoph Wurst <christoph@winzerhof-wurst.at>
1 year ago
Côme Chilliet
35069ad86a
Fix psalm spotted type errors
Signed-off-by: Côme Chilliet <come.chilliet@nextcloud.com>
10 months ago
Côme Chilliet
2c8b415c55
Move new methods to a new interface in OCP
This avoids breaking compatibility for group backends not based on
ABackend abstract class.
Signed-off-by: Côme Chilliet <come.chilliet@nextcloud.com>
10 months ago
Carl Schwan
3270b7f12e
Add batch methods in user backends
This allows for faster group search with significantly less DB traffic
Signed-off-by: Carl Schwan <carl@carlschwan.eu>
2 years ago
Joas Schilling
daac5c9a95
fix(cache): Remove displayname cache entry on delete
Signed-off-by: Joas Schilling <coding@schilljs.com>
10 months ago
Joas Schilling
80f79e170d
fix!: Remove symfony EventDispatcherInterface from Group
Signed-off-by: Joas Schilling <coding@schilljs.com>
11 months ago
John Molakvoæ
4a86487859
fix: getGroups limit check syntax
Co-authored-by: Côme Chilliet <91878298+come-nc@users.noreply.github.com>
Signed-off-by: John Molakvoæ <skjnldsv@users.noreply.github.com>
1 year ago
Robin Appelman
13b06ba4e2
revert public interface back to the original types, just cast them before passing the nulls to the backends
Signed-off-by: Robin Appelman <robin@icewind.nl>
1 year ago
Robin Appelman
7ad3574d71
also update groupinterface and database backend
Signed-off-by: Robin Appelman <robin@icewind.nl>
1 year ago
Robin Appelman
e4b9ecd8f2
fix default values and type hints for GroupManager::search
ints really are ints
Signed-off-by: Robin Appelman <robin@icewind.nl>
1 year ago
Côme Chilliet
10296ba7e5
Fix tests, and fix Group::searchUsers to avoid duplicates
Also went back to searchUsers indexing the array by uid as it was the
previous behavior and the IGroup phpdoc does not say anything about the
keys.
Signed-off-by: Côme Chilliet <come.chilliet@nextcloud.com>
1 year ago
Côme Chilliet
346344c153
Update version number in since and deprecated annotations
Signed-off-by: Côme Chilliet <come.chilliet@nextcloud.com>
1 year ago
Côme Chilliet
b6c17c6ce7
Clear up return types
usersInGroup index by int for BC, searchInGroup index by uid (string).
Signed-off-by: Côme Chilliet <come.chilliet@nextcloud.com>
1 year ago
Côme Chilliet
3c2b126eba
Make code clearer and bump @ deprecated annotations
Signed-off-by: Côme Chilliet <come.chilliet@nextcloud.com>
1 year ago
Carl Schwan
a4c599c1c9
Split new method in a new group backend interface
Better for backward compatibility, also move new interfaces to nc 26
Signed-off-by: Carl Schwan <carl@carlschwan.eu>
1 year ago
Carl Schwan
35dc223500
Optimize retrieving display name when searching for users in a group
This is recurrent scenario that we are searching for users and then for
each users we fetch the displayName. This is inefficient, so instead try
to do one query to fetch everything (e.g. Database backend) or use the
already existing DisplayNameCache helper.
Signed-off-by: Carl Schwan <carl@carlschwan.eu>
2 years ago
Julien Veyssier
d9925806eb
dispatch new BeforeGroupChangedEvent before setDisplayName on groups
Signed-off-by: Julien Veyssier <julien-nc@posteo.net>
1 year ago
Côme Chilliet
f5c361cf44
composer run cs:fix
Signed-off-by: Côme Chilliet <come.chilliet@nextcloud.com>
1 year ago
Anna Larch
7c4ceb444c
Add group display name cache
Signed-off-by: Anna Larch <anna@nextcloud.com>
1 year ago
Côme Chilliet
32eef3b10f
Do not ignore return value of deleteGroup from backend
Signed-off-by: Côme Chilliet <come.chilliet@nextcloud.com>
2 years ago
Côme Chilliet
6be7aa112f
Migrate from ILogger to LoggerInterface in lib/private
Signed-off-by: Côme Chilliet <come.chilliet@nextcloud.com>
2 years ago
Côme Chilliet
d5544923a9
Strong type OC\Group\MetaData
Signed-off-by: Côme Chilliet <come.chilliet@nextcloud.com>
2 years ago
Côme Chilliet
3ecba9fd17
Fix typing of OC\Group\MetaData::sorting
Signed-off-by: Côme Chilliet <come.chilliet@nextcloud.com>
2 years ago
John Molakvoæ (skjnldsv)
215aef3cbd
Update php licenses
Signed-off-by: John Molakvoæ (skjnldsv) <skjnldsv@protonmail.com>
3 years ago
Tom Grant
23dbbca1a0
Fix indentation error
Signed-off-by: tgrant <tom.grant760@gmail.com>
3 years ago
tgrant
f1710b57bc
Fix null displayname crash as described in #21885
Signed-off-by: tgrant <tom.grant760@gmail.com>
3 years ago
Roeland Jago Douma
68ec18323d
Fix types in the Group Manager
Psalm found an issue. However the issue found was because of lying
docblocks. Fixed those and did some typing to make it all better.
For #25839
Signed-off-by: Roeland Jago Douma <roeland@famdouma.nl>
3 years ago
Johannes Leuker
2796ef80ff
Show group backends in occ group:list --info and group:info
Signed-off-by: Johannes Leuker <j.leuker@hosting.de>
3 years ago
Christoph Wurst
8b64e92b92
Bump doctrine/dbal from 2.12.0 to 3.0.0
Signed-off-by: Christoph Wurst <christoph@winzerhof-wurst.at>
3 years ago
Christoph Wurst
d89a75be0b
Update all license headers for Nextcloud 21
Signed-off-by: Christoph Wurst <christoph@winzerhof-wurst.at>
3 years ago
Morris Jobke
e4f53ff91b
Add typed events for adding and removing a subadmin
Signed-off-by: Morris Jobke <hey@morrisjobke.de>
3 years ago
Daniel Kesselberg
096fe20611
Help static code analysis to understand code.
It adds proper type hints to private namespace to allow private namespace methods.
Signed-off-by: Daniel Kesselberg <mail@danielkesselberg.de>
4 years ago
Morris Jobke
d3680e682a
Remove not needed semicolon and PHPDoc hint
Signed-off-by: Morris Jobke <hey@morrisjobke.de>
3 years ago
Morris Jobke
fee13e7ffd
Search also the email and displayname in user mangement for groups
Signed-off-by: Morris Jobke <hey@morrisjobke.de>
4 years ago
Christoph Wurst
a636aef585
Allow group search by display name
Signed-off-by: Christoph Wurst <christoph@winzerhof-wurst.at>
4 years ago
Robin Appelman
aa83b0b22d
dont get the group details if we only ask for the id
currenty when getting the groups for a user, the full group object is always created (and cached)
even if only the groupid is required
Signed-off-by: Robin Appelman <robin@icewind.nl>
4 years ago
Roeland Jago Douma
5ebb53593c
Improve group queries
Before we'd also get the diplayname for each group in the backend. In a
separate query. This is of course not ideal as this information is
obtained on each and every query. Now this is queried once and properly
cached.
Also added more caching to the manager.
Signed-off-by: Roeland Jago Douma <roeland@famdouma.nl>
4 years ago
Christoph Wurst
cb057829f7
Update license headers for 19
Signed-off-by: Christoph Wurst <christoph@winzerhof-wurst.at>
4 years ago
Christoph Wurst
734c62bee0
Format code according to PSR2
Signed-off-by: Christoph Wurst <christoph@winzerhof-wurst.at>
4 years ago
Christoph Wurst
28f8eb5dba
Add visibility to all constants
Signed-off-by: Christoph Wurst <christoph@winzerhof-wurst.at>
4 years ago
Christoph Wurst
caff1023ea
Format control structures, classes, methods and function
To continue this formatting madness, here's a tiny patch that adds
unified formatting for control structures like if and loops as well as
classes, their methods and anonymous functions. This basically forces
the constructs to start on the same line. This is not exactly what PSR2
wants, but I think we can have a few exceptions with "our" style. The
starting of braces on the same line is pracrically standard for our
code.
This also removes and empty lines from method/function bodies at the
beginning and end.
Signed-off-by: Christoph Wurst <christoph@winzerhof-wurst.at>
4 years ago
Christoph Wurst
14c996d982
Use elseif instead of else if
Signed-off-by: Christoph Wurst <christoph@winzerhof-wurst.at>
4 years ago
Christoph Wurst
44577e4345
Remove trailing and in between spaces
Signed-off-by: Christoph Wurst <christoph@winzerhof-wurst.at>
4 years ago
Christoph Wurst
36b3bc8148
Use php keywords in lowercase
Signed-off-by: Christoph Wurst <christoph@winzerhof-wurst.at>
4 years ago
Christoph Wurst
afbd9c4e6e
Unify function spacing to PSR2 recommendation
Signed-off-by: Christoph Wurst <christoph@winzerhof-wurst.at>
4 years ago
Christoph Wurst
2fbad1ed72
Fix (array) indent style to always use one tab
Signed-off-by: Christoph Wurst <christoph@winzerhof-wurst.at>
4 years ago
Christoph Wurst
85e369cddb
Fix multiline comments
Signed-off-by: Christoph Wurst <christoph@winzerhof-wurst.at>
4 years ago