The diff can be checked using: git diff --ignore-all-space --ignore-blank-lines
To see only the changes not related to blank lines.
Signed-off-by: Côme Chilliet <come.chilliet@nextcloud.com>
When an ownCloud-migrated group share (which has no per-user USERGROUP
subshare) is renamed for the first time, DefaultShareProvider::move()
inserted a new USERGROUP row without setting `accepted`. The column
defaulted to 0 (STATUS_PENDING), causing MountProvider to skip the
share on the next login — the shared file disappeared for the recipient.
Fix: set accepted = STATUS_ACCEPTED explicitly on the INSERT in
DefaultShareProvider::move() for the TYPE_GROUP branch.
Secondary fix: SharedMount::moveMount() silently returned true when
updateFileTarget() threw (e.g. group no longer exists on an OC-migrated
instance). Set $result = false in the catch block so View::rename()
propagates the failure instead of silently corrupting VFS state.
An opt-in occ command (sharing:fix-owncloud-group-shares) with --dry-run
support is included to repair existing broken instances. It targets only
TYPE_USERGROUP subshares with accepted=STATUS_PENDING and permissions!=0
(shares that were accepted but broken by the missing column default),
leaving explicitly declined shares (permissions=0) untouched.
AI-Assisted-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Signed-off-by: Anna Larch <anna@nextcloud.com>
Both `validateExpirationDateInternal()` and `validateExpirationDateLink()` implemented the
same algorithm for:
- skipping validation when no expiration date is allowed
- rejecting past expiration dates
- applying a default expiration date for new shares
- enforcing the maximum allowed expiration date
- running the `verifyExpirationDate` hook
This change keeps the existing behavior but centralizes the logic so future fixes only need to be made in one place.
This commit also fixes a tiny unrelated quoting bug in `dispatchEvent()` that caused garbled error-log output in `dispatchEvent()`.
Signed-off-by: Josh <josh.t.richards@gmail.com>
First check which users have a shares and for which providers and then
only load these shares.
Avoid doing at most 5 SQL queries for each users a share was shared with if
there are no shares.
Signed-off-by: Carl Schwan <carlschwan@kde.org>
Shares now expire at the end of the selected day instead of the
beginning, allowing access throughout the entire expiration day.
Also return actual stored time in API response instead of hardcoded
00:00:00 to prevent timezone-related display issues in the UI.
Signed-off-by: nfebe <fenn25.fn@gmail.com>
Follow-up of https://github.com/nextcloud/server/pull/57285
This ensure that the behavior is the same and reduce code duplication.
Salvatore's version seems to be more optimized, but I prefer those change to be done separately and for both methods.
Signed-off-by: Louis Chmn <louis@chmn.me>
This removes all the read after write and we don't need to queries all
the time the same share in the same request anymore.
Signed-off-by: Carl Schwan <carl.schwan@nextcloud.com>