Commit Graph

138 Commits (jtr/fix-public-exceptions-http-codes)

Author SHA1 Message Date
skjnldsv 89a2cae40d fix: join accounts_data instead of preferences when searching users
Signed-off-by: skjnldsv <skjnldsv@protonmail.com>
2025-10-23 08:59:10 +07:00
provokateurin 3c27522873
fix(IGroupManager): Use correct return type in getUserGroupIds method
Signed-off-by: provokateurin <kate@provokateurin.de>
2025-10-06 10:54:08 +07:00
provokateurin 51a493cbe7
fix(IGroupManager): Use correct return type for search method
Signed-off-by: provokateurin <kate@provokateurin.de>
2025-10-01 13:14:05 +07:00
Ferdinand Thiessen 660f3f6fd1
refactor: use logical `&&` `||` instead of weak `and` `or` operators
Signed-off-by: Ferdinand Thiessen <opensource@fthiessen.de>
2025-09-27 23:02:18 +07:00
Carl Schwan c4e6fbdae7 fix(query-builder): Don't catch UniqueConstraintViolationException
UniqueConstraintViolationException is no longer throw directly but
instead is now wrapped inside a \OCP\DB\Exception. So check the
exception reason.

Signed-off-by: Carl Schwan <carl.schwan@nextclound.com>
2025-09-02 11:55:58 +07:00
Carl Schwan c21b8169ff refactor(querybuilder): Port away from qb::execute() in lib/
Replace by either executeStatement or executeQuery

Signed-off-by: Carl Schwan <carl.schwan@nextclound.com>
2025-09-02 11:55:56 +07:00
Daniel Kesselberg 55bca1e5db fix: use logical operator instead of bitwise
Signed-off-by: Daniel Kesselberg <mail@danielkesselberg.de>
2025-06-10 13:55:53 +07:00
provokateurin 77114fb327
fix(OpenAPI): Adjust array syntax to avoid ambiguities
Signed-off-by: provokateurin <kate@provokateurin.de>
2024-11-05 09:58:11 +07:00
Git'Fellow c254855222 chore(db): Correctly apply query types
fix: psalm

fix: error

fix: add batch

fix: fatal error

fix: add batch

chore: add batch

chore: add batch

fix: psalm

fix: typo

fix: psalm

fix: return bool

fix: revert Manager
2024-10-17 09:21:07 +07:00
provokateurin 9836e9b164
chore(deps): Update nextcloud/coding-standard to v1.3.1
Signed-off-by: provokateurin <kate@provokateurin.de>
2024-09-19 14:21:20 +07:00
Daniel Kesselberg af6de04e9e
style: update codestyle for coding-standard 1.2.3
Signed-off-by: Daniel Kesselberg <mail@danielkesselberg.de>
2024-08-25 19:34:58 +07:00
Ferdinand Thiessen 4776b6600a
fix: Ensure database connection is setup when getting group details
Signed-off-by: Ferdinand Thiessen <opensource@fthiessen.de>
2024-08-06 13:41:04 +07:00
Louis Chemineau dff8815449
feat(users): Add support for admin delegation for users and groups management
Signed-off-by: Louis Chemineau <louis@chmn.me>
2024-07-22 17:17:35 +07:00
Joas Schilling 047479ccf9
feat(security): Add public API to allow validating IP Ranges and checking for "in range"
Signed-off-by: Joas Schilling <coding@schilljs.com>
Signed-off-by: Benjamin Gaussorgues <benjamin.gaussorgues@nextcloud.com>
2024-07-19 16:28:03 +07:00
Benjamin Gaussorgues 202e5b1e95
feat(security): restrict admin actions to IP ranges
Signed-off-by: Benjamin Gaussorgues <benjamin.gaussorgues@nextcloud.com>
2024-07-19 16:28:03 +07:00
Andy Scherzinger dae7c159f7
chore: Add SPDX header
Signed-off-by: Andy Scherzinger <info@andy-scherzinger.de>
2024-05-24 13:11:22 +07:00
Benjamin Gaussorgues e630e4b983
Merge pull request #44763 from nextcloud/fix/group_name_length_db 2024-05-16 14:22:30 +07:00
Côme Chilliet 672923f0a6
fix: Fix newly spotted psalm issues, add exhaustive typed magic properties for LDAP classes
Signed-off-by: Côme Chilliet <come.chilliet@nextcloud.com>
2024-04-30 09:23:58 +07:00
Benjamin Gaussorgues 7a6b1f8ae8
fix(groups): allows to save group names with more than 64 characters
Mimic behaviour from LDAP users and add a hard limit to 255 characters

Signed-off-by: Benjamin Gaussorgues <benjamin.gaussorgues@nextcloud.com>
2024-04-22 15:26:55 +07:00
Côme Chilliet ec5133b739 fix: Apply new coding standard to all files
Signed-off-by: Côme Chilliet <come.chilliet@nextcloud.com>
2024-04-02 14:16:21 +07:00
Hugo Renard e389e63974 fix: always add user to group cache
When there is no user in a group, and we add one, it's not added to the group cache. So consecutive call of addUser() and getUsers() is inconsistent.
Furthermore, the user cache is never null, so this check is unesserary.

