Compare commits

...

417 Commits

Author SHA1 Message Date
blizzz b9a56ee753 Merge pull request #31187 from nextcloud/release/23.0.2
23.0.2
2022-02-15 14:34:52 +01:00
blizzz d98fe9d23c Merge pull request #31171 from nextcloud/stable23-disable-bulkupload
[stable23] Disable bulk upload by not advertising it
2022-02-15 13:43:45 +01:00
Arthur Schiwon d72efb666c 23.0.2
Signed-off-by: Arthur Schiwon <blizzz@arthur-schiwon.de>
2022-02-15 13:32:15 +01:00
Joas Schilling 585d069a71 Also comment out in test
Signed-off-by: Joas Schilling <coding@schilljs.com>
2022-02-15 07:14:14 +01:00
Vincent Petry 58cec19291 Disable bulk upload by not advertising it
It has been reported broken on many instances.
Disable it for now until it can be fixed.

Signed-off-by: Vincent Petry <vincent@nextcloud.com>
2022-02-14 16:14:57 +01:00
blizzz 2260f1e914 Merge pull request #31126 from nextcloud/release/23.0.2rc1
23.0.2 RC 1
2022-02-11 12:14:31 +01:00
Arthur Schiwon 768337cb95 23.0.2 RC 1
Signed-off-by: Arthur Schiwon <blizzz@arthur-schiwon.de>
2022-02-11 11:42:19 +01:00
Vincent Petry 24349b9130 Merge pull request #31108 from nextcloud/backport/31077/stable23
[stable23] Revert the 'broken' public page changes
2022-02-10 19:31:55 +01:00
blizzz 639d4b6a15 Merge pull request #31107 from nextcloud/backport/30936/stable23
[stable23] Fix duplicated UUID migration issue
2022-02-10 19:13:08 +01:00
szaimen 6bbfaee8bd Revert "Add non-breaking space in the file size"
Signed-off-by: szaimen <szaimen@e.mail.de>
2022-02-10 16:47:40 +00:00
Carl Schwan a87bd0ad40 Revert "Improve layout for the public download page"
This reverts commit 2e55ce0899.

Signed-off-by: Carl Schwan <carl@carlschwan.eu>
2022-02-10 16:47:39 +00:00
Carl Schwan 970b65c139 Revert "Fix loading of the text app in public shared links"
This reverts commit d3d117c4a8.

Signed-off-by: Carl Schwan <carl@carlschwan.eu>
2022-02-10 16:47:38 +00:00
Arthur Schiwon 092819d89b Setup warning for invalid LDAP user or group UUIDs.
Signed-off-by: Arthur Schiwon <blizzz@arthur-schiwon.de>
2022-02-10 17:46:51 +01:00
Côme Chilliet 8cd5a901a8 Fix psalm errors in apps/user_ldap/lib/Jobs/CleanUp.php
Signed-off-by: Côme Chilliet <come.chilliet@nextcloud.com>
2022-02-10 17:46:18 +01:00
Côme Chilliet 3c259d76ee Fix ldap:update-uuid
Generators cannot be iterated with while or returned by an other
 generator, using foreach instead.
And a few other problems.

Signed-off-by: Côme Chilliet <come.chilliet@nextcloud.com>
2022-02-10 17:46:09 +01:00
Arthur Schiwon b954462667 add occ command to update UUIDs (incomplete)
Signed-off-by: Arthur Schiwon <blizzz@arthur-schiwon.de>
2022-02-10 17:45:48 +01:00
Arthur Schiwon 9153d698bc allow to re-run migration step when backup DB is already created
- to heal incomplete states from broken upgrades

Signed-off-by: Arthur Schiwon <blizzz@arthur-schiwon.de>
2022-02-10 17:45:01 +01:00
Arthur Schiwon f975fe4ff3 invalidated duplicated UUIDs prior to migration change
- in a proper setup there are no duplicated UUIDs
- not all setups are proper
- log warning to admin