Signed-off-by: Hugo Renard <hugo.renard@protonmail.com>
2024-03-26 11:07:37 +07:00
Arthur Schiwon c98b0462e3 fix(admin role): fix old and wrong way to determine whether user is admin
- fixes Settings knowing who is an admin of non-local group backend groups
- obsoletes and removes a little old, deprecated code
- double checks proper parameter type on Group\Manager::isAdmin
- also fixes legacy OC_User code to check whether user is an admin

Signed-off-by: Arthur Schiwon <blizzz@arthur-schiwon.de>
2024-02-19 18:57:22 +07:00
Côme Chilliet 8bcc2d352e chore: Fix missing template parameter for IEventListener
Signed-off-by: Côme Chilliet <come.chilliet@nextcloud.com>
2024-01-30 10:57:15 +07:00
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>
2023-11-23 10:36:13 +07:00
Christoph Wurst ea8f9a7e84 refactor: Repalce array_search with in_array in lib/
Signed-off-by: Christoph Wurst <christoph@winzerhof-wurst.at>
2023-11-22 11:42:53 +07:00
Christoph Wurst d779092564
Merge pull request #38425 from nextcloud/feat/ocp/strict-igroup
feat(ocp): Add types and strict typing to \OCP\Group\IGroup
2023-11-02 11:07:12 +07:00
Côme Chilliet d18bb7e9bb
Build query once instead of in-loop
Signed-off-by: Côme Chilliet <come.chilliet@nextcloud.com>
2023-09-07 17:07:47 +07:00
Christoph Wurst 312dd8ac6d feat(ocp): Add types and strict typing to \OCP\Group\IGroup
Signed-off-by: Christoph Wurst <christoph@winzerhof-wurst.at>
2023-09-06 11:58:09 +07:00
Côme Chilliet 35069ad86a
Fix psalm spotted type errors
Signed-off-by: Côme Chilliet <come.chilliet@nextcloud.com>
2023-09-05 16:56:48 +07:00
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>
2023-09-05 16:56:48 +07:00
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>
2023-09-05 16:56:47 +07:00
Joas Schilling daac5c9a95
fix(cache): Remove displayname cache entry on delete
Signed-off-by: Joas Schilling <coding@schilljs.com>
2023-08-28 14:59:54 +07:00
Joas Schilling 80f79e170d
fix!: Remove symfony EventDispatcherInterface from Group
Signed-off-by: Joas Schilling <coding@schilljs.com>
2023-07-27 23:13:37 +07:00
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>
2023-05-11 17:30:04 +07:00
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>
2023-05-11 17:30:03 +07:00
Robin Appelman 7ad3574d71
also update groupinterface and database backend
Signed-off-by: Robin Appelman <robin@icewind.nl>
2023-05-11 17:30:03 +07:00
Robin Appelman e4b9ecd8f2
fix default values and type hints for GroupManager::search
ints really are ints

Signed-off-by: Robin Appelman <robin@icewind.nl>
2023-05-11 17:30:01 +07:00
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>
2023-05-02 11:35:41 +07:00
Côme Chilliet 346344c153
Update version number in since and deprecated annotations
Signed-off-by: Côme Chilliet <come.chilliet@nextcloud.com>
2023-04-27 12:04:32 +07:00
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>
2023-04-27 12:00:45 +07:00
Côme Chilliet 3c2b126eba
Make code clearer and bump @ deprecated annotations
Signed-off-by: Côme Chilliet <come.chilliet@nextcloud.com>
2023-04-27 12:00:07 +07:00
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>
2023-04-27 12:00:01 +07:00
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>
2023-04-27 11:57:45 +07:00
Julien Veyssier d9925806eb
dispatch new BeforeGroupChangedEvent before setDisplayName on groups
Signed-off-by: Julien Veyssier <julien-nc@posteo.net>
2023-02-21 10:42:38 +07:00
Côme Chilliet f5c361cf44
composer run cs:fix
Signed-off-by: Côme Chilliet <come.chilliet@nextcloud.com>
2023-01-20 11:45:08 +07:00
Anna Larch 7c4ceb444c Add group display name cache
Signed-off-by: Anna Larch <anna@nextcloud.com>
2022-11-28 11:52:55 +07:00
Côme Chilliet 32eef3b10f
Do not ignore return value of deleteGroup from backend
Signed-off-by: Côme Chilliet <come.chilliet@nextcloud.com>
2022-04-04 16:40:07 +07:00
Côme Chilliet 6be7aa112f
Migrate from ILogger to LoggerInterface in lib/private
Signed-off-by: Côme Chilliet <come.chilliet@nextcloud.com>
2022-03-24 16:21:25 +07:00
Côme Chilliet d5544923a9
Strong type OC\Group\MetaData
Signed-off-by: Côme Chilliet <come.chilliet@nextcloud.com>
2022-03-08 16:44:22 +07:00
Côme Chilliet 3ecba9fd17
Fix typing of OC\Group\MetaData::sorting
Signed-off-by: Côme Chilliet <come.chilliet@nextcloud.com>
2022-03-08 15:49:29 +07:00