Signed-off-by: Arthur Schiwon <blizzz@arthur-schiwon.de>
2022-02-10 17:44:46 +01:00
Vincent Petry 1e2baa5a6b Merge pull request #30975 from nextcloud/nickvergessen-patch-1
Update version.php
2022-02-02 15:46:45 +01:00
Joas Schilling 26c97a4fbc Update version.php 2022-02-02 15:42:36 +01:00
Carl Schwan 0f6e1533d4 Merge pull request #30915 from nextcloud/fix/psalm-composer-stable23
[stable23] Fix psalm warning related to registerEventListener
2022-02-01 11:07:33 +01:00
Louis 77dec31419 Merge pull request #30800 from nextcloud/dependabot/npm_and_yarn/stable23/jquery-ui-1.13.1
Bump jquery-ui from 1.13.0 to 1.13.1
2022-01-31 16:40:43 +01:00
dependabot[bot] 1316acc445 Bump jquery-ui from 1.13.0 to 1.13.1
Bumps [jquery-ui](https://github.com/jquery/jquery-ui) from 1.13.0 to 1.13.1.
- [Release notes](https://github.com/jquery/jquery-ui/releases)
- [Commits](https://github.com/jquery/jquery-ui/compare/1.13.0...1.13.1)

---
updated-dependencies:
- dependency-name: jquery-ui
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
Signed-off-by: nextcloud-command <nextcloud-command@users.noreply.github.com>
2022-01-31 13:23:46 +00:00
Louis abf2ed8ce7 Merge pull request #30890 from nextcloud/backport/30886/stable23
[stable23] Fixes occ user:info when the user never logged in
2022-01-31 13:44:37 +01:00
Louis e02f1a51d1 Merge pull request #30912 from nextcloud/dependabot/npm_and_yarn/stable23/clipboard-2.0.9
Bump clipboard from 2.0.8 to 2.0.9
2022-01-31 13:41:21 +01:00
dependabot[bot] fa064dd3a9 Bump clipboard from 2.0.8 to 2.0.9
Bumps [clipboard](https://github.com/zenorocha/clipboard.js) from 2.0.8 to 2.0.9.
- [Release notes](https://github.com/zenorocha/clipboard.js/releases)
- [Commits](https://github.com/zenorocha/clipboard.js/compare/v2.0.8...v2.0.9)

---
updated-dependencies:
- dependency-name: clipboard
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
Signed-off-by: nextcloud-command <nextcloud-command@users.noreply.github.com>
2022-01-31 11:50:08 +00:00
Côme Chilliet 19324e6342 Fixes occ user:info when the user never logged in
Signed-off-by: Côme Chilliet <come.chilliet@nextcloud.com>
2022-01-31 10:26:20 +00:00
Louis 094c10a6e5 Merge pull request #30913 from nextcloud/dependabot/npm_and_yarn/stable23/webpack-cli-4.9.2
Bump webpack-cli from 4.9.1 to 4.9.2
2022-01-31 10:32:53 +01:00
Carl Schwan d9d60687bd Merge pull request #30911 from nextcloud/dependabot/npm_and_yarn/stable23/dompurify-2.3.5
Bump dompurify from 2.3.4 to 2.3.5
2022-01-30 09:50:55 +01:00
dependabot[bot] 64b7a50b6c Bump dompurify from 2.3.4 to 2.3.5
Bumps [dompurify](https://github.com/cure53/DOMPurify) from 2.3.4 to 2.3.5.
- [Release notes](https://github.com/cure53/DOMPurify/releases)
- [Commits](https://github.com/cure53/DOMPurify/compare/2.3.4...2.3.5)

---
updated-dependencies:
- dependency-name: dompurify
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
Signed-off-by: nextcloud-command <nextcloud-command@users.noreply.github.com>
2022-01-30 01:08:53 +00:00
Carl Schwan 003f2b59c9 Fix psalm warning related to registerEventListener
Signed-off-by: Carl Schwan <carl@carlschwan.eu>
2022-01-29 12:44:02 +01:00
dependabot[bot] 25530ede6f Bump webpack-cli from 4.9.1 to 4.9.2
Bumps [webpack-cli](https://github.com/webpack/webpack-cli) from 4.9.1 to 4.9.2.
- [Release notes](https://github.com/webpack/webpack-cli/releases)
- [Changelog](https://github.com/webpack/webpack-cli/blob/master/CHANGELOG.md)
- [Commits](https://github.com/webpack/webpack-cli/compare/webpack-cli@4.9.1...webpack-cli@4.9.2)

---
updated-dependencies:
- dependency-name: webpack-cli
  dependency-type: direct:development
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
2022-01-29 03:36:11 +00:00
John Molakvoæ e69281c66f Merge pull request #30840 from nextcloud/releases/23.0.1 2022-01-27 20:33:21 +01:00
John Molakvoæ 3ee9bcc4f7 Merge pull request #30814 from nextcloud/backport/30508/stable23 2022-01-27 20:06:29 +01:00
Carl Schwan d69531ac8e Fix psalm not running
The issue was that we were using psalm/phar instead of vimeo/psalm. This
caused issue with the custom psalm plugin in buildd/psalm.

This is using the opportunity to also update the psalm version from 3.8
to 3.17 and the php-cs-fixer too.

Signed-off-by: Carl Schwan <carl@carlschwan.eu>
2022-01-27 17:20:00 +01:00
John Molakvoæ 8de4709a10 Merge pull request #30872 from nextcloud/backport/30844/stable23 2022-01-27 10:42:51 +01:00
John Molakvoæ f6f4c6c94f Prevent merging on EOL branches
Signed-off-by: John Molakvoæ <skjnldsv@protonmail.com>
2022-01-27 08:09:09 +00:00
John Molakvoæ dd5ef2c3b0 Merge pull request #30847 from nextcloud/backport/30846/stable23 2022-01-26 13:13:03 +01:00
Louis Chemineau 91e49958bb Fix php:cs
Signed-off-by: Louis Chemineau <louis@chmn.me>
2022-01-26 10:48:50 +00:00
John Molakvoæ 380f31114f 23.0.1 Final 2022-01-25 14:53:02 +01:00
John Molakvoæ 6b22bc3df2 Merge pull request #30799 from nextcloud/dependabot/composer/build/integration/stable23/sabre/dav-4.3.1 2022-01-24 08:07:48 +01:00
John Molakvoæ 37b49e615c Merge pull request #30740 from nextcloud/backport23 2022-01-22 19:03:33 +01:00
John Molakvoæ 269f04b1b8 Merge pull request #30811 from nextcloud/backport/30795/stable23 2022-01-22 14:14:56 +01:00
John Molakvoæ 0c631830bb Merge pull request #30773 from nextcloud/backport/30769/stable23 2022-01-22 10:25:50 +01:00
Carl Schwan fc3b256dda Fix accessing undefined offsets
Move this to inside the else clause of the count($matches)

Signed-off-by: Carl Schwan <carl@carlschwan.eu>
2022-01-22 08:58:20 +00:00
dependabot[bot] 454c61be82 Update sabre/dav requirement from 4.3.0 to 4.3.1 in /build/integration
Updates the requirements on [sabre/dav](https://github.com/sabre-io/dav) to permit the latest version.
- [Release notes](https://github.com/sabre-io/dav/releases)
- [Changelog](https://github.com/sabre-io/dav/blob/master/CHANGELOG.md)
- [Commits](https://github.com/sabre-io/dav/compare/4.3.0...4.3.1)

---
updated-dependencies:
- dependency-name: sabre/dav
  dependency-type: direct:development
...

Signed-off-by: dependabot[bot] <support@github.com>
2022-01-22 02:10:48 +00:00
John Molakvoæ 8cb7adc131 Merge pull request #30765 from nextcloud/release/23.0.1rc3 2022-01-20 21:37:22 +01:00
John Molakvoæ c0b03000a5 Merge pull request #30782 from nextcloud/backport/29349/stable23 2022-01-20 21:25:58 +01:00
Robin Appelman 13b8179912 Add test for samba kerberos sso in ci
Signed-off-by: Robin Appelman <robin@icewind.nl>
2022-01-20 19:18:28 +00:00
Robin Appelman 0cdcccf9fe update icewind/smb to 3.5.2
Signed-off-by: Robin Appelman <robin@icewind.nl>
2022-01-20 19:18:27 +00:00
Robin Appelman 48f6d0f2f6 update to release smb lib
Signed-off-by: Robin Appelman <robin@icewind.nl>
2022-01-20 19:18:25 +00:00
Robin Appelman 39b294e0f8 update icewind/smb to 3.5.1
Signed-off-by: Robin Appelman <robin@icewind.nl>
2022-01-20 19:18:24 +00:00
Arthur Schiwon efad8ab4e3 do not use deprecated query() method
Signed-off-by: Arthur Schiwon <blizzz@arthur-schiwon.de>
2022-01-20 19:18:23 +00:00
Arthur Schiwon 8245c81584 add changes from Sebastian/dassIT and move default_realm to backend
- Sebastian added the switch depending on the preg_match result and with it
  the fall back to login credentials
- I turned default_realm to a backend option (was previously suggested as
  system config key)

Signed-off-by: Arthur Schiwon <blizzz@arthur-schiwon.de>
2022-01-20 19:18:22 +00:00
Arthur Schiwon dddab717bf add KerberosApacheAuth support to files_external
Signed-off-by: Arthur Schiwon <blizzz@arthur-schiwon.de>
2022-01-20 19:18:21 +00:00
Côme Chilliet 20c3f6d634 Always call flush() as getAllKeys() is broken
Signed-off-by: Côme Chilliet <come.chilliet@nextcloud.com>
2022-01-20 15:38:02 +00:00
John Molakvoæ 4466eb1f42 Merge pull request #30728 from nextcloud/backport/30614/stable23 2022-01-20 11:12:34 +01:00
Carl Schwan fab0e6dbe7 Fix tests with email templates
Signed-off-by: Carl Schwan <carl@carlschwan.eu>
2022-01-20 10:37:59 +01:00
John Molakvoæ 2645b6cd69 Merge pull request #29798 from nextcloud/stable23-disk 2022-01-20 10:36:40 +01:00
John Molakvoæ 182d1a3741 Merge pull request #30759 from nextcloud/backport/30731/stable23 2022-01-20 10:36:13 +01:00
John Molakvoæ 298333f07c 23.0.1 RC3
Signed-off-by: John Molakvoæ <skjnldsv@protonmail.com>
2022-01-20 10:16:39 +01:00
Joas Schilling 713342cd23 Log bruteforce throttle and blocking
Signed-off-by: Joas Schilling <coding@schilljs.com>
2022-01-19 11:51:43 +00:00
John Molakvoæ f5dd452d5f Merge pull request #30753 from nextcloud/backport/30738/stable23 2022-01-19 11:04:33 +01:00
John Molakvoæ 84df632d62 Merge pull request #30747 from nextcloud/backport/30615/stable23 2022-01-19 10:45:33 +01:00
Joas Schilling 32c0710aa7 Create block-merge-freeze.yml
Signed-off-by: John Molakvoæ <skjnldsv@protonmail.com>
2022-01-19 09:21:13 +00:00
Christopher Ng 38221b8c68 Update autoload and ClassLoader
Signed-off-by: Christopher Ng <chrng8@gmail.com>
2022-01-19 02:12:15 +00:00
Christopher Ng 2063c58623 Improve installation pages
Signed-off-by: Christopher Ng <chrng8@gmail.com>
(cherry picked from commit 22768769c3)
Signed-off-by: nextcloud-command <nextcloud-command@users.noreply.github.com>
2022-01-19 00:42:55 +00:00
Carl Schwan 49a8a8fa98 Merge pull request #30734 from nextcloud/backport/30470/stable23
[stable23] Hash job argument
2022-01-18 17:02:37 +01:00
acsfer 61509de933 [stable23] Increase email main buttons width for non-english languages
Manual backport of https://github.com/nextcloud/server/pull/30653
2022-01-18 16:01:26 +01:00
Julius Härtl fb032ad04d Add hashed attribute column for indexed job existence check
Signed-off-by: Julius Härtl <jus@bitgrid.net>
2022-01-18 15:09:27 +01:00
Marek-Wojtowicz 10ae5acf64 Update Session.php
The http headers according to rfc 2616 is iso-8859-1. This patch fixes the behavior when non-ascii characters are present in the header.

Signed-off-by: Marek Wójtowicz <Marek.Wojtowicz@agh.edu.pl>
2022-01-17 23:23:17 +00:00
MichaIng 58b4db7f7d Merge pull request #30685 from nextcloud/backport/29923/stable23
[stable23] Fix users can't login external mount user entered credentials not set
2022-01-17 21:20:05 +01:00
max-nextcloud 90ac982503 Merge pull request #30722 from nextcloud/backport/30719/stable23
[stable23] Fix loading of the text app in public shared links
2022-01-17 20:45:25 +01:00
Carl Schwan f989dcbea8 Fix loading of the text app in public shared links
Instead of doing the centering for the entire public content, only do it
for the preview. This is more safe.

Signed-off-by: Carl Schwan <carl@carlschwan.eu>
2022-01-17 18:03:28 +00:00
blizzz 93fda5154d Merge pull request #30678 from nextcloud/release/23.0.1rc2
23.0.1 RC2
2022-01-17 12:28:47 +01:00
Carl Schwan 253d502471 Merge pull request #30684 from nextcloud/backport/30531/stable23
[stable23] Optimize FileSystemTags workflow for groupfolder
2022-01-17 10:15:26 +01:00
MichaIng 6c0d6e23e7 Merge pull request #30688 from nextcloud/backport/30499/stable23
[stable23] Remove inefficient fed share scanner
2022-01-15 02:52:03 +01:00
MichaIng 78f38493ba Merge pull request #30689 from nextcloud/backport/30645/stable23
[stable23] New Files internal link GET param to avoid opening the file
2022-01-15 02:50:26 +01:00
MichaIng 9f7c05cf4f Merge pull request #30695 from nextcloud/backport/30631/stable23
[stable23] updateEncryptedVersion: cleanup on target if cache already got renamed
2022-01-15 02:48:12 +01:00
MichaIng 5bebac3ab2 Merge pull request #30698 from nextcloud/backport/30655/stable23
[stable23] Improve layout for the public download page
2022-01-15 02:39:47 +01:00
Carl Schwan 05cb962361 Add non-breaking space in the file size
Signed-off-by: Carl Schwan <carl@carlschwan.eu>
2022-01-14 22:34:05 +00:00
Carl Schwan 7c1dfd9850 Improve layout for the public download page
This centers the content inside the pages, while also not hardcoded the
size of the footer.

Signed-off-by: Carl Schwan <carl@carlschwan.eu>
2022-01-14 22:34:04 +00:00
Jonas Meurer 9da4620ff8 updateEncryptedVersion: cleanup on target if cache already got renamed
When moving a file to trash with encryption enabled, the cache gets
moved before the actual file. According to @icewind1991 this is in order
to not break object storage.

When moving a file from an unencrypted storage (e.g. a collectives
storage) to the encrypted trashbin storage, this causes errors, see

This commit fixes it by doing `updateEncryptedVersion()` on the target
cache entry *if* the source cache entry doesn't exist anymore, but the
corresponding target cache entry does exist already.

Fixes: #26544

Signed-off-by: Jonas Meurer <jonas@freesources.org>
2022-01-14 21:41:10 +00:00
Julien Veyssier 55dd10acca [files] new internal link GET param to avoid setting 'openfile' on redirect
Signed-off-by: Julien Veyssier <eneiluj@posteo.net>
2022-01-14 16:57:51 +00:00
John Molakvoæ 834385a190 Merge pull request #30672 from nextcloud/backport/stable23/30597 2022-01-14 17:30:13 +01:00
Vincent Petry 3cac62f7ba Remove inefficient fed share scanner
Remove scanAll which relies on the "shareinfo" endpoint that returns the
full cache tree.
The latter can become big for big shares and result in timeouts.
Furthermode, the full tree would be retrieved again for each and every
detected change which can become expensive quickly.

Signed-off-by: Vincent Petry <vincent@nextcloud.com>
2022-01-14 16:09:03 +00:00
John Molakvoæ bbde8dafeb Merge pull request #30674 from nextcloud/backport/30275/stable23 2022-01-14 16:27:21 +01:00
Anderson Luiz Alves f71593e3d5 files_external SMB: throw InvalidArgument when user is not set
Signed-off-by: Anderson Luiz Alves <alacn1@gmail.com>
2022-01-14 15:16:18 +00:00
Carl Schwan 61624c2213 Fix psalm issues
Signed-off-by: Carl Schwan <carl@carlschwan.eu>
2022-01-14 14:17:11 +00:00
Carl Schwan c3fcb2c199 Add helper method in Wrapper
Signed-off-by: Carl Schwan <carl@carlschwan.eu>
2022-01-14 14:17:06 +00:00
Carl Schwan 3c060e54fa The storage is not static anymore
Don't call twice $cache->getId

Signed-off-by: Carl Schwan <carl@carlschwan.eu>
2022-01-14 14:17:04 +00:00
Carl Schwan 88774cfbba Optimize FileSystemTags workflow for groupfolder
In https://github.com/nextcloud/server/pull/28774 we disabled the
caching for the groupfolder application since it worked due to the fact
that in groupfolders, getFileIds could be called with the same $cacheId
and path for actually different groupfolders.

This revert this change and instead add the folderId from the
groupFolder to the cacheId. This solve the issue of the uniqueness of
the cacheId inside GroupFolder. Downside is that we introduce
groupfolder specific implementation inside the server repo.

The seconf optimization is to not consider paths starting with
__groupfolders in executeCheck. This is due to the fact that files in
the groupfolder application call two times executeCheck one time with
the url __groupfolder/<folderId>/<path> and the other time with <path>.
The first time will always return an empty systemTags array while the
second call will return the correct system tags.

Signed-off-by: Carl Schwan <carl@carlschwan.eu>
2022-01-14 14:17:00 +00:00
Simon L 377336a8f1 Merge pull request #30671 from nextcloud/backport/30363/stable23
[stable23] improve accessibility settings on mobile
2022-01-14 14:31:05 +01:00
Arthur Schiwon 2d147a4c4c 23.0.1 RC2
Signed-off-by: Arthur Schiwon <blizzz@arthur-schiwon.de>
2022-01-14 12:46:43 +01:00
Vincent Petry 3bdd8aeba0 Merge pull request #30662 from nextcloud/backport/30530/stable23
[stable23] Fix wrong unified search link to folder
2022-01-14 12:21:22 +01:00
blizzz c36ae149a0 Merge pull request #30663 from nextcloud/backport/30568/stable23
[stable23] Fix primary key change in user_ldap migration
2022-01-14 12:04:06 +01:00
Joas Schilling 28c6a4db1d Add version of disabled apps when available
Signed-off-by: Joas Schilling <coding@schilljs.com>
2022-01-14 11:02:47 +00:00
Carl Schwan 1904793d4b Fix file picker not respecting hidden files settings
This will only respect the setting inside the file app. For other apps
we will either need to do an API call or add an input field with the
same idea to spare a blocking api call.

Signed-off-by: Carl Schwan <carl@carlschwan.eu>
(cherry picked from commit 1fa58be1aa)
2022-01-14 11:46:43 +01:00
Julius Härtl 1938c41ace Merge pull request #30659 from nextcloud/backport/29622/stable23 2022-01-14 10:41:46 +01:00
szaimen 963220dbd7 address 2nd review
Signed-off-by: szaimen <szaimen@e.mail.de>
2022-01-14 09:39:16 +00:00
szaimen 729ef0063f address review
Signed-off-by: szaimen <szaimen@e.mail.de>
2022-01-14 09:39:15 +00:00
szaimen f47835cec3 improve accessibility settings on mobile
Signed-off-by: szaimen <szaimen@e.mail.de>
Signed-off-by: nextcloud-command <nextcloud-command@users.noreply.github.com>
2022-01-14 09:39:14 +00:00
Carl Schwan f4fcbaa8b9 Merge pull request #30643 from nextcloud/backport/30600/stable23
[stable23] Fix idn emails not working in shares
2022-01-14 10:08:19 +01:00
Côme Chilliet 101338063e Remove useless indexes with duplicated names on backup table
Signed-off-by: Côme Chilliet <come.chilliet@nextcloud.com>
2022-01-14 08:31:42 +00:00
Joas Schilling 9a9c8602e4 Update autoloader
Signed-off-by: Joas Schilling <coding@schilljs.com>
2022-01-14 08:31:41 +00:00
Côme Chilliet e4235bdeba Fix user_ldap migration for long DNs support
Signed-off-by: Côme Chilliet <come.chilliet@nextcloud.com>
2022-01-14 08:31:40 +00:00
Côme Chilliet 66ca2925e7 Move duplicated code to a base class for group_mapping migrations
Signed-off-by: Côme Chilliet <come.chilliet@nextcloud.com>
Co-authored-by: Joas Schilling <213943+nickvergessen@users.noreply.github.com>
2022-01-14 08:31:38 +00:00
Côme Chilliet 03a570a500 Split dropTable and createTable in two migrations
It is not possible to drop and create the same table in one migration

Signed-off-by: Côme Chilliet <come.chilliet@nextcloud.com>
2022-01-14 08:31:38 +00:00
Côme Chilliet d90e9088d0 Fix primary key change in user_ldap migration
Use a backup table to copy the data, drop table and recreate it with
 correct primary key, then copy the data back and drop the backup table.

Signed-off-by: Côme Chilliet <come.chilliet@nextcloud.com>
2022-01-14 08:31:36 +00:00
John Molakvoæ c124c27cdf Fix wrong unified search link to folder
Signed-off-by: John Molakvoæ <skjnldsv@protonmail.com>
2022-01-14 08:22:29 +00:00
John Molakvoæ 05a13d3dc6 Implement multibucket shift for ObjectStore
Signed-off-by: John Molakvoæ <skjnldsv@protonmail.com>
2022-01-14 08:31:38 +01:00
Carl Schwan 2b2d23ce21 Fix idn emails not working in shares
And add check before sending email that email address is valid

Fix #30595

Signed-off-by: Carl Schwan <carl@carlschwan.eu>
2022-01-13 17:10:43 +01:00
Vincent Petry 26b5949102 Merge pull request #30636 from nextcloud/backport/30620/stable23
[stable23] Properly abort uploads
2022-01-13 11:35:38 +01:00
Vincent Petry ac9ad51b10 Properly hide progress bar after error
Whenever an error occurs, also hide the progress bar.

The logic was also adjusted to properly detect uploads that are pending
deletion, in which case the progress bar can already be hidden.

Signed-off-by: Vincent Petry <vincent@nextcloud.com>
2022-01-13 08:29:29 +00:00
Vincent Petry c78d542596 Properly abort uploads
Add a new approach for flagging an upload as aborted because we can't
rely on the browser fully cancelling the request as we now seem to
receive an error response from the server instead of a jQuery "abort"
message.

Signed-off-by: Vincent Petry <vincent@nextcloud.com>
2022-01-13 08:29:28 +00:00
Vincent Petry c2f3f37f69 Merge pull request #30627 from nextcloud/backport/30593/stable23
[stable23] Trigger "changeDirectory" event on URL change
2022-01-12 17:42:45 +01:00
MichaIng 0323ced93a Merge pull request #30621 from nextcloud/backport/30358/stable23
[stable23] Reset job disabling timer on adding the job again
2022-01-12 16:01:56 +01:00
Vincent Petry 3340861c82 Trigger "changeDirectory" even on URL change
When using the browser back button or clicking on sections on the left
sidebar (like favorites), the "changeDirectory" jQuery event did not get
called, so apps like recommendations would not notice the directory
change.

This fixes the issue by also setting changeUrl to true when the file
list's directory got changed as a result from a URL change.

Added optional changedThroughUrl argument to make sure the event
recipient knows if the change was done through a URL change and make it
possible prevent a loop in the onDirectoryChange handler that actually
changes the URL when the origin was already from a URL change.

Signed-off-by: Vincent Petry <vincent@nextcloud.com>
2022-01-12 13:46:13 +00:00
Carl Schwan 693771fd81 Merge pull request #30619 from nextcloud/backport/30609/stable23
[stable23] Fix RequestURL check for cli commands
2022-01-12 14:01:00 +01:00
Joas Schilling b89e743976 Merge pull request #30611 from nextcloud/backport/30588/stable23
[stable23] Fix undefined/unset scope in account properties
2022-01-12 13:51:07 +01:00
Louis 141524a0e2 Merge pull request #30623 from nextcloud/backport/30485/stable23
[stable23] Set the file's mtime from the headers in bulk upload
2022-01-12 13:36:38 +01:00
Louis Chemineau bb81f7afd8 Set the file's mtime from the headers in bulk upload
Signed-off-by: Louis Chemineau <louis@chmn.me>
2022-01-12 11:00:50 +00:00
Julius Härtl d7cb3d0643 Reset job disabling timer on adding the job again
Signed-off-by: Julius Härtl <jus@bitgrid.net>
2022-01-12 10:52:51 +00:00
blizzz 6d2b690881 Merge pull request #30602 from nextcloud/backport/30291/stable23
[stable23] Prevent loading images that would require too much memory.
2022-01-12 11:16:48 +01:00
Carl Schwan 1b8f9420a3 Fix RequestURL check for cli commands
Fix https://github.com/nextcloud/files_automatedtagging/issues/526

Fix https://github.com/nextcloud/groupfolders/issues/1855

Signed-off-by: Carl Schwan <carl@carlschwan.eu>
2022-01-12 09:07:31 +00:00
Joas Schilling 08037eac25 Fix test
Signed-off-by: Joas Schilling <coding@schilljs.com>
2022-01-11 18:44:56 +00:00
Joas Schilling 8fde21460f Fix undefined/unset scope in account properties
Signed-off-by: Joas Schilling <coding@schilljs.com>
2022-01-11 18:44:52 +00:00
Joachim Bauch cebac86ecd Prevent loading images that would require too much memory.
For most image formats, the header specifies the width/height.
PHP allocates an image object from that size, even if the actual
image data is much smaller. This image object size is not limited
by the limit configured in PHP.

The memory limit can be configured through "config.php" setting
"preview_max_memory" and defaults to 128 MBytes which should be
enough for most images without filling up all memory.

Signed-off-by: Joachim Bauch <bauch@struktur.de>
2022-01-11 14:49:08 +00:00
MichaIng c5ea067795 Merge pull request #30594 from nextcloud/backport/30533/stable23
[stable23] Avoid zero division in setup checks
2022-01-11 15:35:18 +01:00
Louis 4846f5d33e Merge pull request #30592 from nextcloud/backport/30571/stable23
[stable23] fix: only use jquery once it is available
2022-01-11 14:18:28 +01:00
MichaIng 755381a4c2 Avoid zero division in setup checks
Fixes: https://github.com/nextcloud/server/issues/30532

Signed-off-by: MichaIng <micha@dietpi.com>
2022-01-11 12:42:02 +00:00
Azul 08016ac02d fix: only use jquery once it is available
publicpage.js is loaded very early and cannot rely on jquery being loaded already.

Move the use of `$` into the `DomContentLoaded` handler.

Signed-off-by: Azul <azul@riseup.net>
2022-01-11 10:34:44 +00:00
Louis ad5501a464 Merge pull request #30576 from nextcloud/backport/30565/stable23
[stable23] Fix fail when keys/files folder already exists
2022-01-11 10:44:10 +01:00
Vincent Petry 9eeaed0051 Fix fail when keys/files folder already exists
Fixes an issue with transfer ownership in move mode where the folder
"files_encryption/keys/files" already exists.

Instead of failing, its existence is checked before calling mkdir.

Signed-off-by: Vincent Petry <vincent@nextcloud.com>
Signed-off-by: nextcloud-command <nextcloud-command@users.noreply.github.com>
2022-01-11 08:20:41 +00:00
Vincent Petry 67fcbacd4f Merge pull request #30580 from nextcloud/bugfix/noid/npm-ci-for-karma/stable23
[stable23] Use npm ci when running JS tests
2022-01-11 08:53:48 +01:00
Vincent Petry 035d73db11 Make chokidar happy with fsevents
Signed-off-by: Vincent Petry <vincent@nextcloud.com>
2022-01-10 18:00:24 +01:00
Vincent Petry c948ceee60 Recompile JS
Signed-off-by: Vincent Petry <vincent@nextcloud.com>
2022-01-10 17:38:16 +01:00
Vincent Petry 4e4797b5b9 Fix JS tests after test lib updates
Prevent XHR during load by checking window.TESTING.
Adjust some expected values.

Signed-off-by: Vincent Petry <vincent@nextcloud.com>
2022-01-10 17:30:32 +01:00
Vincent Petry 60e364018f Update node deps for JS tests
Signed-off-by: Vincent Petry <vincent@nextcloud.com>
2022-01-10 17:28:16 +01:00
Vincent Petry 7dcbcd21e1 Use npm ci when running JS tests
This makes sure that the pinned versions are selected correctly.
Fixes the colors.js incident.

Signed-off-by: Vincent Petry <vincent@nextcloud.com>
2022-01-10 17:26:23 +01:00
John Molakvoæ ed1fcf1982 Merge pull request #30557 from nextcloud/backport/30468/stable23 2022-01-10 08:35:01 +01:00
Carl Schwan b054321fc0 Handle LocalServerException when scanning external shares
When remoteIsOwnCloud trows LocalServerException, the storage is
unavailable and instead of crashing the scanner, ignore the specific
storage.

Signed-off-by: Carl Schwan <carl@carlschwan.eu>
2022-01-09 17:40:39 +00:00
blizzz 99b400c733 Merge pull request #30528 from nextcloud/backport/30511/stable23
[stable23]  update CRL after revocation of sharerenamer.crt
2022-01-08 00:55:12 +01:00
Pytal cc9a2e0558 Merge pull request #30525 from nextcloud/backport/30491/stable23 2022-01-07 11:21:43 -08:00
John Molakvoæ 7d8be4d044 Merge pull request #30518 from nextcloud/release/23.0.1 2022-01-07 14:57:27 +01:00
Vitor Mattos e2d9fb9d01 Update crl
Signed-off-by: Vitor Mattos <vitor@php.rio>
2022-01-07 11:25:47 +00:00
Christopher Ng c699f1bec2 Fix email verification
Signed-off-by: Christopher Ng <chrng8@gmail.com>
2022-01-07 10:52:36 +00:00
Joas Schilling deeee36132 Merge pull request #30522 from nextcloud/backport/30492/stable23
[stable23] Fix passing on the parameter
2022-01-07 10:49:55 +01:00
Joas Schilling 3ca762e0af Fix passing on the parameter
Signed-off-by: Joas Schilling <coding@schilljs.com>
2022-01-07 09:27:35 +01:00
Joas Schilling 551e1a799a Merge pull request #30486 from nextcloud/backport/29780/stable23
[stable23] Run migrations fully when reenabling an app
2022-01-07 08:43:14 +01:00
John Molakvoæ 510e99a622 Merge pull request #30433 from nextcloud/backport/30392/stable23 2022-01-07 08:41:22 +01:00
John Molakvoæ c8702c7766 Merge pull request #30339 from nextcloud/backport/27403/stable23 2022-01-07 08:41:06 +01:00
John Molakvoæ e65a5e199e 23.0.1 RC 1
Signed-off-by: John Molakvoæ <skjnldsv@protonmail.com>
2022-01-07 08:20:03 +01:00
blizzz 994b32f793 Merge pull request #30351 from nextcloud/backport/29958/stable23
[stable23] Remove iconv from dependencies and tests
2022-01-06 23:37:36 +01:00
Pytal 6a28abbbb6 Merge pull request #30480 from nextcloud/backport/30423/stable23 2022-01-04 17:05:32 -08:00
Pytal b47ecc6396 Merge pull request #30431 from nextcloud/backport/30413/stable23 2022-01-04 11:21:56 -08:00
Joas Schilling e69d0b0a65 Run migrations fully when reenabling an app
Signed-off-by: Joas Schilling <coding@schilljs.com>
2022-01-04 16:19:35 +00:00
Christoph Wurst df21ccd73a Add the Groupware Team as contactsinteraction co-maintainer
Signed-off-by: Christoph Wurst <christoph@winzerhof-wurst.at>
Signed-off-by: nextcloud-command <nextcloud-command@users.noreply.github.com>
2022-01-04 16:08:20 +01:00
Christoph Wurst d068ae445c Fix rendering app authors with homepage or email
When the first author of an app doesn't have homepage/email attributes
set in info.xml then any further author was rendered as `[object
Object]` due to the complex XML node seralized to a JavaScript string.
The logic was fixed so that it converts any of the authors to simple
text.

Signed-off-by: Christoph Wurst <christoph@winzerhof-wurst.at>
2022-01-04 16:08:20 +01:00
John Molakvoæ 9bffa5beff Fix uploading text position
Signed-off-by: John Molakvoæ <skjnldsv@protonmail.com>
2022-01-04 08:47:00 +00:00
MichaIng 022d0058ca [stable23] Remove iconv from dependencies and tests
which is not used anymore since: https://github.com/nextcloud/server/pull/29470

Signed-off-by: MichaIng <micha@dietpi.com>
2022-01-04 03:06:55 +01:00
Louis 58dc589ed0 Merge pull request #30449 from nextcloud/backport/30440/stable23
[stable23] Make sure to get file model in template picker
2022-01-03 10:42:26 +01:00
Carl Schwan d92be7b886 Merge pull request #30462 from nextcloud/backport/30409/stable23
[stable23] Allow using composer plugin with composer 2.2
2022-01-03 08:56:35 +01:00
Julius Härtl d81768b2e2 Ignore composer/bin
Signed-off-by: Julius Härtl <jus@bitgrid.net>
2022-01-01 14:01:01 +00:00
Julius Härtl 6bbd26b955 Allow using composer plugin with composer 2.2
Signed-off-by: Julius Härtl <jus@bitgrid.net>
2022-01-01 14:01:00 +00:00
Simon L f98d7827e9 Merge pull request #30455 from nextcloud/backport/30420/stable23
[stable23] improve status modal
2021-12-31 18:07:23 +01:00
szaimen e6f837f4b5 improve status modal
Signed-off-by: szaimen <szaimen@e.mail.de>
Signed-off-by: nextcloud-command <nextcloud-command@users.noreply.github.com>
2021-12-30 18:50:19 +00:00
Julien Veyssier dccd2a635a fix template picker for file actions using the fileInfoModel
Signed-off-by: Julien Veyssier <eneiluj@posteo.net>
Signed-off-by: nextcloud-command <nextcloud-command@users.noreply.github.com>
2021-12-30 15:16:31 +00:00
Louis 955cb63e41 Merge pull request #30343 from nextcloud/backport/29329/stable23
[stable23] fix potential unwarranted memberships in nested groups from LDAP
2021-12-30 11:04:39 +01:00
Louis 94f3192b82 Merge pull request #30315 from nextcloud/backport/30266/stable23
[stable23] Fix share owner not being displayed in sharing tab
2021-12-30 10:57:01 +01:00
John Molakvoæ eac352bcc3 Merge pull request #30443 from nextcloud/backport/30353/stable23 2021-12-30 08:12:01 +01:00
Carl Schwan c68304d6d5 Handle external share with invalid host
remoteIsOwnCloud might throw an exception when the host is localhost.
Handle this case instead of aborting completely. The behavior is the
same as that is done 10 lines under it

Signed-off-by: Carl Schwan <carl@carlschwan.eu>
2021-12-29 17:13:06 +00:00
Julius Härtl af25d91b8d Merge pull request #30390 from nextcloud/backport/28438/stable23 2021-12-29 10:52:39 +01:00
Christoph Wurst 3cf98b75e2 Add missing index for propertypath only queries against properties
Signed-off-by: Christoph Wurst <christoph@winzerhof-wurst.at>
2021-12-29 09:16:28 +00:00
Simon L 394915d2e4 Merge pull request #30411 from nextcloud/backport/30364/stable23
[stable23] improve personal settings on mobile
2021-12-27 23:54:38 +01:00
szaimen 83e5cf0ed0 improve personal settings on mobile
Signed-off-by: szaimen <szaimen@e.mail.de>
Signed-off-by: nextcloud-command <nextcloud-command@users.noreply.github.com>
2021-12-27 21:14:19 +00:00
Sven Strickroth 708d98d078 Don't die with LockedException when removing/restoring multiple files from trash
fixes issue #16491

Signed-off-by: Sven Strickroth <email@cs-ware.de>
2021-12-23 10:26:57 +00:00
John Molakvoæ ad8cf1a2b4 Merge pull request #30356 from nextcloud/backport/30305/stable23 2021-12-21 11:17:06 +01:00
Joas Schilling b947bf3765 Merge pull request #30026 from nextcloud/backport/30013/stable23
[stable23] Don't query the bruteforce attempts when we just deleted them
2021-12-21 09:38:20 +01:00
Daniel Calviño Sánchez bcc54d06a1 Fix persistent tooltip in the "new folder" input of the file picker
When a new folder is tried to be created in the file picker dialog a
tooltip is shown on the input if the folder name exists already.
However, this tooltip was not cleared, so it was still shown even if the
name was fixed, the folder was created and then the "New folder" input
was shown again.

Now the tooltip is cleared as soon as the input changes, as keeping it
shown in that case did not provide any benefit either (and it is
consistent with how the "new folder" input works in the Files app view).

The input is also cleared whenever the menu that shows the input is
opened again, as otherwise the tooltip would be still shown if the menu
was closed and opened again without changing the input (and the menu
could be opened again after changing to another directory where the new
folder name is no longer duplicated).

Signed-off-by: Daniel Calviño Sánchez <danxuliu@gmail.com>
Signed-off-by: nextcloud-command <nextcloud-command@users.noreply.github.com>
2021-12-21 07:36:36 +00:00
Louis d645869f74 Merge pull request #30344 from nextcloud/backport/30322/stable23
[stable23] fix overlapping in the help settings section
2021-12-20 11:32:02 +01:00
Côme Chilliet e0c6673884 Merge pull request #29965 from nextcloud/backport/29470/stable23
[stable23] Avoid use of iconv to get rid of unicode
2021-12-20 10:54:25 +01:00
szaimen f16b00ae23 fix overlapping in the help settings section
Signed-off-by: szaimen <szaimen@e.mail.de>
2021-12-20 09:30:36 +00:00
Arthur Schiwon bf81fa432a fix potential unwarranted memberships in nested groups from LDAP
- the issue was present only when using PHP based resolving of nested
  group members. Normally nested members are common in AD (and Samba4) and
  are resolved per LDAP_MATCHING_RULE_IN_CHAIN by default
- resolving nested members is recursive
- when the cache entry was created it happend for intermediate groups, too,
  containing members from the parent group
- the check was added to only cache the root group with its members
- a runtime cache stores intermediate ldap read results


Signed-off-by: Arthur Schiwon <blizzz@arthur-schiwon.de>
2021-12-20 09:18:59 +00:00
Côme Chilliet 4010e58a96 [stable23] Avoid use of iconv to get rid of unicode
Using iconv for translit depends upon server configuration, locale, and
 PHP version. Using htmlentities instead to have a consistent behavior
 independent of configuration.

Signed-off-by: Côme Chilliet <come.chilliet@nextcloud.com>
Co-authored-by: MichaIng <micha@dietpi.com>
2021-12-20 03:00:37 +01:00
MichaIng fd481913ef Enhance and complement OPcache setup checks
The current OPcache recommendations match the PHP defaults, but the values are much higher than required to run Nextcloud, even with a high number of installed apps. On the other hand, when other applications use the same OPcache instance, the recommended values might not be sufficient. Accurate recommendations need to take into account actual OPcache usage.

With this commit, recommendations are shown to raise the config value if more than 90% of max cache size or number of keys is used.

The checks whether the module is loaded and whether the OPcache is properly configured have been merged into a single function. This allowed to reduce the overhead of OPcache configuration checks when the module is not loaded.

A check has been added whether Nextcloud is permitted to use the OPcache API. Without this, inconsistencies during core or app upgrades may cause errors and OPcache usage cannot be determined for the new usage based checks.

OPcache usage based checks are skipped when Nextcloud is not permitted to use the API.

Signed-off-by: MichaIng <micha@dietpi.com>
2021-12-20 00:10:10 +00:00
MichaIng cdedd2df38 Merge pull request #30252 from nextcloud/backport/30193/stable23
[stable23] Fix setting up 2FA when no providers are set up but backup codes
2021-12-19 19:41:20 +01:00
MichaIng 4b8b2b4740 Merge pull request #30301 from nextcloud/backport/30119/stable23
[stable23] Use proper translation source for direct editing
2021-12-19 19:39:23 +01:00
MichaIng 2217abfa44 Merge pull request #30306 from nextcloud/backport/30281/stable23
[stable23] Ignore non-existing groups when notifying group shares
2021-12-19 19:37:21 +01:00
dependabot[bot] d9bcf061d5 Merge pull request #30325 from nextcloud/dependabot/composer/build/integration/stable23/sabre/dav-4.3.0 2021-12-18 05:34:16 +00:00
dependabot[bot] 1bea0296c0 Update sabre/dav requirement from 4.2.3 to 4.3.0 in /build/integration
Updates the requirements on [sabre/dav](https://github.com/sabre-io/dav) to permit the latest version.
- [Release notes](https://github.com/sabre-io/dav/releases)
- [Changelog](https://github.com/sabre-io/dav/blob/master/CHANGELOG.md)
- [Commits](https://github.com/sabre-io/dav/compare/4.2.3...4.3.0)

---
updated-dependencies:
- dependency-name: sabre/dav
  dependency-type: direct:development
...

Signed-off-by: dependabot[bot] <support@github.com>
2021-12-18 04:05:40 +00:00
Carl Schwan 2b7bee1bc3 Fix share owner not being displayed in sharing tab
This only concerns subfolder and files inside a shared folder and is
used as fallback when the OCS api returns a empty result, because it
only works on the shared folder and not the content inside of it.
This unify the tab with the folder list.

This offers a less descriptive share information but making the
OCS api returns all the details even for the subfolder would very
probably be bad for performance (since we would need to fetch the shares
for all the parent folders until we found one or are in the root folder).

Signed-off-by: Carl Schwan <carl@carlschwan.eu>
Signed-off-by: nextcloud-command <nextcloud-command@users.noreply.github.com>
2021-12-17 13:23:23 +00:00
Vincent Petry d4e83a7988 Discard share notification for non-existing groups
Group shares might exist even after a group got deleted.

This fix catches the situation and discards the notification for the
obsolete group.

Signed-off-by: Vincent Petry <vincent@nextcloud.com>
Co-authored-by: Joas Schilling <coding@schilljs.com>
2021-12-17 07:04:25 +00:00
Azul 26886d753d fix translation source in directEditing templates
The 'Empty file' string is translated in `lib` - not in `core`.

Signed-off-by: Azul <azul@riseup.net>
2021-12-16 18:23:12 +00:00
Louis 1c296cbc86 Merge pull request #30289 from nextcloud/backport/30256/stable23
[stable23] Fix ShareLink Upload UI for Folders
2021-12-16 10:58:14 +01:00
Pytal 659d10f7d5 Merge pull request #30272 from nextcloud/backport/30254/stable23 2021-12-15 17:35:19 -08:00
Christopher Ng 7479edbc1e Migrate profile_config id column to bigint
Signed-off-by: Christopher Ng <chrng8@gmail.com>
2021-12-15 19:30:15 +00:00
nextcloud-command 1f1758ee3e Compile assets
Signed-off-by: nextcloud-command <nextcloud-command@users.noreply.github.com>
2021-12-15 19:10:23 +00:00
Jonas Rittershofer c39c82a6bd Fix ShareLink Upload UI for Folders
Do not show the Upload-Option if it is not allowed to check.

Signed-off-by: Jonas Rittershofer <jotoeri@users.noreply.github.com>
2021-12-15 19:51:41 +01:00
Christopher Ng c4149aa8ed Use bigint for autoincremented column
Signed-off-by: Christopher Ng <chrng8@gmail.com>
2021-12-14 21:34:24 +00:00
Christoph Wurst 9e9b448998 Merge pull request #30267 from nextcloud/backport/30048/stable23
[stable23] Carefully filter out non matching time ranges for CalDAV search
2021-12-14 16:08:30 +01:00
Christoph Wurst 593b4e53b3 Carefully filter out non matching time ranges for CalDAV search
When we search for CalDAV objects in the DB we take the first and last
occurence into account. For recurring events that is when they take
place the very first time and the very last time. Searching in a more
specific time range will still match this condition, because the
recurring event starts before the end of the requested range but ends
after the start of the requested range.

Sabre has filters for this. If we apply them on all seach objects of a
search with a time range, then only the recurring events actually taking
place at the time of the requested time range will be returned.

Signed-off-by: Christoph Wurst <christoph@winzerhof-wurst.at>
2021-12-14 13:52:56 +00:00
Côme Chilliet 5282fcec05 Merge pull request #30238 from nextcloud/backport/29523/stable23
Support LDAP dn longer than 255 characters
2021-12-14 13:15:23 +01:00
Christoph Wurst e4011bc3aa Fix setting up 2FA when no providers are set up but backup codes
2FA set up is allowed when only backup codes are set up but no other
provider and no provider is failing.

This patch syncs up the login controller check with the challenge
controller check 10 lines above.

Signed-off-by: Christoph Wurst <christoph@winzerhof-wurst.at>
2021-12-13 15:59:27 +00:00
MichaIng a31ee8d9f3 Merge pull request #30236 from nextcloud/backport/30200/stable23
[stable23] Don't check the configvalue for lastLogin which is never null
2021-12-13 15:20:40 +01:00
MichaIng 66e464a407 Merge pull request #30245 from nextcloud/backport/30156/stable23
[stable23] Only wildcard search if enumeration is allowed
2021-12-13 15:19:36 +01:00
Joas Schilling dd2c1c6fb8 Make psalm more happy
Signed-off-by: Joas Schilling <coding@schilljs.com>
2021-12-13 13:49:15 +01:00
Joas Schilling 39d6624ab3 Fix docs to make Psalm happier
Signed-off-by: Joas Schilling <coding@schilljs.com>
2021-12-13 13:49:09 +01:00
Joas Schilling 955c0d4885 Convert strict_search to wildcard property and add psalm docs
Signed-off-by: Joas Schilling <coding@schilljs.com>
2021-12-13 13:49:03 +01:00
Joas Schilling 898c11c3b4 Limit more contact searches
Signed-off-by: Joas Schilling <coding@schilljs.com>
2021-12-13 13:48:55 +01:00
Joas Schilling daad1ce010 Only limit search in the system address book
Signed-off-by: Joas Schilling <coding@schilljs.com>
2021-12-13 13:48:47 +01:00
Joas Schilling b5d78d0b7c Only wildcard search if enumeration is allowed
Signed-off-by: Joas Schilling <coding@schilljs.com>
2021-12-13 13:48:41 +01:00
Côme Chilliet 6b107026dd Bump user_ldap version to make sure the migration runs
Signed-off-by: Côme Chilliet <come.chilliet@nextcloud.com>
2021-12-13 09:51:44 +01:00
Joas Schilling 995b45bb62 Don't check the configvalue for lastLogin which is never null
Signed-off-by: Joas Schilling <coding@schilljs.com>
2021-12-13 08:43:13 +00:00
Côme Chilliet b5b080a219 Add missing copyright headers in migration steps
Signed-off-by: Côme Chilliet <come.chilliet@nextcloud.com>
2021-12-13 09:40:38 +01:00
Côme Chilliet e7a769158d Use clearer names for variables
Signed-off-by: Côme Chilliet <come.chilliet@nextcloud.com>
2021-12-13 09:40:15 +01:00
Côme Chilliet 9e33d51c44 Add an index for directory_uuid as well
Signed-off-by: Côme Chilliet <come.chilliet@nextcloud.com>
2021-12-13 09:40:08 +01:00
Côme Chilliet fbed00bab4 Make sure that hash function returns a string
The documentation says it can return false, and even if that is highly
 unlikely for sha256, better safe than sorry.

Signed-off-by: Côme Chilliet <come.chilliet@nextcloud.com>
2021-12-13 09:39:55 +01:00
Côme Chilliet 98476a9d5d Add the columns and alter the index in Version1010Date20200630192842
This is to ensure new installations do not need to go through migration
 history.

Signed-off-by: Côme Chilliet <come.chilliet@nextcloud.com>
2021-12-13 09:39:45 +01:00
Côme Chilliet 2336a188df Fixes in migration step
We cannot set ldap_dn_hash column as notnull because it is empty for
 existing users before postSchemaChange is called

Signed-off-by: Côme Chilliet <come.chilliet@nextcloud.com>
2021-12-13 09:39:33 +01:00
Côme Chilliet a0db2a248c Put back length check to have a clear error
Signed-off-by: Côme Chilliet <come.chilliet@nextcloud.com>
2021-12-13 09:39:23 +01:00
Côme Chilliet 189852b549 Fixed migration step for user_ldap
Signed-off-by: Côme Chilliet <come.chilliet@nextcloud.com>
2021-12-13 09:39:12 +01:00
Joas Schilling 54007f9993 Fix variable names
Signed-off-by: Joas Schilling <coding@schilljs.com>
2021-12-13 09:39:04 +01:00
Côme Chilliet 514b34084a Change column names to ldap_dn and ldap_dn_hash and add migration
Signed-off-by: Côme Chilliet <come.chilliet@nextcloud.com>
2021-12-13 09:38:54 +01:00
Côme Chilliet fe3203a66e Support LDAP dns longer than 255 characters
Adds an ldap_full_dn column to store the dn, and only store a sha256
 hash in the ldap_dn which is shorter and can be indexed without
 trouble.
Migration still needs to be implemented.

Signed-off-by: Côme Chilliet <come.chilliet@nextcloud.com>
2021-12-13 09:38:43 +01:00
MichaIng 86c0b22e97 Merge pull request #30214 from nextcloud/dependabot/npm_and_yarn/stable23/dompurify-2.3.4
Bump dompurify from 2.3.3 to 2.3.4
2021-12-11 21:50:21 +01:00
dependabot[bot] 2339d5d543 Bump dompurify from 2.3.3 to 2.3.4
Bumps [dompurify](https://github.com/cure53/DOMPurify) from 2.3.3 to 2.3.4.
- [Release notes](https://github.com/cure53/DOMPurify/releases)
- [Commits](https://github.com/cure53/DOMPurify/compare/2.3.3...2.3.4)

---
updated-dependencies:
- dependency-name: dompurify
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
Signed-off-by: nextcloud-command <nextcloud-command@users.noreply.github.com>
2021-12-11 16:31:23 +00:00
MichaIng 837d589cb4 Merge pull request #30215 from nextcloud/dependabot/npm_and_yarn/stable23/core-js-3.19.3
Bump core-js from 3.19.2 to 3.19.3
2021-12-11 16:04:39 +01:00
dependabot[bot] 7e2414c73a Bump core-js from 3.19.2 to 3.19.3
Bumps [core-js](https://github.com/zloirock/core-js) from 3.19.2 to 3.19.3.
- [Release notes](https://github.com/zloirock/core-js/releases)
- [Changelog](https://github.com/zloirock/core-js/blob/master/CHANGELOG.md)
- [Commits](https://github.com/zloirock/core-js/compare/v3.19.2...v3.19.3)

---
updated-dependencies:
- dependency-name: core-js
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
Signed-off-by: nextcloud-command <nextcloud-command@users.noreply.github.com>
2021-12-11 12:59:40 +00:00
MichaIng 37b74dab89 Merge pull request #30213 from nextcloud/dependabot/composer/build/integration/stable23/sabre/dav-4.2.3
Update sabre/dav requirement from 4.2.1 to 4.2.3 in /build/integration
2021-12-11 13:50:58 +01:00
dependabot[bot] f35d000c7f Update sabre/dav requirement from 4.2.1 to 4.2.3 in /build/integration
Updates the requirements on [sabre/dav](https://github.com/sabre-io/dav) to permit the latest version.
- [Release notes](https://github.com/sabre-io/dav/releases)
- [Changelog](https://github.com/sabre-io/dav/blob/master/CHANGELOG.md)
- [Commits](https://github.com/sabre-io/dav/compare/4.2.1...4.2.3)

---
updated-dependencies:
- dependency-name: sabre/dav
  dependency-type: direct:development
...

Signed-off-by: dependabot[bot] <support@github.com>
2021-12-11 07:04:10 +00:00
dependabot[bot] fcb2bf130d Merge pull request #30212 from nextcloud/dependabot/composer/build/integration/stable23/guzzlehttp/guzzle-6.5.5 2021-12-11 07:02:56 +00:00
dependabot[bot] 4a1c576325 Update guzzlehttp/guzzle requirement in /build/integration
Updates the requirements on [guzzlehttp/guzzle](https://github.com/guzzle/guzzle) to permit the latest version.
- [Release notes](https://github.com/guzzle/guzzle/releases)
- [Changelog](https://github.com/guzzle/guzzle/blob/6.5.5/CHANGELOG.md)
- [Commits](https://github.com/guzzle/guzzle/compare/6.5.2...6.5.5)

---
updated-dependencies:
- dependency-name: guzzlehttp/guzzle
  dependency-type: direct:development
...

Signed-off-by: dependabot[bot] <support@github.com>
2021-12-11 03:35:25 +00:00
Pytal 7d80036bed Merge pull request #30190 from nextcloud/backport/30157/stable23 2021-12-10 17:30:02 -08:00
Vincent Petry de8b0275a0 Merge pull request #30187 from nextcloud/backport/30164/stable23
[stable23] Use correct icon for dir-external-root
2021-12-10 12:02:36 +01:00
John Molakvoæ 32eed324a1 Fix first day locale
Signed-off-by: John Molakvoæ <skjnldsv@protonmail.com>
Signed-off-by: nextcloud-command <nextcloud-command@users.noreply.github.com>
2021-12-10 10:35:05 +00:00
John Molakvoæ ac5385101c Properly format sharing datepicker locale
Signed-off-by: John Molakvoæ <skjnldsv@protonmail.com>
2021-12-10 09:47:35 +00:00
Vincent Petry 1a032ce6f1 Use correct icon for dir-external-root
When an external storage mount is shared with circles, it triggers the
share icon state to be rerendered. The picking of the mime type icon
would use the regular file icon because there is no actual icon for
"dir-external-root" that is shared.

This fixes the logic to use the "folder-external" icon in such
scenarios.

Signed-off-by: Vincent Petry <vincent@nextcloud.com>
2021-12-10 09:29:32 +00:00
Vincent Petry 1fc27e771c Merge pull request #30180 from nextcloud/backport/30160/stable23
[stable23] Check resource before closing in encryption wrapper
2021-12-10 08:55:50 +01:00
John Molakvoæ 497fab8fe6 Merge pull request #30175 from nextcloud/backport/30168/stable23 2021-12-10 08:46:52 +01:00
John Molakvoæ 8e1b2cd59a Merge pull request #30176 from nextcloud/backport/29996/stable23 2021-12-10 07:57:42 +01:00
Vincent Petry 1291abc130 Check resource before closing in encryption wrapper
In case of error there is no guarantee that $source or $target is set or
is a resource when handling an error.

Without this fix, there's a risk that fclose will fail and the actual
exception will not be thrown, making it impossible to find out about the
root cause.

Signed-off-by: Vincent Petry <vincent@nextcloud.com>
2021-12-10 00:03:08 +00:00
Pytal 9135b177be Update core/Migrations/Version23000Date20211203110726.php
Co-authored-by: John Molakvoæ <skjnldsv@users.noreply.github.com>
Signed-off-by: Christopher Ng <chrng8@gmail.com>
2021-12-09 23:07:30 +00:00
Christopher Ng 3600b84e6e Fix relation "user_id" already exists migration error
Signed-off-by: Christopher Ng <chrng8@gmail.com>
2021-12-09 23:07:30 +00:00
John Molakvoæ 72422ccb10 Allow to delete non-migrated previews instead of moving them
Signed-off-by: John Molakvoæ <skjnldsv@protonmail.com>
2021-12-09 22:59:38 +00:00
John Molakvoæ 28992a403e Merge pull request #30144 from nextcloud/backport/29968/stable23 2021-12-09 10:33:20 +01:00
Daniel Calviño Sánchez 30733d020d Remove no longer needed CSS rules
Since Nextcloud 22 the "#new-user" rules had no effect, as the DOM
structure changed to show a dialog rather than adding a row on top of
the list when adding new users.

Similarly, the z-index was no longer needed, as there will be no
"new-user" row that could overlap. Moreover, the z-index was set even
higher (100) in another rule still active.

Signed-off-by: Daniel Calviño Sánchez <danxuliu@gmail.com>
2021-12-09 06:58:07 +01:00
Daniel Calviño Sánchez 7b53eb4066 Fix input for groups validation in new user form
The hidden input used for form validation was not actually hidden since
Nextcloud 22, as the DOM structure changed to show a dialog rather than
adding a row on top of the list when adding new users, so the CSS rules
no longer matched.

Signed-off-by: Daniel Calviño Sánchez <danxuliu@gmail.com>
2021-12-09 06:58:07 +01:00
MichaIng c79b3be1aa Merge pull request #30151 from nextcloud/backport/30141/stable23
[stable23] Reload page instead of file list when getting 401 authentification error
2021-12-08 14:32:00 +01:00
Carl Schwan 9a81b75b38 Reload page on 401 since there is an authentification problem
Signed-off-by: Carl Schwan <carl@carlschwan.eu>
2021-12-08 11:39:57 +00:00
Carl Schwan ad44722397 Stop reloading file list when getting 401 error on root dir
When reaching the root dir, instead of reloading the file list we reload
the page completely. This trigger a redirection to the login page automatically
with the correct ?redirect_url= in thr url.

Signed-off-by: Carl Schwan <carl@carlschwan.eu>
2021-12-08 11:39:57 +00:00
Julius Härtl c311f43c1f Merge pull request #30136 from nextcloud/backport/30134/stable23 2021-12-08 09:07:24 +01:00
Julien Veyssier fb0e22a3c4 do not trigger events when setting active view in gotoplugin
Signed-off-by: Julien Veyssier <eneiluj@posteo.net>
2021-12-07 14:38:22 +00:00
John Molakvoæ e0b61fb449 Merge pull request #30132 from nextcloud/backport/30114/stable23 2021-12-07 13:55:54 +01:00
John Molakvoæ 36bacaa7af Prevent writing invalid mtime
Signed-off-by: John Molakvoæ <skjnldsv@protonmail.com>
2021-12-07 11:16:29 +00:00
John Molakvoæ 778d1a1793 Merge pull request #30009 from nextcloud/backport/29905/stable23 2021-12-07 09:27:50 +01:00
marco 07931d9bb6 Only add the vue exeption to actual button elements
Signed-off-by: marco <marcoambrosini@pm.me>
2021-12-07 01:13:21 +01:00
Côme Chilliet c630c8ccec Merge pull request #30115 from nextcloud/backport/30040/stable23
[stable23] Avoid calling image* methods on boolean
2021-12-06 16:58:23 +01:00
Louis b2967923d2 Merge pull request #30106 from nextcloud/backport/30104/stable23
[stable23] Strengthify is now in the Nextcloud org
2021-12-06 15:58:28 +01:00
Côme Chilliet f889b251b1 Avoid assignment in if clause
Signed-off-by: Côme Chilliet <come.chilliet@nextcloud.com>
2021-12-06 14:22:05 +00:00
Côme Chilliet 3fe20bfbbb Fix typing problems in OC_Image
Signed-off-by: Côme Chilliet <come.chilliet@nextcloud.com>
2021-12-06 14:22:05 +00:00
Côme Chilliet 11b51ddbbe Avoid calling image* methods on boolean
This avoids fatal errors on PHP>=8, and warnings on older versions.
Log should also be clearer.

Signed-off-by: Côme Chilliet <come.chilliet@nextcloud.com>
2021-12-06 14:22:05 +00:00
Christoph Wurst f88f57612b Merge pull request #30025 from nextcloud/backport/30012/stable23
[stable23] Only check the twofactor state once per request
2021-12-06 14:49:45 +01:00
Joas Schilling 7b88878895 Strengthify is now in the Nextcloud org
Signed-off-by: Joas Schilling <coding@schilljs.com>
2021-12-06 08:59:57 +00:00
dependabot[bot] af29d0b63e Merge pull request #30083 from nextcloud/dependabot/composer/build/integration/stable23/sabre/dav-4.2.1 2021-12-05 16:17:46 +00:00
dependabot[bot] 8fc41f6cf1 Update sabre/dav requirement from 4.2.0 to 4.2.1 in /build/integration
Updates the requirements on [sabre/dav](https://github.com/sabre-io/dav) to permit the latest version.
- [Release notes](https://github.com/sabre-io/dav/releases)
- [Changelog](https://github.com/sabre-io/dav/blob/master/CHANGELOG.md)
- [Commits](https://github.com/sabre-io/dav/compare/4.2.0...4.2.1)

---
updated-dependencies:
- dependency-name: sabre/dav
  dependency-type: direct:development
...

Signed-off-by: dependabot[bot] <support@github.com>
2021-12-05 16:43:43 +01:00
dependabot[bot] 6aa3677eaa Merge pull request #30088 from nextcloud/dependabot/npm_and_yarn/stable23/core-js-3.19.2 2021-12-04 13:25:01 +00:00
dependabot[bot] 99aca2f57c Bump core-js from 3.19.1 to 3.19.2
Bumps [core-js](https://github.com/zloirock/core-js) from 3.19.1 to 3.19.2.
- [Release notes](https://github.com/zloirock/core-js/releases)
- [Changelog](https://github.com/zloirock/core-js/blob/master/CHANGELOG.md)
- [Commits](https://github.com/zloirock/core-js/compare/v3.19.1...v3.19.2)

---
updated-dependencies:
- dependency-name: core-js
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
Signed-off-by: nextcloud-command <nextcloud-command@users.noreply.github.com>
2021-12-04 12:49:10 +00:00
blizzz 76fa257789 Merge pull request #30036 from nextcloud/backport/30011/stable23
[stable23] Allow to log queries to db, ldap and redis
2021-12-03 11:53:59 +01:00
MichaIng e20b3de09e Merge pull request #30041 from nextcloud/backport/30032/stable23
[stable23] Add an index for selecting the next job
2021-12-03 03:02:13 +01:00
MichaIng d622dc63b9 Merge pull request #30053 from nextcloud/backport/30046/stable23
[stable23] Close open cursor in the caldav back-end
2021-12-03 02:56:21 +01:00
Joas Schilling 617d742aa9 Merge pull request #30062 from nextcloud/backport/30024/stable23
[stable23] list.php files are only invoked via ViewController and APIController
2021-12-03 00:02:44 +01:00
Joas Schilling d6bad0c0ba list.php files are only invoked via ViewController and APIController
Both of them actually check that the user is logged in before
and also the list.php files themselves would break with
getUserSession()->getUser()->getUID() which they contain.

Signed-off-by: Joas Schilling <coding@schilljs.com>
2021-12-02 21:32:25 +00:00
Pytal 395e90c645 Merge pull request #30058 from nextcloud/backport/29735/stable23 2021-12-02 12:20:53 -08:00
Robin Appelman cc57b2b68e fix tests
Signed-off-by: Robin Appelman <robin@icewind.nl>
2021-12-02 17:47:06 +00:00
Robin Appelman 349555478f code checker fixes for instanceOfStorage
Signed-off-by: Robin Appelman <robin@icewind.nl>
2021-12-02 17:47:06 +00:00
Robin Appelman c76c2d7581 stop background scan early if a users still has unscanned files after background scan
Signed-off-by: Robin Appelman <robin@icewind.nl>
2021-12-02 17:47:05 +00:00
Robin Appelman 375946b148 find users for background scan one by one
Signed-off-by: Robin Appelman <robin@icewind.nl>
2021-12-02 17:47:05 +00:00
Robin Appelman c9db02a921 background scan the source storage when a background scan on a storage jail is triggered
Signed-off-by: Robin Appelman <robin@icewind.nl>
2021-12-02 17:47:05 +00:00
Robin Appelman 4433732f22 teach psalm about Storage::instanceOfStorage
Signed-off-by: Robin Appelman <robin@icewind.nl>
2021-12-02 17:47:05 +00:00
Joas Schilling 62bff517dc Merge pull request #30037 from nextcloud/backport/30028/stable23
[stable23] Fix log_query config flag
2021-12-02 17:14:11 +01:00
Christoph Wurst 2de7273905 Close open cursor in the caldav back-end
Signed-off-by: Christoph Wurst <christoph@winzerhof-wurst.at>
2021-12-02 15:34:20 +00:00
Joas Schilling 88b6a42699 Add an index for selecting the next job
Signed-off-by: Joas Schilling <coding@schilljs.com>
2021-12-02 10:26:43 +00:00
Joas Schilling a361e69d5e Fix log_query config flag
Signed-off-by: Joas Schilling <coding@schilljs.com>
2021-12-02 09:35:52 +00:00
Joas Schilling 5e8fa37852 Allow to log DB, redis and LDAP requests into files
Signed-off-by: Joas Schilling <coding@schilljs.com>
2021-12-02 09:30:44 +00:00
MichaIng e3ee81de05 Merge pull request #30021 from nextcloud/backport/30018/stable23
[stable23] Fix collaborative tags styles
2021-12-02 02:40:45 +01:00
Pytal 2ccefec021 Merge pull request #30014 from nextcloud/backport/29995/stable23 2021-12-01 15:48:03 -08:00
Joas Schilling 761b5ac91e Don't query the bruteforce attempts when we just deleted them
Signed-off-by: Joas Schilling <coding@schilljs.com>
2021-12-01 20:29:47 +00:00
Joas Schilling febca701ee Only check the twofactor state once per request
Signed-off-by: Joas Schilling <coding@schilljs.com>
2021-12-01 20:29:28 +00:00
Christopher Ng 7fd7f73ab0 Fix profile actions menu
Signed-off-by: Christopher Ng <chrng8@gmail.com>
Signed-off-by: nextcloud-command <nextcloud-command@users.noreply.github.com>
2021-12-01 19:57:22 +00:00
Christopher Ng e0ffaaae51 Fix collaborative tags styles
Signed-off-by: Christopher Ng <chrng8@gmail.com>
2021-12-01 19:51:01 +00:00
Pytal b67c6d9730 Merge pull request #29975 from nextcloud/backport/29872/stable23 2021-12-01 10:17:20 -08:00
Christoph Wurst b2b1feba0f Merge pull request #30008 from nextcloud/backport/30001/stable23
[stable23] Cast orphan subscription id to int
2021-12-01 19:07:18 +01:00
Christoph Wurst ea450f1161 Cast orphan subscription id to int
DB columns are of type int by default, so they need to be casted.

Signed-off-by: Christoph Wurst <christoph@winzerhof-wurst.at>
2021-12-01 13:47:40 +00:00
Christopher Ng 510249e258 Set profile page title
Signed-off-by: Christopher Ng <chrng8@gmail.com>
Signed-off-by: nextcloud-command <nextcloud-command@users.noreply.github.com>
2021-11-30 17:02:52 +00:00
blizzz 4caad84389 Merge pull request #29967 from nextcloud/backport/29917/stable23
[stable23] Fix source of translations
2021-11-30 14:55:23 +01:00
Christoph Wurst c7d5f98768 Merge pull request #29977 from nextcloud/backport/29974/stable23
[stable23] Let repair step query exceptions bubble up
2021-11-30 14:34:17 +01:00
Christoph Wurst 3b2122fc11 Include previous execption for repair steps that don't exist
Signed-off-by: Christoph Wurst <christoph@winzerhof-wurst.at>
2021-11-30 11:56:53 +00:00
Christoph Wurst 3d58f6bd2b Let repair step query exceptions bubble up
And hide the type error caused by a constructor call with missing
arguments.

`new $repairStep();` only works for the rare case that no arguments are
required. Anything else will throw. Then we previously hid the trace of
the more important query exception.

Signed-off-by: Christoph Wurst <christoph@winzerhof-wurst.at>
2021-11-30 11:56:53 +00:00
Louis 17a659e277 Merge pull request #29970 from nextcloud/backport/29870/stable23
[stable23] Prevent your own status from replacing another user's status on profile
2021-11-30 10:03:04 +01:00
Christopher Ng 259dc80fca Prevent your own status from replacing another user's status
Signed-off-by: Christopher Ng <chrng8@gmail.com>
Signed-off-by: nextcloud-command <nextcloud-command@users.noreply.github.com>
2021-11-29 20:49:20 +00:00
Christoph Wurst 7b142f74a9 Merge pull request #29961 from nextcloud/backport/29951/stable23
[stable23] Interpolate the log message also for logged exceptions
2021-11-29 20:04:25 +01:00
Christopher Ng 3256de61a1 Fix source of translations
Signed-off-by: Christopher Ng <chrng8@gmail.com>
2021-11-29 18:51:33 +00:00
Christoph Wurst 96aaa5dfa2 Interpolate the log message also for logged exceptions
According to PSR-3 the log message can have placeholders that are
replaced from the context object. Our logger implementation did that for
all PSR-3 logger methods. The only exception was our custom `logException`.

Since PsrLoggerAdapter calls logException when an exception key is
present in the context object, log messages were no longer interpolated.

Signed-off-by: Christoph Wurst <christoph@winzerhof-wurst.at>
2021-11-29 15:48:43 +00:00
dependabot[bot] b8ec50e816 Merge pull request #29937 from nextcloud/dependabot/npm_and_yarn/stable23/testing-library/jest-dom-5.15.1 2021-11-27 14:59:15 +00:00
dependabot[bot] 6ed5da993b Bump @testing-library/jest-dom from 5.15.0 to 5.15.1
Bumps [@testing-library/jest-dom](https://github.com/testing-library/jest-dom) from 5.15.0 to 5.15.1.
- [Release notes](https://github.com/testing-library/jest-dom/releases)
- [Changelog](https://github.com/testing-library/jest-dom/blob/main/CHANGELOG.md)
- [Commits](https://github.com/testing-library/jest-dom/compare/v5.15.0...v5.15.1)

---
updated-dependencies:
- dependency-name: "@testing-library/jest-dom"
  dependency-type: direct:development
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
2021-11-27 14:13:27 +00:00
dependabot[bot] 240e050360 Merge pull request #29936 from nextcloud/dependabot/npm_and_yarn/stable23/sass-1.43.5 2021-11-27 06:15:07 +00:00
dependabot[bot] 317e4242e6 Bump sass from 1.43.4 to 1.43.5
Bumps [sass](https://github.com/sass/dart-sass) from 1.43.4 to 1.43.5.
- [Release notes](https://github.com/sass/dart-sass/releases)
- [Changelog](https://github.com/sass/dart-sass/blob/main/CHANGELOG.md)
- [Commits](https://github.com/sass/dart-sass/compare/1.43.4...1.43.5)

---
updated-dependencies:
- dependency-name: sass
  dependency-type: direct:development
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
2021-11-27 03:17:43 +00:00
blizzz 0619207f13 Merge pull request #29925 from nextcloud/release/23.0.0
23.0.0
2021-11-26 21:49:32 +01:00
blizzz 842e22f882 Merge pull request #29928 from nextcloud/backport/29926/stable23
[stable23] obey  accounts_data column length when inserting and searching
2021-11-26 20:58:36 +01:00
Arthur Schiwon 09014ec6d1 Obey col length of 255 to insert and search in accounts_data
Signed-off-by: Arthur Schiwon <blizzz@arthur-schiwon.de>
2021-11-26 17:27:16 +00:00
Arthur Schiwon c853206e8a add method to shorten a string to given byte size to Utils
Signed-off-by: Arthur Schiwon <blizzz@arthur-schiwon.de>
2021-11-26 17:27:16 +00:00
Pytal df961fa2f3 Merge pull request #29918 from nextcloud/backport/29871/stable23 2021-11-26 09:16:22 -08:00
John Molakvoæ (skjnldsv) d5f6547fb8 Nextcloud Hub II
Signed-off-by: John Molakvoæ (skjnldsv) <skjnldsv@protonmail.com>
2021-11-26 17:17:03 +01:00
Christopher Ng cb74a9af7d Set number of visibility dropdown rows dynamically
Signed-off-by: Christopher Ng <chrng8@gmail.com>
Signed-off-by: nextcloud-command <nextcloud-command@users.noreply.github.com>
2021-11-26 14:59:24 +00:00
MichaIng 1441f46bbe Merge pull request #29848 from nextcloud/backport/29836/stable23
[stable23] Make sure mapping cache is cleared when deleting a user
2021-11-26 15:46:16 +01:00
John Molakvoæ (skjnldsv) 614cc82d48 23.0.0
Signed-off-by: John Molakvoæ (skjnldsv) <skjnldsv@protonmail.com>
2021-11-26 15:37:06 +01:00
Côme Chilliet 2b58973533 Test cache invalidation for AbstractMapping in test suite
Signed-off-by: Côme Chilliet <come.chilliet@nextcloud.com>
2021-11-26 14:19:14 +01:00
Côme Chilliet e983376e58 Make sure mapping cache is cleared when deleting a user
This avoids phantom remnants staying after user deletion

Signed-off-by: Côme Chilliet <come.chilliet@nextcloud.com>
2021-11-26 14:19:14 +01:00
Carl Schwan 9275a9f28a Merge pull request #29913 from nextcloud/backport/29906/stable23
[stable23] Use strict comparison to detect usage of redis cluster
2021-11-26 11:16:15 +01:00
Carl Schwan ab9282fe26 Merge pull request #29916 from nextcloud/backport/29893/stable23
[stable23] Improve accessibility for personal info settings and profile
2021-11-26 11:15:37 +01:00
Christopher Ng b5e314adf4 Improve accessibility
Signed-off-by: Christopher Ng <chrng8@gmail.com>
Signed-off-by: nextcloud-command <nextcloud-command@users.noreply.github.com>
2021-11-26 00:52:38 +00:00
Pytal d03df09879 Merge pull request #29909 from nextcloud/backport/29891/stable23 2021-11-25 16:10:58 -08:00
Joas Schilling 11722dd537 Merge pull request #29908 from nextcloud/backport/29894/stable23
[stable23] Fix inactive profile parameters being displayed in the Profile visibility section
2021-11-25 22:56:13 +01:00
Louis Chemineau 3f0cff6667 Use strict comparison to detect usage of redis cluster
Signed-off-by: Louis Chemineau <louis@chmn.me>
2021-11-25 18:57:35 +00:00
Christopher Ng be529b46d9 Adjust margin of status on profile
Signed-off-by: Christopher Ng <chrng8@gmail.com>
Signed-off-by: nextcloud-command <nextcloud-command@users.noreply.github.com>
2021-11-25 16:32:11 +00:00
Christopher Ng 608cf4a592 Fix inactive profile parameters being returned
Signed-off-by: Christopher Ng <chrng8@gmail.com>
2021-11-25 16:28:34 +00:00
MichaIng e3de5140b6 Merge pull request #29800 from nextcloud/backport/29632/stable23
[stable23] fix imagecreatetruecolor() error
2021-11-25 17:13:34 +01:00
Joas Schilling b1d4efd9f2 Merge pull request #29898 from nextcloud/backport/29895/stable23
[stable23] Check for invalid characters before trimming
2021-11-25 14:14:45 +01:00
Joas Schilling 7f7f21a7b9 Correctly set the response after a ClientException as well
Signed-off-by: Joas Schilling <coding@schilljs.com>
2021-11-25 11:49:55 +00:00
Joas Schilling e6d35b6655 Add an integration test
Signed-off-by: Joas Schilling <coding@schilljs.com>
2021-11-25 11:49:54 +00:00
Joas Schilling 4736bba7f6 Check for invalid characters before trimming
Signed-off-by: Joas Schilling <coding@schilljs.com>
2021-11-25 11:49:54 +00:00
Pytal 11be6bf4ec Merge pull request #29877 from nextcloud/backport/29869/stable23 2021-11-24 11:07:38 -08:00
szaimen 43e032dd1b Merge pull request #29882 from nextcloud/backport/29826/stable23
[stable23] Personalsettings - fix marginLeft as it breaks the layout
2021-11-24 17:41:44 +01:00
szaimen 48e8f5a536 Personalsettings - remove marginLeft as it breaks the layout
Signed-off-by: szaimen <szaimen@e.mail.de>
Signed-off-by: nextcloud-command <nextcloud-command@users.noreply.github.com>
2021-11-24 13:47:34 +00:00
Vincent Petry 29166b6c61 Merge pull request #29876 from nextcloud/backport/29864/stable23
[stable23] Allow to fetch the creation time of folders
2021-11-24 12:45:43 +01:00
Christopher Ng 3a68a36ee4 Hide user status from public
Signed-off-by: Christopher Ng <chrng8@gmail.com>
2021-11-24 10:33:33 +00:00
Julius Härtl 3d8aa4e038 Allow to fetch the creation time of folders
Signed-off-by: Julius Härtl <jus@bitgrid.net>
2021-11-24 10:23:30 +00:00
Pytal 21a1b0cace Merge pull request #29858 from nextcloud/backport/29791/stable23 2021-11-23 16:19:19 -08:00
szaimen d0385114e1 Merge pull request #29847 from nextcloud/backport/29833/stable23
[stable23] make profile page usable on mobile
2021-11-23 17:33:34 +01:00
szaimen ce69760500 fix imagecreatetruecolor() error
Signed-off-by: szaimen <szaimen@e.mail.de>
2021-11-23 14:26:26 +00:00
szaimen 7b4c6fe066 make profile page usable on mobile
Signed-off-by: szaimen <szaimen@e.mail.de>
Signed-off-by: nextcloud-command <nextcloud-command@users.noreply.github.com>
2021-11-23 14:18:47 +00:00
Carl Schwan 17db07c50a Fix multiple bugs with user status
* Fix editing the status while on a call, don't send a bogus request
* Clean backup user status when setting up a new status manually
* A bit more type hinting

Signed-off-by: Carl Schwan <carl@carlschwan.eu>
2021-11-23 13:39:27 +00:00
Louis 9b0b0fc8d3 Merge pull request #29844 from nextcloud/backport/29567/stable23
[stable23] Improve sorting of profile visibility dropdowns
2021-11-23 14:19:42 +01:00
Louis 503be0ef9f Merge pull request #29845 from nextcloud/backport/29544/stable23
[stable23] Fix wording on profile page
2021-11-23 14:17:43 +01:00
Vincent Petry a08b3b0f00 Merge pull request #29849 from nextcloud/backport/29835/stable23
[stable23] Fix getting subnet of ipv4 mapped ipv6 addresses
2021-11-23 14:03:01 +01:00
Vincent Petry 6ffd6b2dee Type hint in IpAddress
Signed-off-by: Vincent Petry <vincent@nextcloud.com>

Co-authored-by: Côme Chilliet <91878298+come-nc@users.noreply.github.com>
2021-11-23 10:23:02 +00:00
Vincent Petry e7890cc401 Improve normalizer detecting IPv4 inside of IPv6
The subnet for an IPv4 address inside of IPv6 is now returned in its
IPv4 form.

Signed-off-by: Vincent Petry <vincent@nextcloud.com>
2021-11-23 10:23:02 +00:00
Vincent Petry e98ee218be Fix getting subnet of ipv4 mapped ipv6 addresses
Signed-off-by: Vincent Petry <vincent@nextcloud.com>
2021-11-23 10:23:00 +00:00
Christopher Ng 185da2f25f Fix wording on profile page
Signed-off-by: Christopher Ng <chrng8@gmail.com>
Signed-off-by: nextcloud-command <nextcloud-command@users.noreply.github.com>
2021-11-23 01:35:53 +00:00
Christopher Ng 256437d120 Improve sorting
- Extract sort logic into a separate function
- Sort non-core parameters with localeCompare

Signed-off-by: Christopher Ng <chrng8@gmail.com>
Signed-off-by: nextcloud-command <nextcloud-command@users.noreply.github.com>
2021-11-23 01:35:52 +00:00
dependabot[bot] a33e0a6580 Merge pull request #29815 from nextcloud/dependabot/composer/build/integration/stable23/sabre/dav-4.2.0 2021-11-22 20:43:40 +00:00
dependabot[bot] 2aeb134993 Update sabre/dav requirement from 4.1.5 to 4.2.0 in /build/integration
Updates the requirements on [sabre/dav](https://github.com/sabre-io/dav) to permit the latest version.
- [Release notes](https://github.com/sabre-io/dav/releases)
- [Changelog](https://github.com/sabre-io/dav/blob/master/CHANGELOG.md)
- [Commits](https://github.com/sabre-io/dav/compare/4.1.5...4.2.0)

---
updated-dependencies:
- dependency-name: sabre/dav
  dependency-type: direct:development
...

Signed-off-by: dependabot[bot] <support@github.com>
2021-11-22 19:58:42 +00:00
Louis 83e6007e34 Merge pull request #29813 from nextcloud/dependabot/npm_and_yarn/stable23/camelcase-6.2.1
Bump camelcase from 6.2.0 to 6.2.1
2021-11-22 11:06:23 +01:00
Joas Schilling 78db627d88 Merge pull request #29828 from nextcloud/backport/29708/stable23
[stable23] Do not print verbose info about app updates if there are none
2021-11-22 09:24:15 +01:00
Christoph Wurst 0afe44c449 Do not print verbose info about app updates if there are none
This is cosmetical but if you have a large number of apps installed then
you'll see a wall of text during the server and app upgrade when it
tries to update each app via the app store. In may cases nothing will be
updated. For those boring cases we can hide the verbose info, but show
when occ is run with -v. Any actual update will still print a few lines.
Those are the important ones for the admin.

Signed-off-by: Christoph Wurst <christoph@winzerhof-wurst.at>
2021-11-22 02:24:59 +00:00
MichaIng 8fe072e798 Merge pull request #29793 from nextcloud/backport/29605/stable23
[stable23] Normalize file name before existence check in scanner
2021-11-21 20:02:09 +01:00
MichaIng 6debeae0cf Merge pull request #29797 from nextcloud/backport/29788/stable23
[stable23] Fix doc link in sharing settings
2021-11-21 19:58:52 +01:00
dependabot[bot] ba2145ae57 Bump camelcase from 6.2.0 to 6.2.1
Bumps [camelcase](https://github.com/sindresorhus/camelcase) from 6.2.0 to 6.2.1.
- [Release notes](https://github.com/sindresorhus/camelcase/releases)
- [Commits](https://github.com/sindresorhus/camelcase/compare/v6.2.0...v6.2.1)

---
updated-dependencies:
- dependency-name: camelcase
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
2021-11-20 03:32:16 +00:00
acsfer 913e64c81a [stable23] Check for disk_free_space
Backport of https://github.com/nextcloud/server/pull/29758
2021-11-19 20:03:34 +01:00
Vincent Petry 38e7d94006 Fix doc link in sharing settings
The doc link "i" icon was on the wrong line.

Signed-off-by: Vincent Petry <vincent@nextcloud.com>
2021-11-19 15:54:02 +00:00
szaimen 6559144834 Merge pull request #29789 from nextcloud/backport/29784/stable23
[stable23] App summary is optional
2021-11-19 16:24:45 +01:00
Vincent Petry f0661de4e5 Normalize directory entries in Encoding wrapper
Directory entry file names are now normalized in getMetaData(),
getDirectoryContents() and opendir().

This makes the scanner work properly as it assumes pre-normalized names.

In case the names were not normalized, the scanner will now skip the
entries and display a warning when applicable.

Signed-off-by: Vincent Petry <vincent@nextcloud.com>
2021-11-19 14:51:38 +00:00
Vincent Petry 516b10de33 Move storage encoding compatibility warning logic
The encoding check for file names is now happening the Scanner, and an
event will be emitted only if the storage doesn't contain the encoding
compatibility wrapper.

The event is listened to by the occ scan command to be able to display a
warning in case of file name mismatches when they have NFD encoding.

Signed-off-by: Vincent Petry <vincent@nextcloud.com>
2021-11-19 14:51:38 +00:00
Vincent Petry 106950d493 Normalize file name before existence check in scanner
The scanner would not find a NFD-encoded file name in an
existing file list that is normalized.

This normalizes the file name before scanning.

Fixes issues where scanning repeatedly would make NFD files flicker in
and out of existence in the file cache.

Signed-off-by: Vincent Petry <vincent@nextcloud.com>
2021-11-19 14:51:38 +00:00
Joas Schilling 098cf1f9aa App summary is optional
Fixing:
Error: Undefined index: summary at /var/www/html/apps/theming/lib/Controller/ThemingController.php#392

Signed-off-by: Joas Schilling <coding@schilljs.com>
2021-11-19 14:08:55 +00:00
blizzz d9e25f5f32 Merge pull request #29766 from nextcloud/version/23rc3
23 RC 3
2021-11-18 15:28:12 +01:00
blizzz 6c95b46948 Merge pull request #29760 from nextcloud/backport/29752/stable23
[stable23] Explicitly allow some routes without 2FA
2021-11-18 15:27:22 +01:00
Arthur Schiwon 6c7bc8ac98 23 RC 3
Signed-off-by: Arthur Schiwon <blizzz@arthur-schiwon.de>
2021-11-18 13:58:39 +01:00
Christoph Wurst ea38a798f3 Explicitly allow some routes without 2FA
Signed-off-by: Christoph Wurst <christoph@winzerhof-wurst.at>
2021-11-18 13:03:39 +01:00
Carl Schwan 7be83b23f4 Merge pull request #29749 from nextcloud/backport/29747/stable23
[stable23] Allow to serve static WebAssembly and TensorFlow Lite files
2021-11-17 20:55:12 +01:00
rakekniven 73b8a016a4 Merge pull request #29746 from nextcloud/backport/29734/stable23
[stable23] Fixed grammar
2021-11-17 16:56:05 +01:00
Daniel Calviño Sánchez 8ff4870026 Allow to serve static WebAssembly and TensorFlow Lite files
Since Talk 13 (and thus Nextcloud 23) WebAssembly (.wasm) and TensorFlow
Lite (.tflite) files need to be loaded from the web server to provide
certain features (like the background blur in the WebUI).

Those files can be treated in a similar way to other static resources,
and there should not be any problem caching or compressing them.
However, as compressed TensorFlow Lite files are only ~12% smaller,
the compression directive depends on the MIME type and there is no
standard MIME type for TensorFlow Lite files it is not worth to compress
them.

Moreover, no directives to compress WebAssembly files were added either,
as it seems that they would override any other compression directives
set in the default server configuration; for reference it could be done
with something like:
<IfModule mod_deflate.c>
  <IfModule mod_filter.c>
    AddOutputFilterByType DEFLATE application/wasm
  </IfModule>
</IfModule>

Depending on the setup "application/wasm" may not be associated with
".wasm" files, so the directive was added just in case, as otherwise
browsers log a warning.

Signed-off-by: Daniel Calviño Sánchez <danxuliu@gmail.com>
2021-11-17 14:11:52 +00:00
Vincent Petry 016482e50c Merge pull request #29672 from nextcloud/backport/29663/stable23
[stable23] Fix loading all principal calendars in the dav app calendar provider
2021-11-17 13:14:47 +01:00
Vincent Petry 2fb31dffc6 Merge pull request #29662 from nextcloud/enhancement/calendar-search-properties-api-stable23
[stable23] Document allowed property names for calendar property searches
2021-11-17 13:14:05 +01:00
rakekniven eecfa3f105 Fixed grammar
Reported at Transifex.

Signed-off-by: rakekniven <2069590+rakekniven@users.noreply.github.com>
2021-11-17 11:08:09 +00:00
Vincent Petry b8318c2363 Merge pull request #29737 from nextcloud/backport/29695/stable23
[stable23] Fix missing setlocale with php 8
2021-11-17 08:10:45 +01:00
Naoto Kobayashi acece8f4ba OC_Util::isNonUTF8Locale: fix lint error
Signed-off-by: Naoto Kobayashi <naoto.kobayashi4c@gmail.com>
2021-11-16 17:52:18 +00:00
Naoto Kobayashi 5fc031c91f OC_Util::isSetLocaleWorking: fix typo
Signed-off-by: Naoto Kobayashi <naoto.kobayashi4c@gmail.com>
2021-11-16 17:52:18 +00:00
Naoto Kobayashi d27be604d4 OC_Util: Add fallbacks to check if current locale is UTF8
Using escapeshellcmd to get current locale causes error
if the function is disabled.

Add fallbacks to prevent the error.

Signed-off-by: Naoto Kobayashi <naoto.kobayashi4c@gmail.com>
2021-11-16 17:52:18 +00:00
Naoto Kobayashi df52393d31 Add check whether escapeshellcmd behaves the same as basename
Signed-off-by: Naoto Kobayashi <naoto.kobayashi4c@gmail.com>
2021-11-16 17:52:18 +00:00
Naoto Kobayashi 3b83976c98 Check whether setlocale works only after setlocale
Signed-off-by: Naoto Kobayashi <naoto.kobayashi4c@gmail.com>
2021-11-16 17:52:18 +00:00
Naoto Kobayashi 7e80182e75 Fix missing setlocale with php 8
When php version = 8, basename('§') does not bug even if LC_ALL is non-UTF-8 locale.
This cause OC_Util::isSetLocaleWorking() to skip setlocale("C.UTF-8").

Fix it by using escapeshellcmd instead of basename.

Signed-off-by: Naoto Kobayashi <naoto.kobayashi4c@gmail.com>
2021-11-16 17:52:17 +00:00
MichaIng a80d49a0e7 Merge pull request #29728 from nextcloud/backport/29683/stable23
[stable23] Fix core depending on theming app
2021-11-16 13:24:26 +01:00
MichaIng 077c45f173 Correct comment about OC_Defaults being used
Signed-off-by: MichaIng <micha@dietpi.com>
2021-11-16 10:36:05 +00:00
Carl Schwan b8da11cd62 Fix core depending on theming app
This was introduced in https://github.com/nextcloud/server/commit/309354852f12ae88d5eef05d311d6ebcba8ee762
to fix a bug but I can't reproduce the bug after reverting this change.

Ideally we would need to create an interface in OCP and cleanup OC_Defaults
instead of depending on OC_Defaults.

Signed-off-by: Carl Schwan <carl@carlschwan.eu>
2021-11-16 10:36:04 +00:00
John Molakvoæ 0233cd4edb Merge pull request #29716 from nextcloud/bump-doctrine-dbal-23 2021-11-15 19:55:18 +01:00
Joas Schilling ebfb94fbc0 Bump doctrine/dbal to 3.1.4
Signed-off-by: Joas Schilling <coding@schilljs.com>
2021-11-15 18:55:23 +01:00
Joas Schilling 8b0bf9eadf Allow NULL as well for limit, not integer only
Signed-off-by: Joas Schilling <coding@schilljs.com>
2021-11-15 18:53:42 +01:00
szaimen 1e1ef32cca Merge pull request #29705 from nextcloud/backport/29679/stable23
[stable23] don't flash external storage mountpoints during the status check
2021-11-15 16:33:21 +01:00
szaimen 3bd26b630e don't flash external storage mountpoints during the status check
Signed-off-by: szaimen <szaimen@e.mail.de>
2021-11-15 12:12:37 +00:00
Louis 9eac3099d3 Merge pull request #29659 from nextcloud/dependabot/npm_and_yarn/stable23/bootstrap-4.6.1
Bump bootstrap from 4.6.0 to 4.6.1
2021-11-15 11:53:29 +01:00
Louis 28376490bf Merge pull request #29653 from nextcloud/dependabot/npm_and_yarn/stable23/moment-timezone-0.5.34
Bump moment-timezone from 0.5.33 to 0.5.34
2021-11-15 11:46:53 +01:00
Louis f37d550f8a Merge pull request #29649 from nextcloud/dependabot/composer/build/integration/stable23/sabre/dav-4.1.5
Update sabre/dav requirement from 3.2.3 to 4.1.5 in /build/integration
2021-11-15 11:34:00 +01:00
Louis ca2e024fb0 Merge pull request #29654 from nextcloud/dependabot/npm_and_yarn/stable23/marked-3.0.8
Bump marked from 3.0.7 to 3.0.8
2021-11-15 11:30:03 +01:00
John Molakvoæ b1c32d32b1 Merge pull request #29701 from nextcloud/fix-branch-selection-in-stable23 2021-11-15 10:13:41 +01:00
Christoph Wurst bf5c89bbdd Merge pull request #29671 from nextcloud/backport/29660/stable23
[stable23] Fix initialization of calendar search URIs
2021-11-15 09:52:24 +01:00
Joas Schilling 49486de8cd Fix branch selection in stable23
Signed-off-by: Joas Schilling <coding@schilljs.com>
2021-11-15 06:58:05 +01:00
dependabot[bot] 59cb10c59a Bump bootstrap from 4.6.0 to 4.6.1
Bumps [bootstrap](https://github.com/twbs/bootstrap) from 4.6.0 to 4.6.1.
- [Release notes](https://github.com/twbs/bootstrap/releases)
- [Commits](https://github.com/twbs/bootstrap/compare/v4.6.0...v4.6.1)

---
updated-dependencies:
- dependency-name: bootstrap
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
Signed-off-by: nextcloud-command <nextcloud-command@users.noreply.github.com>
2021-11-13 21:48:51 +00:00
dependabot[bot] 025951ebf4 Update sabre/dav requirement from 3.2.3 to 4.1.5 in /build/integration
Updates the requirements on [sabre/dav](https://github.com/sabre-io/dav) to permit the latest version.
- [Release notes](https://github.com/sabre-io/dav/releases)
- [Changelog](https://github.com/sabre-io/dav/blob/master/CHANGELOG.md)
- [Commits](https://github.com/sabre-io/dav/compare/3.2.3...4.1.5)

---
updated-dependencies:
- dependency-name: sabre/dav
  dependency-type: direct:development
...

Signed-off-by: dependabot[bot] <support@github.com>
2021-11-13 18:09:40 +00:00
dependabot[bot] 7a5dcf7e3e Bump moment-timezone from 0.5.33 to 0.5.34
Bumps [moment-timezone](https://github.com/moment/moment-timezone) from 0.5.33 to 0.5.34.
- [Release notes](https://github.com/moment/moment-timezone/releases)
- [Changelog](https://github.com/moment/moment-timezone/blob/develop/changelog.md)
- [Commits](https://github.com/moment/moment-timezone/compare/0.5.33...0.5.34)

---
updated-dependencies:
- dependency-name: moment-timezone
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
Signed-off-by: nextcloud-command <nextcloud-command@users.noreply.github.com>
2021-11-13 18:09:39 +00:00
MichaIng 6db690c3c7 Merge pull request #29651 from nextcloud/dependabot/composer/build/integration/stable23/behat/behat-approx-3.10.0
Update behat/behat requirement from ~3.9.0 to ~3.10.0 in /build/integration
2021-11-13 19:08:47 +01:00
dependabot[bot] fb214c25c6 Bump marked from 3.0.7 to 3.0.8
Bumps [marked](https://github.com/markedjs/marked) from 3.0.7 to 3.0.8.
- [Release notes](https://github.com/markedjs/marked/releases)
- [Changelog](https://github.com/markedjs/marked/blob/master/.releaserc.json)
- [Commits](https://github.com/markedjs/marked/compare/v3.0.7...v3.0.8)

---
updated-dependencies:
- dependency-name: marked
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
Signed-off-by: nextcloud-command <nextcloud-command@users.noreply.github.com>
2021-11-13 16:49:45 +00:00
blizzz 84397254b6 Merge pull request #29686 from nextcloud/version/23rc2
23.0.0 RC2
2021-11-12 16:42:13 +01:00
blizzz 22641dfd3f Merge pull request #29684 from nextcloud/backport/29682/stable23
[stable23] Fix missing token update
2021-11-12 16:41:48 +01:00
Arthur Schiwon cbfb7811a5 udpdate CA bundle
Signed-off-by: Arthur Schiwon <blizzz@arthur-schiwon.de>
2021-11-12 16:30:14 +01:00
Arthur Schiwon d67f540d15 23.0.0 RC2
Signed-off-by: Arthur Schiwon <blizzz@arthur-schiwon.de>
2021-11-12 15:58:14 +01:00
Joas Schilling f0045bf139 Fix unit tests
Signed-off-by: Joas Schilling <coding@schilljs.com>
2021-11-12 14:49:38 +00:00
Joas Schilling 21f7134fe0 Fix missing token update
Signed-off-by: Joas Schilling <coding@schilljs.com>
2021-11-12 14:49:38 +00:00
Joas Schilling 35546c034d Merge pull request #29677 from nextcloud/bugfix/noid/fix-video-verification-tests
Fix video verification tests
2021-11-12 12:19:36 +01:00
Joas Schilling 9967198e5a Fix video verification tests
Signed-off-by: Joas Schilling <coding@schilljs.com>
2021-11-11 16:47:12 +01:00
John Molakvoæ 36f1714f1d Merge pull request #29666 from nextcloud/backport/29664/stable23 2021-11-11 16:44:31 +01:00
Christoph Wurst dab21ab707 Fix loading all principal calendars in the dav app calendar provider
If we load all calendar infos of a principal then we get back an array
and not a single calendar info. This was handled incorrectly and an
array of calendar infos were passed to the calendar implementation,
resulting in interesting bugs.

Signed-off-by: Christoph Wurst <christoph@winzerhof-wurst.at>
2021-11-11 15:12:51 +00:00
Christoph Wurst ddf6b82112 Fix initialization of calendar search URIs
They are an empty array by default. If you don't initialize then
accessing them via the setter will throw a type error.

Signed-off-by: Christoph Wurst <christoph@winzerhof-wurst.at>
2021-11-11 15:07:36 +00:00
Joas Schilling 32005be6b2 Fix updating with apps
Signed-off-by: Joas Schilling <coding@schilljs.com>
2021-11-11 13:39:22 +00:00
Christoph Wurst 0b72abb7a5 Document allowed property names for calendar property searches
For API users it looked like any properties could be searched. But it
turned out to be a hand picked list of properties that we index and then
use for the search. To prevent application errors where special props
are not found, I suggest we document the allowed values.

Signed-off-by: Christoph Wurst <christoph@winzerhof-wurst.at>
2021-11-11 11:02:48 +01:00
dependabot[bot] 2e14d28262 Update behat/behat requirement in /build/integration
Updates the requirements on [behat/behat](https://github.com/Behat/Behat) to permit the latest version.
- [Release notes](https://github.com/Behat/Behat/releases)
- [Changelog](https://github.com/Behat/Behat/blob/master/CHANGELOG.md)
- [Commits](https://github.com/Behat/Behat/compare/v3.9.0...v3.10.0)

---
updated-dependencies:
- dependency-name: behat/behat
  dependency-type: direct:development
...

Signed-off-by: dependabot[bot] <support@github.com>
2021-11-11 09:38:46 +00:00
423 changed files with 15078 additions and 2433 deletions
+1 -1
View File
@@ -1,5 +1,5 @@
codecov:
branch: master
branch: stable23
ci:
- drone.nextcloud.com
- !scrutinizer-ci.com
+1 -1
View File
@@ -1403,7 +1403,7 @@ steps:
commands:
# JavaScript files are not used in integration tests so it is not needed to
# build them.
- git clone --depth 1 https://github.com/nextcloud/spreed apps/spreed
- git clone --depth 1 --branch stable23 https://github.com/nextcloud/spreed apps/spreed
- name: integration-sharing-v1-video-verification
image: ghcr.io/nextcloud/continuous-integration-integration-php7.3:latest
commands:
+30
View File
@@ -0,0 +1,30 @@
# This workflow is provided via the organization template repository
#
# https://github.com/nextcloud/.github
# https://docs.github.com/en/actions/learn-github-actions/sharing-workflows-with-your-organization
name: Pull request checks
on: pull_request
jobs:
block-merges-eol:
name: Block merges for EOL branches
# Only run on stableXX branches
if: startsWith( github.base_ref, 'stable')
runs-on: ubuntu-latest
steps:
- name: Download updater config
run: curl https://raw.githubusercontent.com/nextcloud/updater_server/production/config/config.php --output config.php
- name: Set server major version environment
run: |
# retrieve version number from branch reference
server_major=$(echo "${{ github.base_ref }}" | sed -En 's/stable//p')
echo "server_major=$server_major" >> $GITHUB_ENV
- name: Checking if ${{ env.server_major }} is EOL
run: |
php -r 'echo json_encode(require_once "config.php");' | jq --arg version "${{ env.server_major }}" '.stable[$version]["100"].eol' | grep --silent -i 'false'
+21
View File
@@ -0,0 +1,21 @@
# This workflow is provided via the organization template repository
#
# https://github.com/nextcloud/.github
# https://docs.github.com/en/actions/learn-github-actions/sharing-workflows-with-your-organization
name: Pull request checks
on: pull_request
jobs:
block-merges-during-freeze:
name: Block merges during feature freezes
runs-on: ubuntu-latest
steps:
- name: Download version.php from ${{ github.base_ref }}
run: curl https://raw.githubusercontent.com/nextcloud/server/${{ github.base_ref }}/version.php --output version.php
- name: Run check
run: cat version.php | grep 'OC_VersionString' | grep -i -v 'RC'
+1 -1
View File
@@ -44,7 +44,7 @@ jobs:
with:
php-version: ${{ matrix.php-versions }}
tools: phpunit
extensions: mbstring, iconv, fileinfo, intl, sqlite, pdo_sqlite, zip, gd
extensions: mbstring, fileinfo, intl, sqlite, pdo_sqlite, zip, gd
- name: Set up Nextcloud
run: |
+2 -2
View File
@@ -15,7 +15,7 @@ jobs:
uses: shivammathur/setup-php@master
with:
php-version: ${{ matrix.php-versions }}
extensions: ctype,curl,dom,fileinfo,gd,iconv,intl,json,mbstring,openssl,pdo_sqlite,posix,sqlite,xml,zip
extensions: ctype,curl,dom,fileinfo,gd,intl,json,mbstring,openssl,pdo_sqlite,posix,sqlite,xml,zip
coverage: none
- name: Lint
run: composer run lint
@@ -30,7 +30,7 @@ jobs:
uses: shivammathur/setup-php@master
with:
php-version: 7.4
extensions: ctype,curl,dom,fileinfo,gd,iconv,intl,json,mbstring,openssl,pdo_sqlite,posix,sqlite,xml,zip
extensions: ctype,curl,dom,fileinfo,gd,intl,json,mbstring,openssl,pdo_sqlite,posix,sqlite,xml,zip
coverage: none
tools: cs2pr
- name: Install dependencies
+1 -1
View File
@@ -40,7 +40,7 @@ jobs:
uses: shivammathur/setup-php@v2
with:
php-version: ${{ matrix.php-versions }}
extensions: ctype,curl,dom,fileinfo,gd,iconv,imagick,intl,json,mbstring,oci8,openssl,pdo_sqlite,posix,sqlite,xml,zip
extensions: ctype,curl,dom,fileinfo,gd,imagick,intl,json,mbstring,oci8,openssl,pdo_sqlite,posix,sqlite,xml,zip
tools: phpunit:9
coverage: none
+2 -2
View File
@@ -45,7 +45,7 @@ jobs:
with:
php-version: ${{ matrix.php-versions }}
tools: phpunit
extensions: mbstring, iconv, fileinfo, intl, sqlite, pdo_sqlite, zip, gd
extensions: mbstring, fileinfo, intl, sqlite, pdo_sqlite, zip, gd
- name: Set up Nextcloud
run: |
@@ -94,7 +94,7 @@ jobs:
with:
php-version: ${{ matrix.php-versions }}
tools: phpunit
extensions: mbstring, iconv, fileinfo, intl, sqlite, pdo_sqlite, zip, gd
extensions: mbstring, fileinfo, intl, sqlite, pdo_sqlite, zip, gd
- name: Set up Nextcloud
run: |
+78
View File
@@ -0,0 +1,78 @@
name: Samba Kerberos SSO
on:
push:
branches:
- master
- stable*
paths:
- 'apps/files_external/**'
pull_request:
paths:
- 'apps/files_external/**'
jobs:
smb-kerberos-tests:
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
php-versions: ['7.4', '8.0']
name: php${{ matrix.php-versions }}-${{ matrix.ftpd }}
steps:
- name: Checkout server
uses: actions/checkout@v2
with:
submodules: true
- name: Pull images
run: |
docker pull icewind1991/samba-krb-test-dc
docker pull icewind1991/samba-krb-test-apache
docker pull icewind1991/samba-krb-test-client
- name: Setup AD-DC
run: |
mkdir data
sudo chown -R 33 data apps config
apps/files_external/tests/setup-krb.sh
- name: Set up Nextcloud
run: |
docker exec --user 33 apache ./occ maintenance:install --verbose --database=sqlite --database-name=nextcloud --database-host=127.0.0.1 --database-user=root --database-pass=rootpassword --admin-user admin --admin-pass password
docker exec --user 33 apache ./occ config:system:set trusted_domains 1 --value 'httpd.domain.test'
# setup user_saml
docker exec --user 33 apache ./occ app:enable user_saml --force
docker exec --user 33 apache ./occ config:app:set user_saml type --value 'environment-variable'
docker exec --user 33 apache ./occ config:app:set user_saml general-uid_mapping --value REMOTE_USER
# setup external storage
docker exec --user 33 apache ./occ app:enable files_external --force
docker exec --user 33 apache ./occ files_external:create smb smb smb::kerberosapache
docker exec --user 33 apache ./occ files_external:config 1 host krb.domain.test
docker exec --user 33 apache ./occ files_external:config 1 share netlogon
docker exec --user 33 apache ./occ files_external:list
- name: Test SSO
run: |
mkdir cookies
chmod 0777 cookies
DC_IP=$(docker inspect dc --format '{{.NetworkSettings.IPAddress}}')
docker run --rm --name client -v $PWD/cookies:/cookies -v /tmp/shared:/shared --dns $DC_IP --hostname client.domain.test icewind1991/samba-krb-test-client \
curl -c /cookies/jar -s --negotiate -u testuser@DOMAIN.TEST: --delegation always http://httpd.domain.test/index.php/apps/user_saml/saml/login
CONTENT=$(docker run --rm --name client -v $PWD/cookies:/cookies -v /tmp/shared:/shared --dns $DC_IP --hostname client.domain.test icewind1991/samba-krb-test-client \
curl -b /cookies/jar -s --negotiate -u testuser@DOMAIN.TEST: --delegation always http://httpd.domain.test/remote.php/webdav/smb/test.txt)
echo $CONTENT
CONTENT=$(echo $CONTENT | tr -d '[:space:]')
[[ $CONTENT == "testfile" ]]
smb-kerberos-summary:
runs-on: ubuntu-latest
needs: smb-kerberos-tests
if: always()
steps:
- name: Summary status
run: if ${{ needs.smb-kerberos-tests.result != 'success' }}; then exit 1; fi
+2 -2
View File
@@ -17,7 +17,7 @@ jobs:
uses: shivammathur/setup-php@master
with:
php-version: 7.4
extensions: ctype,curl,dom,fileinfo,gd,iconv,intl,json,mbstring,openssl,pdo_sqlite,posix,sqlite,xml,zip
extensions: ctype,curl,dom,fileinfo,gd,intl,json,mbstring,openssl,pdo_sqlite,posix,sqlite,xml,zip
coverage: none
- name: Composer install
run: composer i
@@ -43,7 +43,7 @@ jobs:
uses: shivammathur/setup-php@master
with:
php-version: 7.4
extensions: ctype,curl,dom,fileinfo,gd,iconv,intl,json,mbstring,openssl,pdo_sqlite,posix,sqlite,xml,zip
extensions: ctype,curl,dom,fileinfo,gd,intl,json,mbstring,openssl,pdo_sqlite,posix,sqlite,xml,zip
coverage: none
- name: Composer install
run: composer i
+1 -1
View File
@@ -18,7 +18,7 @@ jobs:
uses: shivammathur/setup-php@v2
with:
php-version: 7.4
extensions: ctype,curl,dom,fileinfo,gd,iconv,intl,json,mbstring,openssl,pdo_sqlite,posix,sqlite,xml,zip
extensions: ctype,curl,dom,fileinfo,gd,intl,json,mbstring,openssl,pdo_sqlite,posix,sqlite,xml,zip
coverage: none
- name: Composer install
+2 -1
View File
@@ -43,7 +43,7 @@
</IfModule>
# Add cache control for static resources
<FilesMatch "\.(css|js|svg|gif|png|jpg|ico)$">
<FilesMatch "\.(css|js|svg|gif|png|jpg|ico|wasm|tflite)$">
Header set Cache-Control "max-age=15778463"
</FilesMatch>
@@ -75,6 +75,7 @@
<IfModule mod_mime.c>
AddType image/svg+xml svg svgz
AddType application/wasm wasm
AddEncoding gzip svgz
</IfModule>
+2 -1
View File
@@ -2,13 +2,14 @@
declare(strict_types=1);
require_once './lib/composer/autoload.php';
require_once './vendor-bin/cs-fixer/vendor/autoload.php';
use Nextcloud\CodingStandard\Config;
$config = new Config();
$config
->getFinder()
->ignoreVCSIgnored(true)
->exclude('config')
->exclude('data')
->notPath('3rdparty')
+2 -2
View File
@@ -1,6 +1,6 @@
# Nextcloud Server ☁
[![Scrutinizer Code Quality](https://scrutinizer-ci.com/g/nextcloud/server/badges/quality-score.png?b=master)](https://scrutinizer-ci.com/g/nextcloud/server/?branch=master)
[![codecov](https://codecov.io/gh/nextcloud/server/branch/master/graph/badge.svg)](https://codecov.io/gh/nextcloud/server)
[![Scrutinizer Code Quality](https://scrutinizer-ci.com/g/nextcloud/server/badges/quality-score.png?b=stable23)](https://scrutinizer-ci.com/g/nextcloud/server/?branch=stable23)
[![codecov](https://codecov.io/gh/nextcloud/server/branch/stable23/graph/badge.svg)](https://codecov.io/gh/nextcloud/server)
[![CII Best Practices](https://bestpractices.coreinfrastructure.org/projects/209/badge)](https://bestpractices.coreinfrastructure.org/projects/209)
**A safe home for all your data.**
+10
View File
@@ -61,3 +61,13 @@
}
}
}
@media (max-width: ($breakpoint-mobile / 2)) {
.app-settings #accessibility .preview-list .preview {
display: unset;
.preview-image {
height: 150px;
}
}
}
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
@@ -8,6 +8,7 @@
<version>1.4.0</version>
<licence>agpl</licence>
<author>Christoph Wurst</author>
<author homepage="https://github.com/nextcloud/groupware">Nextcloud Groupware Team</author>
<namespace>ContactsInteraction</namespace>
<types>
<dav/>
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
+1 -1
View File
@@ -149,7 +149,7 @@ class ClassLoader
/**
* @return string[] Array of classname => path
* @psalm-var array<string, string>
* @psalm-return array<string, string>
*/
public function getClassMap()
{
@@ -163,6 +163,7 @@ return array(
'OCA\\DAV\\Connector\\Sabre\\FilesReportPlugin' => $baseDir . '/../lib/Connector/Sabre/FilesReportPlugin.php',
'OCA\\DAV\\Connector\\Sabre\\LockPlugin' => $baseDir . '/../lib/Connector/Sabre/LockPlugin.php',
'OCA\\DAV\\Connector\\Sabre\\MaintenancePlugin' => $baseDir . '/../lib/Connector/Sabre/MaintenancePlugin.php',
'OCA\\DAV\\Connector\\Sabre\\MtimeSanitizer' => $baseDir . '/../lib/Connector/Sabre/MtimeSanitizer.php',
'OCA\\DAV\\Connector\\Sabre\\Node' => $baseDir . '/../lib/Connector/Sabre/Node.php',
'OCA\\DAV\\Connector\\Sabre\\ObjectTree' => $baseDir . '/../lib/Connector/Sabre/ObjectTree.php',
'OCA\\DAV\\Connector\\Sabre\\Principal' => $baseDir . '/../lib/Connector/Sabre/Principal.php',
@@ -178,6 +178,7 @@ class ComposerStaticInitDAV
'OCA\\DAV\\Connector\\Sabre\\FilesReportPlugin' => __DIR__ . '/..' . '/../lib/Connector/Sabre/FilesReportPlugin.php',
'OCA\\DAV\\Connector\\Sabre\\LockPlugin' => __DIR__ . '/..' . '/../lib/Connector/Sabre/LockPlugin.php',
'OCA\\DAV\\Connector\\Sabre\\MaintenancePlugin' => __DIR__ . '/..' . '/../lib/Connector/Sabre/MaintenancePlugin.php',
'OCA\\DAV\\Connector\\Sabre\\MtimeSanitizer' => __DIR__ . '/..' . '/../lib/Connector/Sabre/MtimeSanitizer.php',
'OCA\\DAV\\Connector\\Sabre\\Node' => __DIR__ . '/..' . '/../lib/Connector/Sabre/Node.php',
'OCA\\DAV\\Connector\\Sabre\\ObjectTree' => __DIR__ . '/..' . '/../lib/Connector/Sabre/ObjectTree.php',
'OCA\\DAV\\Connector\\Sabre\\Principal' => __DIR__ . '/..' . '/../lib/Connector/Sabre/Principal.php',
+2 -2
View File
@@ -5,7 +5,7 @@
'type' => 'library',
'install_path' => __DIR__ . '/../',
'aliases' => array(),
'reference' => 'c6429e6cd19c57582364338362e543580821cf99',
'reference' => 'e2c675724fc4ea50f1275bf0027b96f277c32578',
'name' => '__root__',
'dev' => false,
),
@@ -16,7 +16,7 @@
'type' => 'library',
'install_path' => __DIR__ . '/../',
'aliases' => array(),
'reference' => 'c6429e6cd19c57582364338362e543580821cf99',
'reference' => 'e2c675724fc4ea50f1275bf0027b96f277c32578',
'dev_requirement' => false,
),
),
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
@@ -29,6 +29,7 @@ use Sabre\HTTP\RequestInterface;
use Sabre\HTTP\ResponseInterface;
use OCP\Files\Folder;
use OCP\AppFramework\Http;
use OCA\DAV\Connector\Sabre\MtimeSanitizer;
class BulkUploadPlugin extends ServerPlugin {
@@ -78,7 +79,18 @@ class BulkUploadPlugin extends ServerPlugin {
}
try {
// TODO: Remove 'x-file-mtime' when the desktop client no longer use it.
if (isset($headers['x-file-mtime'])) {
$mtime = MtimeSanitizer::sanitizeMtime($headers['x-file-mtime']);
} elseif (isset($headers['x-oc-mtime'])) {
$mtime = MtimeSanitizer::sanitizeMtime($headers['x-oc-mtime']);
} else {
$mtime = null;
}
$node = $this->userFolder->newFile($headers['x-file-path'], $content);
$node->touch($mtime);
$writtenFiles[$headers['x-file-path']] = [
"error" => false,
"etag" => $node->getETag(),
+38 -1
View File
@@ -100,7 +100,9 @@ use function array_merge;
use function array_values;
use function explode;
use function is_array;
use function is_resource;
use function pathinfo;
use function rewind;
use function sprintf;
use function str_replace;
use function strtolower;
@@ -1900,7 +1902,40 @@ class CalDavBackend extends AbstractBackend implements SyncSupport, Subscription
}
$result = $outerQuery->executeQuery();
$calendarObjects = $result->fetchAll();
$calendarObjects = array_filter($result->fetchAll(), function (array $row) use ($options) {
$start = $options['timerange']['start'] ?? null;
$end = $options['timerange']['end'] ?? null;
if ($start === null || !($start instanceof DateTimeInterface) || $end === null || !($end instanceof DateTimeInterface)) {
// No filter required
return true;
}
$isValid = $this->validateFilterForObject($row, [
'name' => 'VCALENDAR',
'comp-filters' => [
[
'name' => 'VEVENT',
'comp-filters' => [],
'prop-filters' => [],
'is-not-defined' => false,
'time-range' => [
'start' => $start,
'end' => $end,
],
],
],
'prop-filters' => [],
'is-not-defined' => false,
'time-range' => null,
]);
if (is_resource($row['calendardata'])) {
// Put the stream back to the beginning so it can be read another time
rewind($row['calendardata']);
}
return $isValid;
});
$result->closeCursor();
return array_map(function ($o) {
$calendarData = Reader::read($o['calendardata']);
@@ -2615,6 +2650,7 @@ class CalDavBackend extends AbstractBackend implements SyncSupport, Subscription
'size' => (int)$row['size'],
];
}
$stmt->closeCursor();
return $result;
}
@@ -2994,6 +3030,7 @@ class CalDavBackend extends AbstractBackend implements SyncSupport, Subscription
->executeQuery();
$ids = $result->fetchAll();
$result->closeCursor();
foreach ($ids as $id) {
$this->deleteCalendar(
$id['id'],
+1 -1
View File
@@ -49,7 +49,7 @@ class CalendarProvider implements ICalendarProvider {
public function getCalendars(string $principalUri, array $calendarUris = []): array {
$calendarInfos = [];
if (empty($calendarUris)) {
$calendarInfos[] = $this->calDavBackend->getCalendarsForUser($principalUri);
$calendarInfos = $this->calDavBackend->getCalendarsForUser($principalUri);
} else {
foreach ($calendarUris as $calendarUri) {
$calendarInfos[] = $this->calDavBackend->getCalendarByUri($principalUri, $calendarUri);
+2 -1
View File
@@ -29,7 +29,8 @@ class Capabilities implements ICapability {
return [
'dav' => [
'chunking' => '1.0',
'bulkupload' => '1.0',
// disabled because of https://github.com/nextcloud/desktop/issues/4243
// 'bulkupload' => '1.0',
]
];
}
+2
View File
@@ -107,6 +107,8 @@ class AddressBookImpl implements IAddressBook {
* - 'escape_like_param' - If set to false wildcards _ and % are not escaped
* - 'limit' - Set a numeric limit for the search results
* - 'offset' - Set the offset for the limited search results
* - 'wildcard' - Whether the search should use wildcards
* @psalm-param array{types?: bool, escape_like_param?: bool, limit?: int, offset?: int, wildcard?: bool} $options
* @return array an array of contacts which are arrays of key-value-pairs
* example result:
* [
+7 -1
View File
@@ -1024,6 +1024,8 @@ class CardDavBackend implements BackendInterface, SyncSupport {
* - 'escape_like_param' - If set to false wildcards _ and % are not escaped, otherwise they are
* - 'limit' - Set a numeric limit for the search results
* - 'offset' - Set the offset for the limited search results
* - 'wildcard' - Whether the search should use wildcards
* @psalm-param array{escape_like_param?: bool, limit?: int, offset?: int, wildcard?: bool} $options
* @return array an array of contacts which are arrays of key-value-pairs
*/
public function search($addressBookId, $pattern, $searchProperties, $options = []): array {
@@ -1055,6 +1057,7 @@ class CardDavBackend implements BackendInterface, SyncSupport {
* @param string $pattern
* @param array $searchProperties
* @param array $options
* @psalm-param array{types?: bool, escape_like_param?: bool, limit?: int, offset?: int, wildcard?: bool} $options
* @return array
*/
private function searchByAddressBookIds(array $addressBookIds,
@@ -1062,6 +1065,7 @@ class CardDavBackend implements BackendInterface, SyncSupport {
array $searchProperties,
array $options = []): array {
$escapePattern = !\array_key_exists('escape_like_param', $options) || $options['escape_like_param'] !== false;
$useWildcards = !\array_key_exists('wildcard', $options) || $options['wildcard'] !== false;
$query2 = $this->db->getQueryBuilder();
@@ -1103,7 +1107,9 @@ class CardDavBackend implements BackendInterface, SyncSupport {
// No need for like when the pattern is empty
if ('' !== $pattern) {
if (!$escapePattern) {
if (!$useWildcards) {
$query2->andWhere($query2->expr()->eq('cp.value', $query2->createNamedParameter($pattern)));
} elseif (!$escapePattern) {
$query2->andWhere($query2->expr()->ilike('cp.value', $query2->createNamedParameter($pattern)));
} else {
$query2->andWhere($query2->expr()->ilike('cp.value', $query2->createNamedParameter('%' . $this->db->escapeLikeParameter($pattern) . '%')));
+3 -6
View File
@@ -391,12 +391,13 @@ class FilesPlugin extends ServerPlugin {
$user->getUID()
);
});
}
if ($node instanceof \OCA\DAV\Connector\Sabre\Node) {
$propFind->handle(self::DATA_FINGERPRINT_PROPERTYNAME, function () use ($node) {
return $this->config->getSystemValue('data-fingerprint', '');
});
$propFind->handle(self::CREATION_TIME_PROPERTYNAME, function () use ($node) {
return $node->getFileInfo()->getCreationTime();
});
}
if ($node instanceof \OCA\DAV\Connector\Sabre\File) {
@@ -423,10 +424,6 @@ class FilesPlugin extends ServerPlugin {
return new ChecksumList($checksum);
});
$propFind->handle(self::CREATION_TIME_PROPERTYNAME, function () use ($node) {
return $node->getFileInfo()->getCreationTime();
});
$propFind->handle(self::UPLOAD_TIME_PROPERTYNAME, function () use ($node) {
return $node->getFileInfo()->getUploadTime();
});
@@ -0,0 +1,42 @@
<?php
/**
* @copyright Copyright (c) 2021, Louis Chemineau <louis@chmn.me>
*
* @author Louis Chemineau <louis@chmn.me>
*
* @license AGPL-3.0
*
* This code is free software: you can redistribute it and/or modify
* it under the terms of the GNU Affero General Public License, version 3,
* as published by the Free Software Foundation.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU Affero General Public License for more details.
*
* You should have received a copy of the GNU Affero General Public License, version 3,
* along with this program. If not, see <http://www.gnu.org/licenses/>
*
*/
namespace OCA\DAV\Connector\Sabre;
class MtimeSanitizer {
public static function sanitizeMtime(string $mtimeFromRequest): int {
// In PHP 5.X "is_numeric" returns true for strings in hexadecimal
// notation. This is no longer the case in PHP 7.X, so this check
// ensures that strings with hexadecimal notations fail too in PHP 5.X.
$isHexadecimal = preg_match('/^\s*0[xX]/', $mtimeFromRequest);
if ($isHexadecimal || !is_numeric($mtimeFromRequest)) {
throw new \InvalidArgumentException('X-OC-MTime header must be an integer (unix timestamp).');
}
// Prevent writing invalid mtime (timezone-proof)
if ((int)$mtimeFromRequest <= 24 * 60 * 60) {
throw new \InvalidArgumentException('X-OC-MTime header must be a valid positive integer');
}
return (int)$mtimeFromRequest;
}
}
+1 -9
View File
@@ -404,14 +404,6 @@ abstract class Node implements \Sabre\DAV\INode {
}
protected function sanitizeMtime($mtimeFromRequest) {
// In PHP 5.X "is_numeric" returns true for strings in hexadecimal
// notation. This is no longer the case in PHP 7.X, so this check
// ensures that strings with hexadecimal notations fail too in PHP 5.X.
$isHexadecimal = is_string($mtimeFromRequest) && preg_match('/^\s*0[xX]/', $mtimeFromRequest);
if ($isHexadecimal || !is_numeric($mtimeFromRequest)) {
throw new \InvalidArgumentException('X-OC-MTime header must be an integer (unix timestamp).');
}
return (int)$mtimeFromRequest;
return MtimeSanitizer::sanitizeMtime($mtimeFromRequest);
}
}
@@ -41,7 +41,8 @@ class RemoveDeletedUsersCalendarSubscriptions implements IRepairStep {
/** @var int */
private $progress = 0;
private $orphanSubscriptions = [];
/** @var int[] */
private $orphanSubscriptionIds = [];
private const SUBSCRIPTIONS_CHUNK_SIZE = 1000;
@@ -74,7 +75,7 @@ class RemoveDeletedUsersCalendarSubscriptions implements IRepairStep {
$output->finishProgress();
$this->deleteOrphanSubscriptions();
$output->info(sprintf('%d calendar subscriptions without an user have been cleaned up', count($this->orphanSubscriptions)));
$output->info(sprintf('%d calendar subscriptions without an user have been cleaned up', count($this->orphanSubscriptionIds)));
}
/**
@@ -112,7 +113,7 @@ class RemoveDeletedUsersCalendarSubscriptions implements IRepairStep {
while ($row = $result->fetch()) {
$username = $this->getPrincipal($row['principaluri']);
if (!$this->userManager->userExists($username)) {
$this->orphanSubscriptions[] = $row['id'];
$this->orphanSubscriptionIds[] = (int) $row['id'];
}
}
$result->closeCursor();
@@ -122,7 +123,7 @@ class RemoveDeletedUsersCalendarSubscriptions implements IRepairStep {
* @throws Exception
*/
private function deleteOrphanSubscriptions(): void {
foreach ($this->orphanSubscriptions as $orphanSubscriptionID) {
foreach ($this->orphanSubscriptionIds as $orphanSubscriptionID) {
$this->deleteOrphanSubscription($orphanSubscriptionID);
}
}
+1 -1
View File
@@ -37,7 +37,7 @@ do
echo -en "--$BOUNDARY\r\n"
# echo -en "Content-ID: $file_name\r\n"
echo -en "X-File-Path: $file_remote_path\r\n"
echo -en "X-File-Mtime: $file_mtime\r\n"
echo -en "X-OC-Mtime: $file_mtime\r\n"
# echo -en "X-File-Id: $file_id\r\n"
echo -en "X-File-Md5: $file_hash\r\n"
echo -en "Content-Length: $file_size\r\n"
+2 -1
View File
@@ -35,7 +35,8 @@ class CapabilitiesTest extends TestCase {
$expected = [
'dav' => [
'chunking' => '1.0',
'bulkupload' => '1.0',
// disabled because of https://github.com/nextcloud/desktop/issues/4243
// 'bulkupload' => '1.0',
],
];
$this->assertSame($expected, $capabilities->getCapabilities());
@@ -361,28 +361,28 @@ class FileTest extends TestCase {
'expected result' => null
],
"castable string (int)" => [
'HTTP_X_OC_MTIME' => "34",
'expected result' => 34
'HTTP_X_OC_MTIME' => "987654321",
'expected result' => 987654321
],
"castable string (float)" => [
'HTTP_X_OC_MTIME' => "34.56",
'expected result' => 34
'HTTP_X_OC_MTIME' => "123456789.56",
'expected result' => 123456789
],
"float" => [
'HTTP_X_OC_MTIME' => 34.56,
'expected result' => 34
'HTTP_X_OC_MTIME' => 123456789.56,
'expected result' => 123456789
],
"zero" => [
'HTTP_X_OC_MTIME' => 0,
'expected result' => 0
'expected result' => null
],
"zero string" => [
'HTTP_X_OC_MTIME' => "0",
'expected result' => 0
'expected result' => null
],
"negative zero string" => [
'HTTP_X_OC_MTIME' => "-0",
'expected result' => 0
'expected result' => null
],
"string starting with number following by char" => [
'HTTP_X_OC_MTIME' => "2345asdf",
@@ -398,11 +398,11 @@ class FileTest extends TestCase {
],
"negative int" => [
'HTTP_X_OC_MTIME' => -34,
'expected result' => -34
'expected result' => null
],
"negative float" => [
'HTTP_X_OC_MTIME' => -34.43,
'expected result' => -34
'expected result' => null
],
];
}
@@ -421,7 +421,6 @@ class FileTest extends TestCase {
if ($resultMtime === null) {
$this->expectException(\InvalidArgumentException::class);
$this->expectExceptionMessage("X-OC-MTime header must be an integer (unix timestamp).");
}
$this->doPut($file, null, $request);
@@ -447,7 +446,6 @@ class FileTest extends TestCase {
if ($resultMtime === null) {
$this->expectException(\Sabre\DAV\Exception::class);
$this->expectExceptionMessage("X-OC-MTime header must be an integer (unix timestamp).");
}
$this->doPut($file.'-chunking-12345-2-0', null, $request);
@@ -164,8 +164,54 @@ class NodeTest extends \Test\TestCase {
->disableOriginalConstructor()
->getMock();
$node = new \OCA\DAV\Connector\Sabre\File($view, $info);
$node = new \OCA\DAV\Connector\Sabre\File($view, $info);
$this->invokePrivate($node, 'shareManager', [$shareManager]);
$this->assertEquals($expected, $node->getSharePermissions($user));
}
public function sanitizeMtimeProvider() {
return [
[123456789, 123456789],
['987654321', 987654321],
];
}
/**
* @dataProvider sanitizeMtimeProvider
*/
public function testSanitizeMtime($mtime, $expected) {
$view = $this->getMockBuilder(View::class)
->disableOriginalConstructor()
->getMock();
$info = $this->getMockBuilder(FileInfo::class)
->disableOriginalConstructor()
->getMock();
$node = new \OCA\DAV\Connector\Sabre\File($view, $info);
$result = $this->invokePrivate($node, 'sanitizeMtime', [$mtime]);
$this->assertEquals($expected, $result);
}
public function invalidSanitizeMtimeProvider() {
return [
[-1337], [0], ['abcdef'], ['-1337'], ['0'], [12321], [24 * 60 * 60 - 1]
];
}
/**
* @dataProvider invalidSanitizeMtimeProvider
*/
public function testInvalidSanitizeMtime($mtime) {
$this->expectException(\InvalidArgumentException::class);
$view = $this->getMockBuilder(View::class)
->disableOriginalConstructor()
->getMock();
$info = $this->getMockBuilder(FileInfo::class)
->disableOriginalConstructor()
->getMock();
$node = new \OCA\DAV\Connector\Sabre\File($view, $info);
$result = $this->invokePrivate($node, 'sanitizeMtime', [$mtime]);
}
}
+6 -1
View File
@@ -255,7 +255,12 @@ class Notifier implements INotifier {
}
}
$addressBookEntries = $this->contactsManager->search($federatedCloudId, ['CLOUD']);
$addressBookEntries = $this->contactsManager->search($federatedCloudId, ['CLOUD'], [
'limit' => 1,
'enumeration' => false,
'fullmatch' => false,
'strict_search' => true,
]);
foreach ($addressBookEntries as $entry) {
if (isset($entry['CLOUD'])) {
foreach ($entry['CLOUD'] as $cloudID) {
+25 -9
View File
@@ -428,11 +428,6 @@ table {
padding: 0 20px 0 0;
}
}
.uploadtext {
position: absolute;
left: 55px;
}
}
.hide-hidden-files #filestable #fileList tr.hidden-file,
@@ -460,13 +455,22 @@ table td.filename .nametext .innernametext {
/* for smaller resolutions - see mobile.css */
table td.filename .uploadtext {
position: absolute;
font-weight: normal;
margin-left: 55px;
margin-top: 5px;
// checkbox width
margin-left: 50px;
left: 0;
bottom: 0;
height: 20px;
padding: 10px 0;
padding: 0 4px;
// align with file name
padding-left: 1px;
font-size: 11px;
opacity: .5;
// double the font size
line-height: 22px;
color: var(--color-text-maxcontrast);
text-overflow: ellipsis;
white-space: nowrap;
}
table td.selection {
@@ -988,6 +992,18 @@ table.dragshadow td.size {
}
}
.uploadtext {
width: 100%;
margin: 0;
top: 0;
bottom: auto;
// checkbox align
height: 28px;
padding-top: 4px;
// checkbox margins
padding-left: calc(44px - 16px);
}
.name {
height: 100%;
border-radius: var(--border-radius);
+6 -4
View File
@@ -316,7 +316,7 @@
* Event handler for when an app notified that its directory changed
*/
_onDirectoryChanged: function(e) {
if (e.dir) {
if (e.dir && !e.changedThroughUrl) {
this._changeUrl(this.navigation.getActiveItem(), e.dir, e.fileId);
}
},
@@ -386,9 +386,11 @@
params.fileid = fileId;
}
var currentParams = OC.Util.History.parseUrlQuery();
if (currentParams.dir === params.dir && currentParams.view === params.view && currentParams.fileid !== params.fileid) {
// if only fileid changed or was added, replace instead of push
OC.Util.History.replaceState(this._makeUrlParams(params));
if (currentParams.dir === params.dir && currentParams.view === params.view) {
if (currentParams.fileid !== params.fileid) {
// if only fileid changed or was added, replace instead of push
OC.Util.History.replaceState(this._makeUrlParams(params));
}
} else {
OC.Util.History.pushState(this._makeUrlParams(params));
}
+10 -10
View File
File diff suppressed because one or more lines are too long
+1 -1
View File
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
+7 -7
View File
File diff suppressed because one or more lines are too long
+1 -1
View File
File diff suppressed because one or more lines are too long
+50 -12
View File
@@ -322,26 +322,32 @@ OC.FileUpload.prototype = {
);
},
_delete: function() {
if (this.data.isChunked) {
this._deleteChunkFolder()
}
this.deleteUpload();
},
/**
* Abort the upload
*/
abort: function() {
if (this.data.isChunked) {
this._deleteChunkFolder();
if (this.aborted) {
return
}
this.data.abort();
this.deleteUpload();
this.aborted = true;
this._delete();
},
/**
* Fail the upload
*/
fail: function() {
this.deleteUpload();
if (this.data.isChunked) {
this._deleteChunkFolder();
if (this.aborted) {
return
}
this._delete();
},
/**
@@ -679,7 +685,26 @@ OC.Uploader.prototype = _.extend({
return;
}
delete this._uploads[upload.data.uploadId];
// defer as some calls/chunks might still be busy failing, so we need
// the upload info there still
var self = this;
var uploadId = upload.data.uploadId;
// mark as deleted for the progress bar
this._uploads[uploadId].deleted = true;
window.setTimeout(function() {
delete self._uploads[uploadId];
}, 5000)
},
_activeUploadCount: function() {
var count = 0;
for (var key in this._uploads) {
if (!this._uploads[key].deleted) {
count++;
}
}
return count;
},
showUploadCancelMessage: _.debounce(function() {
@@ -905,6 +930,7 @@ OC.Uploader.prototype = _.extend({
if ($uploadEl.exists()) {
this.progressBar.on('cancel', function() {
self.cancelUploads();
self.showUploadCancelMessage();
});
this.fileUploadParam = {
@@ -1075,6 +1101,10 @@ OC.Uploader.prototype = _.extend({
var upload = self.getUpload(data);
var status = null;
if (upload) {
if (upload.aborted) {
// uploads might fail with errors from the server when aborted
return
}
status = upload.getResponseStatus();
}
self.log('fail', e, upload);
@@ -1082,7 +1112,7 @@ OC.Uploader.prototype = _.extend({
self.removeUpload(upload);
if (data.textStatus === 'abort' || data.errorThrown === 'abort') {
self.showUploadCancelMessage();
return
} else if (status === 412) {
// file already exists
self.showConflict(upload);
@@ -1283,6 +1313,10 @@ OC.Uploader.prototype = _.extend({
fileupload.on('fileuploadchunksend', function(e, data) {
// modify the request to adjust it to our own chunking
var upload = self.getUpload(data);
if (!upload) {
// likely cancelled
return
}
var range = data.contentRange.split(' ')[1];
var chunkId = range.split('/')[0].split('-')[0];
data.url = OC.getRootPath() +
@@ -1298,9 +1332,9 @@ OC.Uploader.prototype = _.extend({
self._pendingUploadDoneCount++;
upload.done().then(function() {
upload.done().always(function() {
self._pendingUploadDoneCount--;
if (Object.keys(self._uploads).length === 0 && self._pendingUploadDoneCount === 0) {
if (self._activeUploadCount() === 0 && self._pendingUploadDoneCount === 0) {
// All the uploads ended and there is no pending
// operation, so hide the progress bar.
// Note that this happens here only with chunked
@@ -1314,9 +1348,13 @@ OC.Uploader.prototype = _.extend({
// hides the progress bar in that case).
self._hideProgressBar();
}
}).done(function() {
self.trigger('done', e, upload);
}).fail(function(status, response) {
if (upload.aborted) {
return
}
var message = response.message;
if (status === 507) {
// not enough space
+10 -5
View File
@@ -794,7 +794,7 @@
if( (this._currentDirectory || this.$el.find('#dir').val()) && currentDir === e.dir) {
return;
}
this.changeDirectory(e.dir, false, true);
this.changeDirectory(e.dir, true, true, undefined, true);
}
},
@@ -2057,15 +2057,16 @@
* @param {boolean} [changeUrl=true] if the URL must not be changed (defaults to true)
* @param {boolean} [force=false] set to true to force changing directory
* @param {string} [fileId] optional file id, if known, to be appended in the URL
* @param {bool} [changedThroughUrl=false] true if the dir was set through a URL change
*/
changeDirectory: function(targetDir, changeUrl, force, fileId) {
changeDirectory: function(targetDir, changeUrl, force, fileId, changedThroughUrl) {
var self = this;
var currentDir = this.getCurrentDirectory();
targetDir = targetDir || '/';
if (!force && currentDir === targetDir) {
return;
}
this._setCurrentDir(targetDir, changeUrl, fileId);
this._setCurrentDir(targetDir, changeUrl, fileId, changedThroughUrl);
// discard finished uploads list, we'll get it through a regular reload
this._uploads = {};
@@ -2100,8 +2101,9 @@
* @param targetDir directory to display
* @param changeUrl true to also update the URL, false otherwise (default)
* @param {string} [fileId] file id
* @param {bool} changedThroughUrl true if the dir was set through a URL change
*/
_setCurrentDir: function(targetDir, changeUrl, fileId) {
_setCurrentDir: function(targetDir, changeUrl, fileId, changedThroughUrl) {
targetDir = targetDir.replace(/\\/g, '/');
if (!this._isValidPath(targetDir)) {
targetDir = '/';
@@ -2133,6 +2135,7 @@
if (fileId) {
params.fileId = fileId;
}
params.changedThroughUrl = changedThroughUrl
this.$el.trigger(jQuery.Event('changeDirectory', params));
}
this.breadcrumb.setDirectory(this.getCurrentDirectory());
@@ -2232,7 +2235,9 @@
this.hideMask();
if (status === 401) {
return false;
// We are not authentificated, so reload the page so that we get
// redirected to the login page while saving the current url.
location.reload();
}
// Firewall Blocked request?
+1 -1
View File
@@ -46,7 +46,7 @@
actionHandler: function (fileName, context) {
var fileModel = context.fileInfoModel;
OC.Apps.hideAppSidebar($('.detailsView'));
OCA.Files.App.setActiveView('files');
OCA.Files.App.setActiveView('files', { silent: true });
OCA.Files.App.fileList.changeDirectory(fileModel.get('path'), true, true).then(function() {
OCA.Files.App.fileList.scrollTo(fileModel.get('name'));
});
+6 -1
View File
@@ -560,7 +560,12 @@ class Provider implements IProvider {
return $this->displayNames[$search];
}
$addressBookContacts = $this->contactsManager->search($search, ['CLOUD']);
$addressBookContacts = $this->contactsManager->search($search, ['CLOUD'], [
'limit' => 1,
'enumeration' => false,
'fullmatch' => false,
'strict_search' => true,
]);
foreach ($addressBookContacts as $contact) {
if (isset($contact['isLocalSystemBook'])) {
continue;
+23 -20
View File
@@ -21,6 +21,7 @@
* along with this program. If not, see <http://www.gnu.org/licenses/>
*
*/
namespace OCA\Files\BackgroundJob;
use OC\Files\Utils\Scanner;
@@ -29,7 +30,6 @@ use OCP\EventDispatcher\IEventDispatcher;
use OCP\IConfig;
use OCP\IDBConnection;
use OCP\ILogger;
use OCP\IUserManager;
/**
* Class ScanFiles is a background job used to run the file scanner over the user
@@ -40,8 +40,6 @@ use OCP\IUserManager;
class ScanFiles extends \OC\BackgroundJob\TimedJob {
/** @var IConfig */
private $config;
/** @var IUserManager */
private $userManager;
/** @var IEventDispatcher */
private $dispatcher;
/** @var ILogger */
@@ -53,14 +51,12 @@ class ScanFiles extends \OC\BackgroundJob\TimedJob {
/**
* @param IConfig $config
* @param IUserManager $userManager
* @param IEventDispatcher $dispatcher
* @param ILogger $logger
* @param IDBConnection $connection
*/
public function __construct(
IConfig $config,
IUserManager $userManager,
IEventDispatcher $dispatcher,
ILogger $logger,
IDBConnection $connection
@@ -69,7 +65,6 @@ class ScanFiles extends \OC\BackgroundJob\TimedJob {
$this->setInterval(60 * 10);
$this->config = $config;
$this->userManager = $userManager;
$this->dispatcher = $dispatcher;
$this->logger = $logger;
$this->connection = $connection;
@@ -81,10 +76,10 @@ class ScanFiles extends \OC\BackgroundJob\TimedJob {
protected function runScanner(string $user) {
try {
$scanner = new Scanner(
$user,
null,
$this->dispatcher,
$this->logger
$user,
null,
$this->dispatcher,
$this->logger
);
$scanner->backgroundScan('');
} catch (\Exception $e) {
@@ -94,20 +89,20 @@ class ScanFiles extends \OC\BackgroundJob\TimedJob {
}
/**
* Find all storages which have unindexed files and return a user for each
* Find a storage which have unindexed files and return a user with access to the storage
*
* @return string[]
* @return string|false
*/
private function getUsersToScan(): array {
private function getUserToScan() {
$query = $this->connection->getQueryBuilder();
$query->select($query->func()->max('user_id'))
$query->select('user_id')
->from('filecache', 'f')
->innerJoin('f', 'mounts', 'm', $query->expr()->eq('storage_id', 'storage'))
->where($query->expr()->lt('size', $query->createNamedParameter(0, IQueryBuilder::PARAM_INT)))
->groupBy('storage_id')
->setMaxResults(self::USERS_PER_SESSION);
->andWhere($query->expr()->gt('parent', $query->createNamedParameter(-1, IQueryBuilder::PARAM_INT)))
->setMaxResults(1);
return $query->execute()->fetchAll(\PDO::FETCH_COLUMN);
return $query->execute()->fetchOne();
}
/**
@@ -119,10 +114,18 @@ class ScanFiles extends \OC\BackgroundJob\TimedJob {
return;
}
$users = $this->getUsersToScan();
foreach ($users as $user) {
$usersScanned = 0;
$lastUser = '';
$user = $this->getUserToScan();
while ($user && $usersScanned < self::USERS_PER_SESSION && $lastUser !== $user) {
$this->runScanner($user);
$lastUser = $user;
$user = $this->getUserToScan();
$usersScanned += 1;
}
if ($lastUser === $user) {
$this->logger->warning("User $user still has unscanned files after running background scan, background scan might be stopped prematurely");
}
}
}
+2 -15
View File
@@ -105,15 +105,6 @@ class Scan extends Base {
);
}
public function checkScanWarning($fullPath, OutputInterface $output) {
$normalizedPath = basename(\OC\Files\Filesystem::normalizePath($fullPath));
$path = basename($fullPath);
if ($normalizedPath !== $path) {
$output->writeln("\t<error>Entry \"" . $fullPath . '" will not be accessible due to incompatible encoding</error>');
}
}
protected function scanFiles($user, $path, OutputInterface $output, $backgroundScan = false, $recursive = true, $homeOnly = false) {
$connection = $this->reconnectToDatabase($output);
$scanner = new \OC\Files\Utils\Scanner(
@@ -141,12 +132,8 @@ class Scan extends Base {
$output->writeln('Error while scanning, storage not available (' . $e->getMessage() . ')', OutputInterface::VERBOSITY_VERBOSE);
});
$scanner->listen('\OC\Files\Utils\Scanner', 'scanFile', function ($path) use ($output) {
$this->checkScanWarning($path, $output);
});
$scanner->listen('\OC\Files\Utils\Scanner', 'scanFolder', function ($path) use ($output) {
$this->checkScanWarning($path, $output);
$scanner->listen('\OC\Files\Utils\Scanner', 'normalizedNameMismatch', function ($fullPath) use ($output) {
$output->writeln("\t<error>Entry \"" . $fullPath . '" will not be accessible due to incompatible encoding</error>');
});
try {
+2 -15
View File
@@ -73,15 +73,6 @@ class ScanAppData extends Base {
$this->addArgument('folder', InputArgument::OPTIONAL, 'The appdata subfolder to scan', '');
}
public function checkScanWarning($fullPath, OutputInterface $output) {
$normalizedPath = basename(\OC\Files\Filesystem::normalizePath($fullPath));
$path = basename($fullPath);
if ($normalizedPath !== $path) {
$output->writeln("\t<error>Entry \"" . $fullPath . '" will not be accessible due to incompatible encoding</error>');
}
}
protected function scanFiles(OutputInterface $output, string $folder): int {
try {
$appData = $this->getAppDataFolder();
@@ -124,12 +115,8 @@ class ScanAppData extends Base {
$output->writeln('Error while scanning, storage not available (' . $e->getMessage() . ')', OutputInterface::VERBOSITY_VERBOSE);
});
$scanner->listen('\OC\Files\Utils\Scanner', 'scanFile', function ($path) use ($output) {
$this->checkScanWarning($path, $output);
});
$scanner->listen('\OC\Files\Utils\Scanner', 'scanFolder', function ($path) use ($output) {
$this->checkScanWarning($path, $output);
$scanner->listen('\OC\Files\Utils\Scanner', 'normalizedNameMismatch', function ($fullPath) use ($output) {
$output->writeln("\t<error>Entry \"" . $fullPath . '" will not be accessible due to incompatible encoding</error>');
});
try {
+2 -2
View File
@@ -162,10 +162,10 @@ class ViewController extends Controller {
* @return TemplateResponse|RedirectResponse
* @throws NotFoundException
*/
public function showFile(string $fileid = null): Response {
public function showFile(string $fileid = null, int $openfile = 1): Response {
// This is the entry point from the `/f/{fileid}` URL which is hardcoded in the server.
try {
return $this->redirectToFile($fileid, true);
return $this->redirectToFile($fileid, $openfile !== 0);
} catch (NotFoundException $e) {
return new RedirectResponse($this->urlGenerator->linkToRoute('files.view.index', ['fileNotFound' => true]));
}
@@ -118,13 +118,12 @@ class FilesSearchProvider implements IProvider {
// Generate thumbnail url
$thumbnailUrl = $this->urlGenerator->linkToRouteAbsolute('core.Preview.getPreviewByFileId', ['x' => 32, 'y' => 32, 'fileId' => $result->getId()]);
$path = $userFolder->getRelativePath($result->getPath());
// Use shortened link to centralize the various
// files/folder url redirection in files.View.showFile
$link = $this->urlGenerator->linkToRoute(
'files.view.index',
[
'dir' => dirname($path),
'scrollto' => $result->getName(),
'openfile' => $result->getId(),
]
'files.View.showFile',
['fileid' => $result->getId()]
);
$searchResultEntry = new SearchResultEntry(
+1 -1
View File
@@ -29,7 +29,7 @@ $userSession = \OC::$server->getUserSession();
// TODO: move this to the generated config.js
/** @var IManager $shareManager */
$shareManager = \OC::$server->get(IManager::class);
$publicUploadEnabled = $shareManager->shareApiLinkAllowPublicUpload() ? 'yes' : 'no';;
$publicUploadEnabled = $shareManager->shareApiLinkAllowPublicUpload() ? 'yes' : 'no';
$showgridview = $config->getUserValue($userSession->getUser()->getUID(), 'files', 'show_grid', false);
$isIE = OC_Util::isIe();
+1 -2
View File
@@ -23,8 +23,7 @@
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*
*/
// Check if we are a user
OC_Util::checkLoggedIn();
$config = \OC::$server->getConfig();
$userSession = \OC::$server->getUserSession();
+3
View File
@@ -37,6 +37,9 @@ Object.assign(window.OCA.Files, { Settings: new Settings() })
Object.assign(window.OCA.Files.Settings, { Setting })
window.addEventListener('DOMContentLoaded', function() {
if (window.TESTING) {
return
}
// Init Vue app
// eslint-disable-next-line
new Vue({
+4 -2
View File
@@ -58,5 +58,7 @@ __webpack_public_path__ = generateFilePath('files', '', 'js/')
Vue.prototype.t = t
const View = Vue.extend(PersonalSettings)
new View().$mount('#files-personal-settings')
if (!window.TESTING) {
const View = Vue.extend(PersonalSettings)
new View().$mount('#files-personal-settings')
}
+5 -2
View File
@@ -213,8 +213,11 @@ export default {
)
this.logger.debug('Created new file', fileInfo)
await fileList?.addAndFetchFileInfo(this.name)
const data = await fileList?.addAndFetchFileInfo(this.name).then((status, data) => data)
const model = new OCA.Files.FileInfoModel(data, {
filesClient: fileList?.filesClient,
})
// Run default action
const fileAction = OCA.Files.fileActions.getDefaultFileAction(fileInfo.mime, 'file', OC.PERMISSION_ALL)
fileAction.action(fileInfo.basename, {
@@ -222,7 +225,7 @@ export default {
dir: currentDirectory,
fileList,
fileActions: fileList?.fileActions,
fileInfoModel: fileList?.getModelForFile(this.name),
fileInfoModel: model,
})
this.close()
@@ -30,7 +30,6 @@ use OCP\EventDispatcher\IEventDispatcher;
use OCP\IConfig;
use OCP\ILogger;
use OCP\IUser;
use OCP\IUserManager;
use Test\TestCase;
use Test\Traits\MountProviderTrait;
use Test\Traits\UserTrait;
@@ -54,7 +53,6 @@ class ScanFilesTest extends TestCase {
parent::setUp();
$config = $this->createMock(IConfig::class);
$userManager = $this->createMock(IUserManager::class);
$dispatcher = $this->createMock(IEventDispatcher::class);
$logger = $this->createMock(ILogger::class);
$connection = \OC::$server->getDatabaseConnection();
@@ -63,7 +61,6 @@ class ScanFilesTest extends TestCase {
$this->scanFiles = $this->getMockBuilder('\OCA\Files\BackgroundJob\ScanFiles')
->setConstructorArgs([
$config,
$userManager,
$dispatcher,
$logger,
$connection,
+2
View File
@@ -5,6 +5,8 @@ icewind/smb/install_libsmbclient.sh
icewind/smb/Makefile
icewind/smb/.travis.yml
icewind/smb/.scrutinizer.yml
icewind/smb/example-apache-kerberos.php
icewind/smb/codecov.yml
icewind/streams/tests
.github
.php_cs*
+1 -1
View File
@@ -9,6 +9,6 @@
},
"require": {
"icewind/streams": "0.7.4",
"icewind/smb": "3.4.1"
"icewind/smb": "3.5.2"
}
}
+8 -8
View File
@@ -4,20 +4,20 @@
"Read more about it at https://getcomposer.org/doc/01-basic-usage.md#installing-dependencies",
"This file is @generated automatically"
],
"content-hash": "0ffc772b2aaaaffe52decb8d13361976",
"content-hash": "524c99fd87297e01d004eb5a4e53b04c",
"packages": [
{
"name": "icewind/smb",
"version": "v3.4.1",
"version": "v3.5.2",
"source": {
"type": "git",
"url": "https://github.com/icewind1991/SMB.git",
"reference": "9dba42ab2a3990de29e18cc62b0a8270aceb74e3"
"reference": "0a425bd21acf7ae112b135dca34640e1b1a825c3"
},
"dist": {
"type": "zip",
"url": "https://api.github.com/repos/icewind1991/SMB/zipball/9dba42ab2a3990de29e18cc62b0a8270aceb74e3",
"reference": "9dba42ab2a3990de29e18cc62b0a8270aceb74e3",
"url": "https://api.github.com/repos/icewind1991/SMB/zipball/0a425bd21acf7ae112b135dca34640e1b1a825c3",
"reference": "0a425bd21acf7ae112b135dca34640e1b1a825c3",
"shasum": ""
},
"require": {
@@ -49,9 +49,9 @@
"description": "php wrapper for smbclient and libsmbclient-php",
"support": {
"issues": "https://github.com/icewind1991/SMB/issues",
"source": "https://github.com/icewind1991/SMB/tree/v3.4.1"
"source": "https://github.com/icewind1991/SMB/tree/v3.5.2"
},
"time": "2021-04-19T13:53:08+00:00"
"time": "2022-01-20T14:51:51+00:00"
},
{
"name": "icewind/streams",
@@ -107,5 +107,5 @@
"prefer-lowest": false,
"platform": [],
"platform-dev": [],
"plugin-api-version": "2.1.0"
"plugin-api-version": "2.2.0"
}
+102 -11
View File
@@ -42,30 +42,75 @@ namespace Composer\Autoload;
*/
class ClassLoader
{
/** @var ?string */
private $vendorDir;
// PSR-4
/**
* @var array[]
* @psalm-var array<string, array<string, int>>
*/
private $prefixLengthsPsr4 = array();
/**
* @var array[]
* @psalm-var array<string, array<int, string>>
*/
private $prefixDirsPsr4 = array();
/**
* @var array[]
* @psalm-var array<string, string>
*/
private $fallbackDirsPsr4 = array();
// PSR-0
/**
* @var array[]
* @psalm-var array<string, array<string, string[]>>
*/
private $prefixesPsr0 = array();
/**
* @var array[]
* @psalm-var array<string, string>
*/
private $fallbackDirsPsr0 = array();
/** @var bool */
private $useIncludePath = false;
/**
* @var string[]
* @psalm-var array<string, string>
*/
private $classMap = array();
/** @var bool */
private $classMapAuthoritative = false;
/**
* @var bool[]
* @psalm-var array<string, bool>
*/
private $missingClasses = array();
/** @var ?string */
private $apcuPrefix;
/**
* @var self[]
*/
private static $registeredLoaders = array();
/**
* @param ?string $vendorDir
*/
public function __construct($vendorDir = null)
{
$this->vendorDir = $vendorDir;
}
/**
* @return string[]
*/
public function getPrefixes()
{
if (!empty($this->prefixesPsr0)) {
@@ -75,28 +120,47 @@ class ClassLoader
return array();
}
/**
* @return array[]
* @psalm-return array<string, array<int, string>>
*/
public function getPrefixesPsr4()
{
return $this->prefixDirsPsr4;
}
/**
* @return array[]
* @psalm-return array<string, string>
*/
public function getFallbackDirs()
{
return $this->fallbackDirsPsr0;
}
/**
* @return array[]
* @psalm-return array<string, string>
*/
public function getFallbackDirsPsr4()
{
return $this->fallbackDirsPsr4;
}
/**
* @return string[] Array of classname => path
* @psalm-return array<string, string>
*/
public function getClassMap()
{
return $this->classMap;
}
/**
* @param array $classMap Class to filename map
* @param string[] $classMap Class to filename map
* @psalm-param array<string, string> $classMap
*
* @return void
*/
public function addClassMap(array $classMap)
{
@@ -111,9 +175,11 @@ class ClassLoader
* Registers a set of PSR-0 directories for a given prefix, either
* appending or prepending to the ones previously set for this prefix.
*
* @param string $prefix The prefix
* @param array|string $paths The PSR-0 root directories
* @param bool $prepend Whether to prepend the directories
* @param string $prefix The prefix
* @param string[]|string $paths The PSR-0 root directories
* @param bool $prepend Whether to prepend the directories
*
* @return void
*/
public function add($prefix, $paths, $prepend = false)
{
@@ -156,11 +222,13 @@ class ClassLoader
* Registers a set of PSR-4 directories for a given namespace, either
* appending or prepending to the ones previously set for this namespace.
*
* @param string $prefix The prefix/namespace, with trailing '\\'
* @param array|string $paths The PSR-4 base directories
* @param bool $prepend Whether to prepend the directories
* @param string $prefix The prefix/namespace, with trailing '\\'
* @param string[]|string $paths The PSR-4 base directories
* @param bool $prepend Whether to prepend the directories
*
* @throws \InvalidArgumentException
*
* @return void
*/
public function addPsr4($prefix, $paths, $prepend = false)
{
@@ -204,8 +272,10 @@ class ClassLoader
* Registers a set of PSR-0 directories for a given prefix,
* replacing any others previously set for this prefix.
*
* @param string $prefix The prefix
* @param array|string $paths The PSR-0 base directories
* @param string $prefix The prefix
* @param string[]|string $paths The PSR-0 base directories
*
* @return void
*/
public function set($prefix, $paths)
{
@@ -220,10 +290,12 @@ class ClassLoader
* Registers a set of PSR-4 directories for a given namespace,
* replacing any others previously set for this namespace.
*
* @param string $prefix The prefix/namespace, with trailing '\\'
* @param array|string $paths The PSR-4 base directories
* @param string $prefix The prefix/namespace, with trailing '\\'
* @param string[]|string $paths The PSR-4 base directories
*
* @throws \InvalidArgumentException
*
* @return void
*/
public function setPsr4($prefix, $paths)
{
@@ -243,6 +315,8 @@ class ClassLoader
* Turns on searching the include path for class files.
*
* @param bool $useIncludePath
*
* @return void
*/
public function setUseIncludePath($useIncludePath)
{
@@ -265,6 +339,8 @@ class ClassLoader
* that have not been registered with the class map.
*
* @param bool $classMapAuthoritative
*
* @return void
*/
public function setClassMapAuthoritative($classMapAuthoritative)
{
@@ -285,6 +361,8 @@ class ClassLoader
* APCu prefix to use to cache found/not-found classes, if the extension is enabled.
*
* @param string|null $apcuPrefix
*
* @return void
*/
public function setApcuPrefix($apcuPrefix)
{
@@ -305,6 +383,8 @@ class ClassLoader
* Registers this instance as an autoloader.
*
* @param bool $prepend Whether to prepend the autoloader or not
*
* @return void
*/
public function register($prepend = false)
{
@@ -324,6 +404,8 @@ class ClassLoader
/**
* Unregisters this instance as an autoloader.
*
* @return void
*/
public function unregister()
{
@@ -403,6 +485,11 @@ class ClassLoader
return self::$registeredLoaders;
}
/**
* @param string $class
* @param string $ext
* @return string|false
*/
private function findFileWithExtension($class, $ext)
{
// PSR-4 lookup
@@ -474,6 +561,10 @@ class ClassLoader
* Scope isolated include.
*
* Prevents access to $this/self from included files.
*
* @param string $file
* @return void
* @private
*/
function includeFile($file)
{
+19 -6
View File
@@ -20,12 +20,25 @@ use Composer\Semver\VersionParser;
*
* See also https://getcomposer.org/doc/07-runtime.md#installed-versions
*
* To require it's presence, you can require `composer-runtime-api ^2.0`
* To require its presence, you can require `composer-runtime-api ^2.0`
*/
class InstalledVersions
{
/**
* @var mixed[]|null
* @psalm-var array{root: array{name: string, version: string, reference: string, pretty_version: string, aliases: string[], dev: bool, install_path: string, type: string}, versions: array<string, array{dev_requirement: bool, pretty_version?: string, version?: string, aliases?: string[], reference?: string, replaced?: string[], provided?: string[], install_path?: string, type?: string}>}|array{}|null
*/
private static $installed;
/**
* @var bool|null
*/
private static $canGetVendors;
/**
* @var array[]
* @psalm-var array<string, array{root: array{name: string, version: string, reference: string, pretty_version: string, aliases: string[], dev: bool, install_path: string, type: string}, versions: array<string, array{dev_requirement: bool, pretty_version?: string, version?: string, aliases?: string[], reference?: string, replaced?: string[], provided?: string[], install_path?: string, type?: string}>}>
*/
private static $installedByVendor = array();
/**
@@ -228,7 +241,7 @@ class InstalledVersions
/**
* @return array
* @psalm-return array{name: string, version: string, reference: string, pretty_version: string, aliases: string[], dev: bool, install_path: string}
* @psalm-return array{name: string, version: string, reference: string, pretty_version: string, aliases: string[], dev: bool, install_path: string, type: string}
*/
public static function getRootPackage()
{
@@ -242,7 +255,7 @@ class InstalledVersions
*
* @deprecated Use getAllRawData() instead which returns all datasets for all autoloaders present in the process. getRawData only returns the first dataset loaded, which may not be what you expect.
* @return array[]
* @psalm-return array{root: array{name: string, version: string, reference: string, pretty_version: string, aliases: string[], dev: bool, install_path: string}, versions: array<string, array{dev_requirement: bool, pretty_version?: string, version?: string, aliases?: string[], reference?: string, replaced?: string[], provided?: string[], install_path?: string}>}
* @psalm-return array{root: array{name: string, version: string, reference: string, pretty_version: string, aliases: string[], dev: bool, install_path: string, type: string}, versions: array<string, array{dev_requirement: bool, pretty_version?: string, version?: string, aliases?: string[], reference?: string, replaced?: string[], provided?: string[], install_path?: string, type?: string}>}
*/
public static function getRawData()
{
@@ -265,7 +278,7 @@ class InstalledVersions
* Returns the raw data of all installed.php which are currently loaded for custom implementations
*
* @return array[]
* @psalm-return list<array{root: array{name: string, version: string, reference: string, pretty_version: string, aliases: string[], dev: bool, install_path: string}, versions: array<string, array{dev_requirement: bool, pretty_version?: string, version?: string, aliases?: string[], reference?: string, replaced?: string[], provided?: string[], install_path?: string}>}>
* @psalm-return list<array{root: array{name: string, version: string, reference: string, pretty_version: string, aliases: string[], dev: bool, install_path: string, type: string}, versions: array<string, array{dev_requirement: bool, pretty_version?: string, version?: string, aliases?: string[], reference?: string, replaced?: string[], provided?: string[], install_path?: string, type?: string}>}>
*/
public static function getAllRawData()
{
@@ -288,7 +301,7 @@ class InstalledVersions
* @param array[] $data A vendor/composer/installed.php data set
* @return void
*
* @psalm-param array{root: array{name: string, version: string, reference: string, pretty_version: string, aliases: string[], dev: bool, install_path: string}, versions: array<string, array{dev_requirement: bool, pretty_version?: string, version?: string, aliases?: string[], reference?: string, replaced?: string[], provided?: string[], install_path?: string}>} $data
* @psalm-param array{root: array{name: string, version: string, reference: string, pretty_version: string, aliases: string[], dev: bool, install_path: string, type: string}, versions: array<string, array{dev_requirement: bool, pretty_version?: string, version?: string, aliases?: string[], reference?: string, replaced?: string[], provided?: string[], install_path?: string, type?: string}>} $data
*/
public static function reload($data)
{
@@ -298,7 +311,7 @@ class InstalledVersions
/**
* @return array[]
* @psalm-return list<array{root: array{name: string, version: string, reference: string, pretty_version: string, aliases: string[], dev: bool, install_path: string}, versions: array<string, array{dev_requirement: bool, pretty_version?: string, version?: string, aliases?: string[], reference?: string, replaced?: string[], provided?: string[], install_path?: string}>}>
* @psalm-return list<array{root: array{name: string, version: string, reference: string, pretty_version: string, aliases: string[], dev: bool, install_path: string, type: string}, versions: array<string, array{dev_requirement: bool, pretty_version?: string, version?: string, aliases?: string[], reference?: string, replaced?: string[], provided?: string[], install_path?: string, type?: string}>}>
*/
private static function getInstalled()
{
@@ -48,6 +48,7 @@ return array(
'Icewind\\SMB\\IShare' => $vendorDir . '/icewind/smb/src/IShare.php',
'Icewind\\SMB\\ISystem' => $vendorDir . '/icewind/smb/src/ISystem.php',
'Icewind\\SMB\\ITimeZoneProvider' => $vendorDir . '/icewind/smb/src/ITimeZoneProvider.php',
'Icewind\\SMB\\KerberosApacheAuth' => $vendorDir . '/icewind/smb/src/KerberosApacheAuth.php',
'Icewind\\SMB\\KerberosAuth' => $vendorDir . '/icewind/smb/src/KerberosAuth.php',
'Icewind\\SMB\\Native\\NativeFileInfo' => $vendorDir . '/icewind/smb/src/Native/NativeFileInfo.php',
'Icewind\\SMB\\Native\\NativeReadStream' => $vendorDir . '/icewind/smb/src/Native/NativeReadStream.php',
@@ -68,6 +68,7 @@ class ComposerStaticInit98fe9b281934250b3a93f69a5ce843b3
'Icewind\\SMB\\IShare' => __DIR__ . '/..' . '/icewind/smb/src/IShare.php',
'Icewind\\SMB\\ISystem' => __DIR__ . '/..' . '/icewind/smb/src/ISystem.php',
'Icewind\\SMB\\ITimeZoneProvider' => __DIR__ . '/..' . '/icewind/smb/src/ITimeZoneProvider.php',
'Icewind\\SMB\\KerberosApacheAuth' => __DIR__ . '/..' . '/icewind/smb/src/KerberosApacheAuth.php',
'Icewind\\SMB\\KerberosAuth' => __DIR__ . '/..' . '/icewind/smb/src/KerberosAuth.php',
'Icewind\\SMB\\Native\\NativeFileInfo' => __DIR__ . '/..' . '/icewind/smb/src/Native/NativeFileInfo.php',
'Icewind\\SMB\\Native\\NativeReadStream' => __DIR__ . '/..' . '/icewind/smb/src/Native/NativeReadStream.php',
+7 -7
View File
@@ -2,17 +2,17 @@
"packages": [
{
"name": "icewind/smb",
"version": "v3.4.1",
"version_normalized": "3.4.1.0",
"version": "v3.5.2",
"version_normalized": "3.5.2.0",
"source": {
"type": "git",
"url": "https://github.com/icewind1991/SMB.git",
"reference": "9dba42ab2a3990de29e18cc62b0a8270aceb74e3"
"reference": "0a425bd21acf7ae112b135dca34640e1b1a825c3"
},
"dist": {
"type": "zip",
"url": "https://api.github.com/repos/icewind1991/SMB/zipball/9dba42ab2a3990de29e18cc62b0a8270aceb74e3",
"reference": "9dba42ab2a3990de29e18cc62b0a8270aceb74e3",
"url": "https://api.github.com/repos/icewind1991/SMB/zipball/0a425bd21acf7ae112b135dca34640e1b1a825c3",
"reference": "0a425bd21acf7ae112b135dca34640e1b1a825c3",
"shasum": ""
},
"require": {
@@ -25,7 +25,7 @@
"phpunit/phpunit": "^8.5|^9.3.8",
"psalm/phar": "^4.3"
},
"time": "2021-04-19T13:53:08+00:00",
"time": "2022-01-20T14:51:51+00:00",
"type": "library",
"installation-source": "dist",
"autoload": {
@@ -46,7 +46,7 @@
"description": "php wrapper for smbclient and libsmbclient-php",
"support": {
"issues": "https://github.com/icewind1991/SMB/issues",
"source": "https://github.com/icewind1991/SMB/tree/v3.4.1"
"source": "https://github.com/icewind1991/SMB/tree/v3.5.2"
},
"install-path": "../icewind/smb"
},
+5 -5
View File
@@ -5,7 +5,7 @@
'type' => 'library',
'install_path' => __DIR__ . '/../',
'aliases' => array(),
'reference' => '70483a16a3a232758979bb6fa363629b5a16b6a4',
'reference' => '0bed61f949bc7a8c69cd154919e78b704e28c99e',
'name' => 'files_external/3rdparty',
'dev' => true,
),
@@ -16,16 +16,16 @@
'type' => 'library',
'install_path' => __DIR__ . '/../',
'aliases' => array(),
'reference' => '70483a16a3a232758979bb6fa363629b5a16b6a4',
'reference' => '0bed61f949bc7a8c69cd154919e78b704e28c99e',
'dev_requirement' => false,
),
'icewind/smb' => array(
'pretty_version' => 'v3.4.1',
'version' => '3.4.1.0',
'pretty_version' => 'v3.5.2',
'version' => '3.5.2.0',
'type' => 'library',
'install_path' => __DIR__ . '/../icewind/smb',
'aliases' => array(),
'reference' => '9dba42ab2a3990de29e18cc62b0a8270aceb74e3',
'reference' => '0a425bd21acf7ae112b135dca34640e1b1a825c3',
'dev_requirement' => false,
),
'icewind/streams' => array(
+30 -1
View File
@@ -44,13 +44,42 @@ $server = $serverFactory->createServer('localhost', $auth);
### Using kerberos authentication ###
There are two ways of using kerberos to authenticate against the smb server:
- Using a ticket from the php server
- Re-using a ticket send by the client
### Using a server ticket
Using a server ticket allows the web server to authenticate against the smb server using an existing machine account.
The ticket needs to be available in the environment of the php process.
```php
$serverFactory = new ServerFactory();
$auth = new KerberosAuth();
$server = $serverFactory->createServer('localhost', $auth);
```
Note that this requires a valid kerberos ticket to already be available for php
### Re-using a client ticket
By re-using a client ticket you can create a single sign-on setup where the user authenticates against
the web service using kerberos. And the web server can forward that ticket to the smb server, allowing it
to act on the behalf of the user without requiring the user to enter his passord.
The setup for such a system is fairly involved and requires roughly the following this
- The web server is authenticated against kerberos with a machine account
- Delegation is enabled for the web server's machine account
- Apache is setup to perform kerberos authentication and save the ticket in it's environment
- Php has the krb5 extension installed
- The client authenticates using a ticket with forwarding enabled
```php
$serverFactory = new ServerFactory();
$auth = new KerberosApacheAuth();
$server = $serverFactory->createServer('localhost', $auth);
```
### Upload a file ###
+1 -1
View File
@@ -45,7 +45,7 @@ interface IShare {
public function put(string $source, string $target): bool;
/**
* Open a readable stream top a remote file
* Open a readable stream to a remote file
*
* @param string $source
* @return resource a read only stream with the contents of the remote file
@@ -0,0 +1,136 @@
<?php
/**
* @copyright Copyright (c) 2018 Robin Appelman <robin@icewind.nl>
*
* @license GNU AGPL version 3 or any later version
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU Affero General Public License as
* published by the Free Software Foundation, either version 3 of the
* License, or (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU Affero General Public License for more details.
*
* You should have received a copy of the GNU Affero General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*
*/
namespace Icewind\SMB;
use Icewind\SMB\Exception\DependencyException;
use Icewind\SMB\Exception\Exception;
/**
* Use existing kerberos ticket to authenticate and reuse the apache ticket cache (mod_auth_kerb)
*/
class KerberosApacheAuth extends KerberosAuth implements IAuth {
/** @var string */
private $ticketPath = "";
/** @var bool */
private $init = false;
/** @var string|false */
private $ticketName;
public function __construct() {
$this->ticketName = getenv("KRB5CCNAME");
}
/**
* Copy the ticket to a temporary location and use that ticket for authentication
*
* @return void
*/
public function copyTicket(): void {
if (!$this->checkTicket()) {
return;
}
$krb5 = new \KRB5CCache();
$krb5->open($this->ticketName);
$tmpFilename = tempnam("/tmp", "krb5cc_php_");
$tmpCacheFile = "FILE:" . $tmpFilename;
$krb5->save($tmpCacheFile);
$this->ticketPath = $tmpFilename;
$this->ticketName = $tmpCacheFile;
}
/**
* Pass the ticket to smbclient by memory instead of path
*
* @return void
*/
public function passTicketFromMemory(): void {
if (!$this->checkTicket()) {
return;
}
$krb5 = new \KRB5CCache();
$krb5->open($this->ticketName);
$this->ticketName = (string)$krb5->getName();
}
/**
* Check if a valid kerberos ticket is present
*
* @return bool
* @psalm-assert-if-true string $this->ticketName
*/
public function checkTicket(): bool {
//read apache kerberos ticket cache
if (!$this->ticketName) {
return false;
}
$krb5 = new \KRB5CCache();
$krb5->open($this->ticketName);
/** @psalm-suppress MixedArgument */
return count($krb5->getEntries()) > 0;
}
private function init(): void {
if ($this->init) {
return;
}
$this->init = true;
// inspired by https://git.typo3.org/TYPO3CMS/Extensions/fal_cifs.git
if (!extension_loaded("krb5")) {
// https://pecl.php.net/package/krb5
throw new DependencyException('Ensure php-krb5 is installed.');
}
//read apache kerberos ticket cache
if (!$this->checkTicket()) {
throw new Exception('No kerberos ticket cache environment variable (KRB5CCNAME) found.');
}
// note that even if the ticketname is the value we got from `getenv("KRB5CCNAME")` we still need to set the env variable ourselves
// this is because `getenv` also reads the variables passed from the SAPI (apache-php) and we need to set the variable in the OS's env
putenv("KRB5CCNAME=" . $this->ticketName);
}
public function getExtraCommandLineArguments(): string {
$this->init();
return parent::getExtraCommandLineArguments();
}
public function setExtraSmbClientOptions($smbClientState): void {
$this->init();
try {
parent::setExtraSmbClientOptions($smbClientState);
} catch (Exception $e) {
// suppress
}
}
public function __destruct() {
if (!empty($this->ticketPath) && file_exists($this->ticketPath) && is_file($this->ticketPath)) {
unlink($this->ticketPath);
}
}
}
@@ -99,7 +99,7 @@ class NativeFileInfo implements IFileInfo {
public function isDirectory(): bool {
$mode = $this->getMode();
if ($mode > 0x1000) {
return (bool)($mode & 0x4000); // 0x4000: unix directory flag
return ($mode & 0x4000 && !($mode & 0x8000)); // 0x4000: unix directory flag shares bits with 0xC000: socket
} else {
return (bool)($mode & IFileInfo::MODE_DIRECTORY);
}
@@ -267,14 +267,14 @@ class NativeShare extends AbstractShare {
* Open a writeable stream to a remote file
* Note: This method will truncate the file to 0bytes first
*
* @param string $source
* @param string $target
* @return resource a writeable stream
*
* @throws NotFoundException
* @throws InvalidTypeException
*/
public function write(string $source) {
$url = $this->buildUrl($source);
public function write(string $target) {
$url = $this->buildUrl($target);
$handle = $this->getState()->create($url);
return NativeWriteStream::wrap($this->getState(), $handle, 'w', $url);
}
@@ -282,14 +282,14 @@ class NativeShare extends AbstractShare {
/**
* Open a writeable stream and set the cursor to the end of the stream
*
* @param string $source
* @param string $target
* @return resource a writeable stream
*
* @throws NotFoundException
* @throws InvalidTypeException
*/
public function append(string $source) {
$url = $this->buildUrl($source);
public function append(string $target) {
$url = $this->buildUrl($target);
$handle = $this->getState()->open($url, "a+");
return NativeWriteStream::wrap($this->getState(), $handle, "a", $url);
}
@@ -38,6 +38,14 @@ class NativeState {
/** @var bool */
protected $connected = false;
/**
* sync the garbage collection cycle
* __deconstruct() of KerberosAuth should not called too soon
*
* @var IAuth|null $auth
*/
protected $auth = null;
// see error.h
const EXCEPTION_MAP = [
1 => ForbiddenException::class,
@@ -107,6 +115,11 @@ class NativeState {
}
$auth->setExtraSmbClientOptions($this->state);
// sync the garbage collection cycle
// __deconstruct() of KerberosAuth should not caled too soon
$this->auth = $auth;
/** @var bool $result */
$result = @smbclient_state_init($this->state, $auth->getWorkgroup(), $auth->getUsername(), $auth->getPassword());
+1 -1
View File
@@ -62,7 +62,7 @@ class System implements ISystem {
$result = null;
$output = [];
exec("which $binary 2>&1", $output, $result);
$this->paths[$binary] = $result === 0 ? trim(implode('', $output)) : null;
$this->paths[$binary] = $result === 0 && isset($output[0]) ? (string)$output[0] : null;
}
return $this->paths[$binary];
}
@@ -47,7 +47,7 @@ class Connection extends RawConnection {
public function clearTillPrompt(): void {
$this->write('');
do {
$promptLine = $this->readLine();
$promptLine = $this->readTillPrompt();
if ($promptLine === false) {
break;
}
@@ -56,13 +56,12 @@ class Connection extends RawConnection {
if ($this->write('') === false) {
throw new ConnectionRefusedException();
}
$this->readLine();
$this->readTillPrompt();
}
/**
* get all unprocessed output from smbclient until the next prompt
*
* @param (callable(string):bool)|null $callback (optional) callback to call for every line read
* @return string[]
* @throws AuthenticationException
* @throws ConnectException
@@ -71,42 +70,22 @@ class Connection extends RawConnection {
* @throws NoLoginServerException
* @throws AccessDeniedException
*/
public function read(callable $callback = null): array {
public function read(): array {
if (!$this->isValid()) {
throw new ConnectionException('Connection not valid');
}
$promptLine = $this->readLine(); //first line is prompt
if ($promptLine === false) {
$this->unknownError($promptLine);
}
$this->parser->checkConnectionError($promptLine);
$output = [];
if (!$this->isPrompt($promptLine)) {
$line = $promptLine;
} else {
$line = $this->readLine();
}
if ($line === false) {
$this->unknownError($promptLine);
}
while ($line !== false && !$this->isPrompt($line)) { //next prompt functions as delimiter
if (is_callable($callback)) {
$result = $callback($line);
if ($result === false) { // allow the callback to close the connection for infinite running commands
$this->close(true);
break;
}
} else {
$output[] = $line;
}
$line = $this->readLine();
$output = $this->readTillPrompt();
if ($output === false) {
$this->unknownError(false);
}
$output = explode("\n", $output);
// last line contains the prompt
array_pop($output);
return $output;
}
private function isPrompt(string $line): bool {
return mb_substr($line, 0, self::DELIMITER_LENGTH) === self::DELIMITER;
return substr($line, 0, self::DELIMITER_LENGTH) === self::DELIMITER;
}
/**
@@ -132,6 +111,6 @@ class Connection extends RawConnection {
// ignore any errors while trying to send the close command, the process might already be dead
@$this->write('close' . PHP_EOL);
}
parent::close($terminate);
$this->close_process($terminate);
}
}
@@ -65,16 +65,20 @@ class NotifyHandler implements INotifyHandler {
*/
public function listen(callable $callback): void {
if ($this->listening) {
$this->connection->read(function (string $line) use ($callback): bool {
while (true) {
$line = $this->connection->readLine();
if ($line === false) {
break;
}
$this->checkForError($line);
$change = $this->parseChangeLine($line);
if ($change) {
$result = $callback($change);
return $result === false ? false : true;
} else {
return true;
if ($result === false) {
break;
}
}
});
};
}
}
@@ -71,7 +71,8 @@ class RawConnection {
setlocale(LC_ALL, Server::LOCALE);
$env = array_merge($this->env, [
'CLI_FORCE_INTERACTIVE' => 'y', // Needed or the prompt isn't displayed!!
'CLI_FORCE_INTERACTIVE' => 'y', // Make sure the prompt is displayed
'CLI_NO_READLINE' => 1, // Not all distros build smbclient with readline, disable it to get consistent behaviour
'LC_ALL' => Server::LOCALE,
'LANG' => Server::LOCALE,
'COLUMNS' => 8192 // prevent smbclient from line-wrapping it's output
@@ -91,7 +92,7 @@ class RawConnection {
public function isValid(): bool {
if (is_resource($this->process)) {
$status = proc_get_status($this->process);
return (bool)$status['running'];
return $status['running'];
} else {
return false;
}
@@ -109,13 +110,30 @@ class RawConnection {
return $result;
}
/**
* read output till the next prompt
*
* @return string|false
*/
public function readTillPrompt() {
$output = "";
do {
$chunk = $this->readLine('\> ');
if ($chunk === false) {
return false;
}
$output .= $chunk;
} while (strlen($chunk) == 4096 && strpos($chunk, "smb:") === false);
return $output;
}
/**
* read a line of output
*
* @return string|false
*/
public function readLine() {
return stream_get_line($this->getOutputStream(), 4086, "\n");
public function readLine(string $end = "\n") {
return stream_get_line($this->getOutputStream(), 4096, $end);
}
/**
@@ -202,6 +220,14 @@ class RawConnection {
* @psalm-assert null $this->process
*/
public function close(bool $terminate = true): void {
$this->close_process($terminate);
}
/**
* @param bool $terminate
* @psalm-assert null $this->process
*/
protected function close_process(bool $terminate = true): void {
if (!is_resource($this->process)) {
return;
}
@@ -345,11 +345,17 @@ class Share extends AbstractShare {
// since returned stream is closed by the caller we need to create a new instance
// since we can't re-use the same file descriptor over multiple calls
$connection = $this->getConnection();
stream_set_blocking($connection->getOutputStream(), false);
$connection->write('get ' . $source . ' ' . $this->system->getFD(5));
$connection->write('exit');
$fh = $connection->getFileOutputStream();
stream_context_set_option($fh, 'file', 'connection', $connection);
$fh = CallbackWrapper::wrap($fh, function() use ($connection) {
$connection->write('');
});
if (!is_resource($fh)) {
throw new Exception("Failed to wrap file output");
}
return $fh;
}
@@ -374,7 +380,9 @@ class Share extends AbstractShare {
// use a close callback to ensure the upload is finished before continuing
// this also serves as a way to keep the connection in scope
$stream = CallbackWrapper::wrap($fh, null, null, function () use ($connection) {
$stream = CallbackWrapper::wrap($fh, function() use ($connection) {
$connection->write('');
}, null, function () use ($connection) {
$connection->close(false); // dont terminate, give the upload some time
});
if (is_resource($stream)) {
@@ -446,7 +454,7 @@ class Share extends AbstractShare {
* @return string[]
*/
protected function execute(string $command): array {
$this->connect()->write($command . PHP_EOL);
$this->connect()->write($command);
return $this->connect()->read();
}
-5
View File
@@ -1,8 +1,3 @@
#filestable tbody tr.externalDisabledRow {
background-color: #CCC;
}
#filestable tbody tr.externalErroredRow {
background-color: #F2DEDE;
}
-3
View File
@@ -254,8 +254,6 @@ OCA.Files_External.StatusManager = {
OCA.Files_External.StatusManager.Utils.changeFolderIcon(elementList);
// Save default view
OCA.Files_External.StatusManager.Utils.storeDefaultFolderIconAndBgcolor(elementList);
// Disable row until check status
elementList.addClass('externalDisabledRow');
OCA.Files_External.StatusManager.Utils.toggleLink(elementList.find('a.name'), false, false);
}
}
@@ -505,7 +503,6 @@ OCA.Files_External.StatusManager.Utils = {
// can't use here FileList.findFileEl(OCA.Files_External.StatusManager.Utils.jqSelEscape(folder)); return incorrect instance of filelist
trFolder = $('#fileList tr[data-file=\"' + OCA.Files_External.StatusManager.Utils.jqSelEscape(folder) + '\"]');
}
trFolder.removeClass('externalErroredRow').removeClass('externalDisabledRow');
var tdChilds = trFolder.find("td.filename div.thumbnail");
tdChilds.each(function () {
var thisElement = $(this);
+31 -29
View File
@@ -31,8 +31,6 @@ namespace OCA\Files_External\AppInfo;
use OCA\Files_External\Config\ConfigAdapter;
use OCA\Files_External\Config\UserPlaceholderHandler;
use OCA\Files_External\Listener\GroupDeletedListener;
use OCA\Files_External\Listener\UserDeletedListener;
use OCA\Files_External\Lib\Auth\AmazonS3\AccessKey;
use OCA\Files_External\Lib\Auth\Builtin;
use OCA\Files_External\Lib\Auth\NullMechanism;
@@ -49,6 +47,7 @@ use OCA\Files_External\Lib\Auth\Password\UserGlobalAuth;
use OCA\Files_External\Lib\Auth\Password\UserProvided;
use OCA\Files_External\Lib\Auth\PublicKey\RSA;
use OCA\Files_External\Lib\Auth\PublicKey\RSAPrivateKey;
use OCA\Files_External\Lib\Auth\SMB\KerberosApacheAuth;
use OCA\Files_External\Lib\Auth\SMB\KerberosAuth;
use OCA\Files_External\Lib\Backend\AmazonS3;
use OCA\Files_External\Lib\Backend\DAV;
@@ -62,6 +61,8 @@ use OCA\Files_External\Lib\Backend\SMB_OC;
use OCA\Files_External\Lib\Backend\Swift;
use OCA\Files_External\Lib\Config\IAuthMechanismProvider;
use OCA\Files_External\Lib\Config\IBackendProvider;
use OCA\Files_External\Listener\GroupDeletedListener;
use OCA\Files_External\Listener\UserDeletedListener;
use OCA\Files_External\Service\BackendService;
use OCP\AppFramework\App;
use OCP\AppFramework\Bootstrap\IBootContext;
@@ -126,16 +127,16 @@ class Application extends App implements IBackendProvider, IAuthMechanismProvide
$container = $this->getContainer();
$backends = [
$container->query(Local::class),
$container->query(FTP::class),
$container->query(DAV::class),
$container->query(OwnCloud::class),
$container->query(SFTP::class),
$container->query(AmazonS3::class),
$container->query(Swift::class),
$container->query(SFTP_Key::class),
$container->query(SMB::class),
$container->query(SMB_OC::class),
$container->get(Local::class),
$container->get(FTP::class),
$container->get(DAV::class),
$container->get(OwnCloud::class),
$container->get(SFTP::class),
$container->get(AmazonS3::class),
$container->get(Swift::class),
$container->get(SFTP_Key::class),
$container->get(SMB::class),
$container->get(SMB_OC::class),
];
return $backends;
@@ -149,37 +150,38 @@ class Application extends App implements IBackendProvider, IAuthMechanismProvide
return [
// AuthMechanism::SCHEME_NULL mechanism
$container->query(NullMechanism::class),
$container->get(NullMechanism::class),
// AuthMechanism::SCHEME_BUILTIN mechanism
$container->query(Builtin::class),
$container->get(Builtin::class),
// AuthMechanism::SCHEME_PASSWORD mechanisms
$container->query(Password::class),
$container->query(SessionCredentials::class),
$container->query(LoginCredentials::class),
$container->query(UserProvided::class),
$container->query(GlobalAuth::class),
$container->query(UserGlobalAuth::class),
$container->get(Password::class),
$container->get(SessionCredentials::class),
$container->get(LoginCredentials::class),
$container->get(UserProvided::class),
$container->get(GlobalAuth::class),
$container->get(UserGlobalAuth::class),
// AuthMechanism::SCHEME_OAUTH1 mechanisms
$container->query(OAuth1::class),
$container->get(OAuth1::class),
// AuthMechanism::SCHEME_OAUTH2 mechanisms
$container->query(OAuth2::class),
$container->get(OAuth2::class),
// AuthMechanism::SCHEME_PUBLICKEY mechanisms
$container->query(RSA::class),
$container->query(RSAPrivateKey::class),
$container->get(RSA::class),
$container->get(RSAPrivateKey::class),
// AuthMechanism::SCHEME_OPENSTACK mechanisms
$container->query(OpenStackV2::class),
$container->query(OpenStackV3::class),
$container->query(Rackspace::class),
$container->get(OpenStackV2::class),
$container->get(OpenStackV3::class),
$container->get(Rackspace::class),
// Specialized mechanisms
$container->query(AccessKey::class),
$container->query(KerberosAuth::class),
$container->get(AccessKey::class),
$container->get(KerberosAuth::class),
$container->get(KerberosApacheAuth::class),
];
}
}
@@ -0,0 +1,53 @@
<?php
/**
* @copyright Copyright (c) 2018 Robin Appelman <robin@icewind.nl>
*
* @author Robin Appelman <robin@icewind.nl>
*
* @license GNU AGPL version 3 or any later version
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU Affero General Public License as
* published by the Free Software Foundation, either version 3 of the
* License, or (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU Affero General Public License for more details.
*
* You should have received a copy of the GNU Affero General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*
*/
namespace OCA\Files_External\Lib\Auth\SMB;
use OCA\Files_External\Lib\Auth\AuthMechanism;
use OCA\Files_External\Lib\DefinitionParameter;
use OCP\Authentication\LoginCredentials\IStore;
use OCP\IL10N;
class KerberosApacheAuth extends AuthMechanism {
/** @var IStore */
private $credentialsStore;
public function __construct(IL10N $l, IStore $credentialsStore) {
$realm = new DefinitionParameter('default_realm', 'Default realm');
$realm
->setType(DefinitionParameter::VALUE_TEXT)
->setFlag(DefinitionParameter::FLAG_OPTIONAL)
->setTooltip($l->t('Kerberos default realm, defaults to "WORKGROUP"'));
$this
->setIdentifier('smb::kerberosapache')
->setScheme(self::SCHEME_SMB)
->setText($l->t('Kerberos ticket apache mode'))
->addParameter($realm);
$this->credentialsStore = $credentialsStore;
}
public function getCredentialsStore(): IStore {
return $this->credentialsStore;
}
}
+45 -5
View File
@@ -24,16 +24,19 @@
* along with this program. If not, see <http://www.gnu.org/licenses/>
*
*/
namespace OCA\Files_External\Lib\Backend;
use Icewind\SMB\BasicAuth;
use Icewind\SMB\KerberosApacheAuth;
use Icewind\SMB\KerberosAuth;
use OCA\Files_External\Lib\Auth\AuthMechanism;
use OCA\Files_External\Lib\Auth\Password\Password;
use OCA\Files_External\Lib\Auth\SMB\KerberosApacheAuth as KerberosApacheAuthMechanism;
use OCA\Files_External\Lib\DefinitionParameter;
use OCA\Files_External\Lib\InsufficientDataForMeaningfulAnswerException;
use OCA\Files_External\Lib\LegacyDependencyCheckPolyfill;
use OCA\Files_External\Lib\StorageConfig;
use OCP\IL10N;
use OCP\IUser;
@@ -69,13 +72,13 @@ class SMB extends Backend {
->setLegacyAuthMechanism($legacyAuth);
}
/**
* @param StorageConfig $storage
* @param IUser $user
*/
public function manipulateStorageConfig(StorageConfig &$storage, IUser $user = null) {
$auth = $storage->getAuthMechanism();
if ($auth->getScheme() === AuthMechanism::SCHEME_PASSWORD) {
if (!is_string($storage->getBackendOption('user')) || !is_string($storage->getBackendOption('password'))) {
throw new \InvalidArgumentException('user or password is not set');
}
$smbAuth = new BasicAuth(
$storage->getBackendOption('user'),
$storage->getBackendOption('domain'),
@@ -85,6 +88,43 @@ class SMB extends Backend {
switch ($auth->getIdentifier()) {
case 'smb::kerberos':
$smbAuth = new KerberosAuth();
break;
case 'smb::kerberosapache':
if (!$auth instanceof KerberosApacheAuthMechanism) {
throw new \InvalidArgumentException('invalid authentication backend');
}
$credentialsStore = $auth->getCredentialsStore();
$kerbAuth = new KerberosApacheAuth();
// check if a kerberos ticket is available, else fallback to session credentials
if ($kerbAuth->checkTicket()) {
$smbAuth = $kerbAuth;
} else {
try {
$credentials = $credentialsStore->getLoginCredentials();
$user = $credentials->getLoginName();
$pass = $credentials->getPassword();
preg_match('/(.*)@(.*)/', $user, $matches);
$realm = $storage->getBackendOption('default_realm');
if (empty($realm)) {
$realm = 'WORKGROUP';
}
if (count($matches) === 0) {
$username = $user;
$workgroup = $realm;
} else {
$username = $matches[1];
$workgroup = $matches[2];
}
$smbAuth = new BasicAuth(
$username,
$workgroup,
$pass
);
} catch (\Exception $e) {
throw new InsufficientDataForMeaningfulAnswerException('No session credentials saved');
}
}
break;
default:
throw new \InvalidArgumentException('unknown authentication backend');
+1 -2
View File
@@ -23,8 +23,7 @@
* along with this program. If not, see <http://www.gnu.org/licenses/>
*
*/
// Check if we are a user
OC_Util::checkLoggedIn();
$config = \OC::$server->getConfig();
$userSession = \OC::$server->getUserSession();
+1 -1
View File
@@ -207,7 +207,7 @@ $canCreateMounts = $_['visibilityType'] === BackendService::VISIBILITY_ADMIN ||
<form autocomplete="false" action="#"
id="global_credentials" method="post">
<h2><?php p($l->t('Global credentials')); ?></h2>
<p class="settings-hint"><?php p($l->t('Global credentials can be used to authenticate with multiple external storage that have the same credentials.')); ?></p>
<p class="settings-hint"><?php p($l->t('Global credentials can be used to authenticate with multiple external storages that have the same credentials.')); ?></p>
<input type="text" name="username"
autocomplete="false"
value="<?php p($_['globalCredentials']['user']); ?>"
+33
View File
@@ -0,0 +1,33 @@
#!/bin/bash
function getContainerHealth {
docker inspect --format "{{.State.Health.Status}}" $1
}
function waitContainer {
while STATUS=$(getContainerHealth $1); [ $STATUS != "healthy" ]; do
if [ $STATUS == "unhealthy" ]; then
echo "Failed!"
exit -1
fi
printf .
lf=$'\n'
sleep 1
done
printf "$lf"
}
mkdir /tmp/shared
# start the dc
docker run -dit --name dc -v /tmp/shared:/shared --hostname krb.domain.test --cap-add SYS_ADMIN icewind1991/samba-krb-test-dc
DC_IP=$(docker inspect dc --format '{{.NetworkSettings.IPAddress}}')
waitContainer dc
# start apache
docker run -d --name apache -v $PWD:/var/www/html -v /tmp/shared:/shared --dns $DC_IP --hostname httpd.domain.test icewind1991/samba-krb-test-apache
APACHE_IP=$(docker inspect apache --format '{{.NetworkSettings.IPAddress}}')
# add the dns record for apache
docker exec dc samba-tool dns add krb.domain.test domain.test httpd A $APACHE_IP -U administrator --password=passwOrd1
File diff suppressed because one or more lines are too long

Some files were not shown because too many files have changed in this diff Show More