Compare commits

...

52 Commits

Author SHA1 Message Date
Roeland Jago Douma 9c63433cde Merge pull request #21060 from nextcloud/version/19/final
19 Final
2020-05-26 10:04:27 +02:00
Roeland Jago Douma a283200dcb Merge pull request #21105 from nextcloud/backport/21092/stable19
Update recommended apps
2020-05-26 10:01:23 +02:00
Julius Härtl abecd5696b Update hub bundle and add proxy rule to htaccess
Signed-off-by: Julius Härtl <jus@bitgrid.net>
Signed-off-by: npmbuildbot[bot] <npmbuildbot[bot]@users.noreply.github.com>
2020-05-25 19:52:22 +00:00
Roeland Jago Douma 13e6a0db2c 19 Final
Signed-off-by: Roeland Jago Douma <roeland@famdouma.nl>
2020-05-21 09:32:28 +02:00
Roeland Jago Douma 33b06cfa0c Merge pull request #20964 from nextcloud/version/19/rc3
19 RC3
2020-05-20 19:53:56 +02:00
Morris Jobke 138eddc0f1 Merge pull request #21028 from nextcloud/backport/20629/stable19
[stable19] Don't load text file preview when text app is available (Fixes: #20615)
2020-05-20 13:54:17 +02:00
Morris Jobke 703d8f2adc Merge pull request #21052 from nextcloud/backport/21050/stable19
[stable19] Caching and compression for app store requests
2020-05-20 13:23:00 +02:00
Morris Jobke 745667e426 Compress the appstore requests by default
In test it reduced the transfered data from 5 MB to 2 MB. This should reduce the load on the appstore significantly.

Signed-off-by: Morris Jobke <hey@morrisjobke.de>
2020-05-20 09:07:35 +00:00
Morris Jobke 5c0f06b259 Cache appstore requests for 60 instead of 5 minutes
Signed-off-by: Morris Jobke <hey@morrisjobke.de>
2020-05-20 09:07:35 +00:00
Roeland Jago Douma 5763ce2761 Merge pull request #21047 from nextcloud/backport/21041/stable19
[stable19] Copy over the ETag and LastModified when formatting a Dataresponse
2020-05-19 20:40:47 +02:00
Roeland Jago Douma b9cb5a74cc Copy over the ETag and LastModified when formatting a Dataresponse
This way the ETag checks etc are all working.

Signed-off-by: Roeland Jago Douma <roeland@famdouma.nl>
2020-05-19 12:51:06 +00:00
Roeland Jago Douma 822d3f0e8b Merge pull request #21029 from nextcloud/backport/21003/stable19
[stable19] Remove entries from locales.json incompatible with punic
2020-05-19 12:05:06 +02:00
Roeland Jago Douma e003fcd806 Merge pull request #21032 from nextcloud/backport/20846/stable19
[stable19] Link permissions
2020-05-19 11:57:15 +02:00
Julius Härtl dd15780edd Fix share update test
Signed-off-by: Julius Härtl <jus@bitgrid.net>
2020-05-18 13:47:39 +00:00
Roeland Jago Douma 214221574b Update public link share permission code
Signed-off-by: Roeland Jago Douma <roeland@famdouma.nl>
2020-05-18 13:47:39 +00:00
Roeland Jago Douma aac0dd1f20 Have share permissions on link shares if it is enabled
Signed-off-by: Roeland Jago Douma <roeland@famdouma.nl>
2020-05-18 13:47:38 +00:00
Daniel Kesselberg b0cfa3ed22 Remove entries from locales.json incompatible with punic
As reported at https://github.com/nextcloud/server/issues/20999 the list contains en_US_POSIX as locale but punic is unable to parse such a locale. If you select that locale everyone is confused.

Signed-off-by: Daniel Kesselberg <mail@danielkesselberg.de>
2020-05-18 09:53:47 +00:00
Morris Jobke 231eaf6ffd Merge pull request #20991 from nextcloud/backport/20941/stable19
[stable19] update icewind/smb to 3.2.4
2020-05-18 11:03:39 +02:00
Jonas Meurer be37ca1776 Don't load text file preview when text app is available (Fixes: #20615)
When opening a shared text document, the files_sharing app uses
internal preview support in case no other app to open the text file is
available.

So far, it only checks for the old files_texteditor app, not for the new
new text app. This commit fixes this by checking for both.

Signed-off-by: Jonas Meurer <jonas@freesources.org>
2020-05-18 08:59:53 +00:00
Robin Appelman ffc3b48a40 update icewind/smb to 3.2.4
Signed-off-by: Robin Appelman <robin@icewind.nl>
2020-05-15 12:35:22 +00:00
Roeland Jago Douma 9d7198f31e Merge pull request #20963 from nextcloud/backport/20947/stable19
[stable19] Bump yargs-parser
2020-05-14 11:51:07 +02:00
Roeland Jago Douma c4b2b1ec7d 19 RC3
Signed-off-by: Roeland Jago Douma <roeland@famdouma.nl>
2020-05-14 08:45:14 +02:00
Christoph Wurst 1310836edd Bump yargs-parser
Signed-off-by: Christoph Wurst <christoph@winzerhof-wurst.at>
2020-05-14 06:43:30 +00:00
Roeland Jago Douma b0a7ff1a99 Merge pull request #20850 from nextcloud/version/19/rc2
19 RC2
2020-05-14 08:14:25 +02:00
Roeland Jago Douma 321551a94f 19 RC2
Signed-off-by: Roeland Jago Douma <roeland@famdouma.nl>
2020-05-14 08:11:00 +02:00
Roeland Jago Douma 60fd1a30b2 Merge pull request #20960 from nextcloud/backport/20952/stable19
[stable19] Respect exit code of lint run - changed from -exec to xargs as this e…
2020-05-14 08:09:04 +02:00
Roeland Jago Douma 3d201d70ba Merge pull request #20961 from nextcloud/backport/20958/stable19
[stable19] Allow links to conversations
2020-05-14 08:08:50 +02:00
Joas Schilling e2357d5df1 Allow links to conversations
Signed-off-by: Joas Schilling <coding@schilljs.com>
2020-05-13 20:14:39 +00:00
Morris Jobke ffb4d54bc0 Respect exit code of lint run - changed from -exec to xargs as this exits properly
Signed-off-by: Morris Jobke <hey@morrisjobke.de>
2020-05-13 22:04:04 +02:00
Roeland Jago Douma acdd9362df Merge pull request #20954 from nextcloud/backport/20951/stable19
[stable19] Trailing comma's in functin arguments break on 7.2
2020-05-13 19:46:58 +02:00
Roeland Jago Douma 9c23d6355f Merge pull request #20944 from nextcloud/backport/20897/stable19
[stable19] Proxy server could cache http response when it is not private
2020-05-13 12:48:46 +02:00
Roeland Jago Douma 9fd725c84a Trailing comma's in functin arguments break on 7.2
Signed-off-by: Roeland Jago Douma <roeland@famdouma.nl>
2020-05-13 10:40:31 +00:00
Clement Wong 21f8cc584c Fix http cache test
Signed-off-by: Clement Wong <git@clement.hk>
2020-05-13 06:34:22 +00:00
Clement Wong 203d85f045 Add public argument to Http cacheFor()
Signed-off-by: Clement Wong <git@clement.hk>
2020-05-13 06:34:22 +00:00
Clement Wong 1331eb1fb8 Proxy server could cache http response when it is not private
Signed-off-by: Clement Wong <git@clement.hk>
2020-05-13 06:34:22 +00:00
Roeland Jago Douma c19d639231 Merge pull request #20940 from nextcloud/backport/20858/stable19
[stable19] Remember the webauthn name of devices
2020-05-12 19:51:52 +02:00
Roeland Jago Douma 8e9433aee9 Remember the webauthn name of devices
Fixes #20289
we should not reset to default once we have logged in with the device.

Signed-off-by: Roeland Jago Douma <roeland@famdouma.nl>
2020-05-12 12:08:38 +00:00
Roeland Jago Douma c37bb7745b Merge pull request #20923 from nextcloud/backport/20915/stable19
[stable19] Use random_bytes
2020-05-11 21:00:16 +02:00
John Molakvoæ 4bde23d239 Merge pull request #20878 from nextcloud/backport/20719/stable19 2020-05-11 14:55:16 +02:00
Roeland Jago Douma 387af7eb60 Use random_bytes
Since we don't care if it is human readbale.
The code is backwards compatible with the old format.

Signed-off-by: Roeland Jago Douma <roeland@famdouma.nl>
2020-05-11 12:23:02 +00:00
Roeland Jago Douma 6b6d28ee98 Merge pull request #20880 from nextcloud/backport/20860/stable19
[stable19] macOS contacts: prefer personal over app generated
2020-05-09 10:53:08 +02:00
Roeland Jago Douma 1a58e3afbe Merge pull request #20885 from nextcloud/backport/20853/stable19
[stable19] Fix color-text-maxcontrast not passing WCAG AA
2020-05-09 09:53:07 +02:00
Jan-Christoph Borchardt 78480def53 Fix color-text-maxcontrast not passing WCAG AA
Signed-off-by: Jan-Christoph Borchardt <hey@jancborchardt.net>
2020-05-09 01:06:14 +00:00
Georg Ehrke e048bf8550 Rename app-generated to z-app-generated, because macOS Contacts supports only one and will pick the first one alphabetically
Signed-off-by: Georg Ehrke <developer@georgehrke.com>
2020-05-08 10:05:56 +00:00
Georg Ehrke d1909526fc Implement ctag and etag in ContactsInteraction
Signed-off-by: Georg Ehrke <developer@georgehrke.com>
2020-05-08 10:05:55 +00:00
GretaD adbdecb1d6 Fix languages empty array
Signed-off-by: GretaD <gretadoci@gmail.com>
2020-05-08 09:25:59 +00:00
Morris Jobke 76334c4c90 Merge pull request #20873 from nextcloud/backport/20864/stable19
[stable19] Install page app naming
2020-05-08 10:24:22 +02:00
Roeland Jago Douma 3ebecaec52 Merge pull request #20872 from nextcloud/backport/20831/stable19
[stable19] Do not process the same FileInfo twice
2020-05-08 10:08:33 +02:00
Roeland Jago Douma 1d6772c1be Merge pull request #20871 from nextcloud/backport/20861/stable19
[stable19] Fix replacement dialog
2020-05-08 09:19:08 +02:00
Roeland Jago Douma 4d0f008dcb Install page app naming
Signed-off-by: Roeland Jago Douma <roeland@famdouma.nl>
2020-05-08 06:33:11 +00:00
John Molakvoæ (skjnldsv) 90a65f83e0 Do not process the same FileInfo twice
Signed-off-by: John Molakvoæ (skjnldsv) <skjnldsv@protonmail.com>
Signed-off-by: npmbuildbot[bot] <npmbuildbot[bot]@users.noreply.github.com>
2020-05-08 05:39:53 +00:00
Roeland Jago Douma 3365ab787a Fix replacement dialog
Signed-off-by: Roeland Jago Douma <roeland@famdouma.nl>
Signed-off-by: npmbuildbot[bot] <npmbuildbot[bot]@users.noreply.github.com>
2020-05-08 05:23:39 +00:00
48 changed files with 322 additions and 164 deletions
+3 -3
View File
@@ -34,7 +34,6 @@ use OCA\DAV\DAV\Sharing\Plugin;
use OCP\AppFramework\Db\DoesNotExistException;
use OCP\IL10N;
use Sabre\DAV\Exception\NotFound;
use Sabre\DAV\Exception\NotImplemented;
use Sabre\DAV\PropPatch;
use Sabre\DAVACL\ACLTrait;
use Sabre\DAVACL\IACL;
@@ -130,8 +129,8 @@ class AddressBook extends ExternalAddressBook implements IACL {
/**
* @inheritDoc
*/
public function getLastModified() {
throw new NotImplemented();
public function getLastModified(): ?int {
return $this->mapper->findLastUpdatedForUserId($this->getUid());
}
/**
@@ -149,6 +148,7 @@ class AddressBook extends ExternalAddressBook implements IACL {
'principaluri' => $this->principalUri,
'{DAV:}displayname' => $this->l10n->t('Recently contacted'),
'{' . Plugin::NS_OWNCLOUD . '}read-only' => true,
'{' . \OCA\DAV\CalDAV\Plugin::NS_CALENDARSERVER . '}getctag' => 'http://sabre.io/ns/sync/' . ($this->getLastModified() ?? 0),
];
}
+1 -1
View File
@@ -95,7 +95,7 @@ class Card implements ICard, IACL {
* @inheritDoc
*/
public function getETag(): ?string {
return null;
return '"' . md5((string) $this->getLastModified()) . '"';
}
/**
@@ -104,6 +104,30 @@ class RecentContactMapper extends QBMapper {
return $this->findEntities($select);
}
/**
* @param string $uid
* @return int|null
*/
public function findLastUpdatedForUserId(string $uid):?int {
$qb = $this->db->getQueryBuilder();
$select = $qb
->select('last_contact')
->from($this->getTableName())
->where($qb->expr()->eq('actor_uid', $qb->createNamedParameter($uid)))
->orderBy('last_contact', 'DESC')
->setMaxResults(1);
$cursor = $select->execute();
$row = $cursor->fetch();
if ($row === false) {
return null;
}
return (int)$row['last_contact'];
}
public function cleanUp(int $olderThan): void {
$qb = $this->db->getQueryBuilder();
@@ -34,7 +34,7 @@ use Sabre\DAV;
abstract class ExternalAddressBook implements IAddressBook, DAV\IProperties {
/** @var string */
private const PREFIX = 'app-generated';
private const PREFIX = 'z-app-generated';
/**
* @var string
+1 -1
View File
@@ -9,6 +9,6 @@
},
"require": {
"icewind/streams": "0.7.1",
"icewind/smb": "3.2.3"
"icewind/smb": "3.2.4"
}
}
+6 -6
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": "ef0d9929f5f25696e010d5733eb51fbb",
"content-hash": "9454f546b6ab8865140c991e8f197951",
"packages": [
{
"name": "icewind/smb",
"version": "v3.2.3",
"version": "v3.2.4",
"source": {
"type": "git",
"url": "https://github.com/icewind1991/SMB.git",
"reference": "db50bb51bd0a0e55506e82cf439a9ecd232f64d4"
"reference": "999d6687ca9d4ac2600185c935b45206e47e604a"
},
"dist": {
"type": "zip",
"url": "https://api.github.com/repos/icewind1991/SMB/zipball/db50bb51bd0a0e55506e82cf439a9ecd232f64d4",
"reference": "db50bb51bd0a0e55506e82cf439a9ecd232f64d4",
"url": "https://api.github.com/repos/icewind1991/SMB/zipball/999d6687ca9d4ac2600185c935b45206e47e604a",
"reference": "999d6687ca9d4ac2600185c935b45206e47e604a",
"shasum": ""
},
"require": {
@@ -46,7 +46,7 @@
}
],
"description": "php wrapper for smbclient and libsmbclient-php",
"time": "2020-04-08T15:20:22+00:00"
"time": "2020-05-11T14:12:35+00:00"
},
{
"name": "icewind/streams",
+6 -6
View File
@@ -1,17 +1,17 @@
[
{
"name": "icewind/smb",
"version": "v3.2.3",
"version_normalized": "3.2.3.0",
"version": "v3.2.4",
"version_normalized": "3.2.4.0",
"source": {
"type": "git",
"url": "https://github.com/icewind1991/SMB.git",
"reference": "db50bb51bd0a0e55506e82cf439a9ecd232f64d4"
"reference": "999d6687ca9d4ac2600185c935b45206e47e604a"
},
"dist": {
"type": "zip",
"url": "https://api.github.com/repos/icewind1991/SMB/zipball/db50bb51bd0a0e55506e82cf439a9ecd232f64d4",
"reference": "db50bb51bd0a0e55506e82cf439a9ecd232f64d4",
"url": "https://api.github.com/repos/icewind1991/SMB/zipball/999d6687ca9d4ac2600185c935b45206e47e604a",
"reference": "999d6687ca9d4ac2600185c935b45206e47e604a",
"shasum": ""
},
"require": {
@@ -22,7 +22,7 @@
"friendsofphp/php-cs-fixer": "^2.13",
"phpunit/phpunit": "^7.0"
},
"time": "2020-04-08T15:20:22+00:00",
"time": "2020-05-11T14:12:35+00:00",
"type": "library",
"installation-source": "dist",
"autoload": {
@@ -31,11 +31,6 @@ class NativeFileInfo implements IFileInfo {
*/
protected $attributeCache = null;
/**
* @var int
*/
protected $modeCache;
/**
* @param NativeShare $share
* @param string $path
@@ -69,7 +64,7 @@ class NativeFileInfo implements IFileInfo {
$rawAttributes = explode(',', $this->share->getAttribute($this->path, 'system.dos_attr.*'));
$this->attributeCache = [];
foreach ($rawAttributes as $rawAttribute) {
[$name, $value] = explode(':', $rawAttribute);
list($name, $value) = explode(':', $rawAttribute);
$name = strtolower($name);
if ($name == 'mode') {
$this->attributeCache[$name] = (int)hexdec(substr($value, 2));
@@ -97,6 +92,18 @@ class NativeFileInfo implements IFileInfo {
return $stat['change_time'];
}
/**
* On "mode":
*
* different smbclient versions seem to return different mode values for 'system.dos_attr.mode'
*
* older versions return the dos permissions mask as defined in `IFileInfo::MODE_*` while
* newer versions return the equivalent unix permission mask.
*
* Since the unix mask doesn't contain the proper hidden/archive/system flags we have to assume them
* as false (except for `hidden` where we use the unix dotfile convention)
*/
/**
* @return int
*/
@@ -109,7 +116,11 @@ class NativeFileInfo implements IFileInfo {
*/
public function isDirectory() {
$mode = $this->getMode();
return (bool)($mode & IFileInfo::MODE_DIRECTORY);
if ($mode > 0x80) {
return (bool)($mode & 0x4000); // 0x80: unix directory flag
} else {
return (bool)($mode & IFileInfo::MODE_DIRECTORY);
}
}
/**
@@ -117,7 +128,11 @@ class NativeFileInfo implements IFileInfo {
*/
public function isReadOnly() {
$mode = $this->getMode();
return (bool)($mode & IFileInfo::MODE_READONLY);
if ($mode > 0x80) {
return !(bool)($mode & 0x80); // 0x80: owner write permissions
} else {
return (bool)($mode & IFileInfo::MODE_READONLY);
}
}
/**
@@ -125,7 +140,11 @@ class NativeFileInfo implements IFileInfo {
*/
public function isHidden() {
$mode = $this->getMode();
return (bool)($mode & IFileInfo::MODE_HIDDEN);
if ($mode > 0x80) {
return $this->name[0] === '.';
} else {
return (bool)($mode & IFileInfo::MODE_HIDDEN);
}
}
/**
@@ -133,7 +152,11 @@ class NativeFileInfo implements IFileInfo {
*/
public function isSystem() {
$mode = $this->getMode();
return (bool)($mode & IFileInfo::MODE_SYSTEM);
if ($mode > 0x80) {
return false;
} else {
return (bool)($mode & IFileInfo::MODE_SYSTEM);
}
}
/**
@@ -141,7 +164,11 @@ class NativeFileInfo implements IFileInfo {
*/
public function isArchived() {
$mode = $this->getMode();
return (bool)($mode & IFileInfo::MODE_ARCHIVE);
if ($mode > 0x80) {
return false;
} else {
return (bool)($mode & IFileInfo::MODE_ARCHIVE);
}
}
/**
@@ -152,8 +179,8 @@ class NativeFileInfo implements IFileInfo {
$attribute = $this->share->getAttribute($this->path, 'system.nt_sec_desc.acl.*+');
foreach (explode(',', $attribute) as $acl) {
[$user, $permissions] = explode(':', $acl, 2);
[$type, $flags, $mask] = explode('/', $permissions);
list($user, $permissions) = explode(':', $acl, 2);
list($type, $flags, $mask) = explode('/', $permissions);
$mask = hexdec($mask);
$acls[$user] = new ACL($type, $flags, $mask);
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
+2 -1
View File
@@ -152,7 +152,8 @@ OCA.Sharing.PublicApp = {
img.attr('src', $('#downloadURL').val());
imgcontainer.appendTo('#imgframe');
} else if (mimetype.substr(0, mimetype.indexOf('/')) === 'text' && window.btoa) {
if (OC.appswebroots['files_texteditor'] !== undefined) {
if (OC.appswebroots['files_texteditor'] !== undefined ||
OC.appswebroots['text'] !== undefined) {
// the text editor handles the previewing
return;
}
@@ -216,15 +216,6 @@ class ShareAPIController extends OCSController {
$result['expiration'] = $expiration->format('Y-m-d 00:00:00');
}
// TODO: It might make sense to have a dedicated setting to allow/deny converting link shares into federated ones
// For link shares, we need to have the PERMISSION_SHARE if federated is enabled
if ($this->shareManager->outgoingServer2ServerSharesAllowed()) {
if ($share->getShareType() === IShare::TYPE_LINK
|| $share->getShareType() === IShare::TYPE_EMAIL) {
$result['permissions'] |= Constants::PERMISSION_SHARE;
}
}
if ($share->getShareType() === IShare::TYPE_USER) {
$sharedWith = $this->userManager->get($share->getSharedWith());
$result['share_with'] = $share->getSharedWith();
@@ -511,6 +502,11 @@ class ShareAPIController extends OCSController {
$permissions = Constants::PERMISSION_READ;
}
// TODO: It might make sense to have a dedicated setting to allow/deny converting link shares into federated ones
if (($permissions & Constants::PERMISSION_READ) && $this->shareManager->outgoingServer2ServerSharesAllowed()) {
$permissions |= Constants::PERMISSION_SHARE;
}
$share->setPermissions($permissions);
// Set password
@@ -1055,6 +1051,11 @@ class ShareAPIController extends OCSController {
}
if ($newPermissions !== null) {
// TODO: It might make sense to have a dedicated setting to allow/deny converting link shares into federated ones
if (($newPermissions & Constants::PERMISSION_READ) && $this->shareManager->outgoingServer2ServerSharesAllowed()) {
$newPermissions |= Constants::PERMISSION_SHARE;
}
$share->setPermissions($newPermissions);
$permissions = $newPermissions;
}
+9 -3
View File
@@ -183,12 +183,18 @@ export default {
},
watch: {
fileInfo() {
this.resetState()
this.getShares()
fileInfo(newFile, oldFile) {
if (newFile.id !== oldFile.id) {
this.resetState()
this.getShares()
}
},
},
beforeMount() {
this.getShares()
},
methods: {
/**
* Get the existing shares infos
+2 -1
View File
@@ -999,7 +999,8 @@ class ApiTest extends TestCase {
\OCP\Constants::PERMISSION_READ |
\OCP\Constants::PERMISSION_CREATE |
\OCP\Constants::PERMISSION_UPDATE |
\OCP\Constants::PERMISSION_DELETE,
\OCP\Constants::PERMISSION_DELETE |
\OCP\Constants::PERMISSION_SHARE,
$share1->getPermissions()
);
@@ -146,7 +146,7 @@ abstract class AUserData extends OCSController {
$data[AccountManager::PROPERTY_WEBSITE] = $userAccount[AccountManager::PROPERTY_WEBSITE]['value'];
$data[AccountManager::PROPERTY_TWITTER] = $userAccount[AccountManager::PROPERTY_TWITTER]['value'];
$data['groups'] = $gids;
$data['language'] = $this->config->getUserValue($targetUserObject->getUID(), 'core', 'lang');
$data['language'] = $this->config->getSystemValue('force_language', $this->config->getUserValue($targetUserObject->getUID(), 'core', 'lang'));
$data['locale'] = $this->config->getUserValue($targetUserObject->getUID(), 'core', 'locale');
$backend = $targetUserObject->getBackend();
@@ -225,7 +225,7 @@ class UsersControllerTest extends TestCase {
$this->assertEquals($expected, $this->api->getUsers('MyCustomSearch')->getData());
}
public function testAddUserAlreadyExisting() {
$this->expectException(\OCP\AppFramework\OCS\OCSException::class);
$this->expectExceptionCode(102);
@@ -259,7 +259,7 @@ class UsersControllerTest extends TestCase {
$this->api->addUser('AlreadyExistingUser', 'password', '', '', []);
}
public function testAddUserNonExistingGroup() {
$this->expectException(\OCP\AppFramework\OCS\OCSException::class);
$this->expectExceptionMessage('group NonExistingGroup does not exist');
@@ -295,7 +295,7 @@ class UsersControllerTest extends TestCase {
$this->api->addUser('NewUser', 'pass', '', '', ['NonExistingGroup']);
}
public function testAddUserExistingGroupNonExistingGroup() {
$this->expectException(\OCP\AppFramework\OCS\OCSException::class);
$this->expectExceptionMessage('group NonExistingGroup does not exist');
@@ -487,7 +487,7 @@ class UsersControllerTest extends TestCase {
));
}
public function testAddUserFailedToGenerateUserID() {
$this->expectException(\OCP\AppFramework\OCS\OCSException::class);
$this->expectExceptionMessage('Could not create non-existing user id');
@@ -530,7 +530,7 @@ class UsersControllerTest extends TestCase {
$this->api->addUser('', 'PasswordOfTheNewUser')->getData();
}
public function testAddUserEmailRequired() {
$this->expectException(\OCP\AppFramework\OCS\OCSException::class);
$this->expectExceptionMessage('Required email address was not provided');
@@ -637,7 +637,7 @@ class UsersControllerTest extends TestCase {
));
}
public function testAddUserUnsuccessful() {
$this->expectException(\OCP\AppFramework\OCS\OCSException::class);
$this->expectExceptionMessage('Bad request');
@@ -682,7 +682,7 @@ class UsersControllerTest extends TestCase {
$this->api->addUser('NewUser', 'PasswordOfTheNewUser');
}
public function testAddUserAsSubAdminNoGroup() {
$this->expectException(\OCP\AppFramework\OCS\OCSException::class);
$this->expectExceptionMessage('no group specified (required for subadmins)');
@@ -715,7 +715,7 @@ class UsersControllerTest extends TestCase {
$this->api->addUser('NewUser', 'PasswordOfTheNewUser', '', '', []);
}
public function testAddUserAsSubAdminValidGroupNotSubAdmin() {
$this->expectException(\OCP\AppFramework\OCS\OCSException::class);
$this->expectExceptionMessage('insufficient privileges for group ExistingGroup');
@@ -858,7 +858,7 @@ class UsersControllerTest extends TestCase {
));
}
public function testGetUserTargetDoesNotExist() {
$this->expectException(\OCP\AppFramework\OCS\OCSException::class);
$this->expectExceptionMessage('User does not exist');
@@ -958,6 +958,11 @@ class UsersControllerTest extends TestCase {
->method('getUserValue')
->with('UID', 'core', 'lang')
->willReturn('de');
$this->config
->expects($this->once())
->method('getSystemValue')
->with('force_language', 'de')
->willReturn('de');
$this->api
->expects($this->once())
->method('fillStorageInfo')
@@ -1073,6 +1078,11 @@ class UsersControllerTest extends TestCase {
->method('getUserValue')
->with('UID', 'core', 'enabled', 'true')
->willReturn('true');
$this->config
->expects($this->once())
->method('getSystemValue')
->with('force_language', 'da')
->willReturn('da');
$this->config
->expects($this->at(1))
->method('getUserValue')
@@ -1150,7 +1160,7 @@ class UsersControllerTest extends TestCase {
}
public function testGetUserDataAsSubAdminAndUserIsNotAccessible() {
$this->expectException(\OCP\AppFramework\OCS\OCSException::class);
$this->expectExceptionCode(997);
@@ -1245,6 +1255,11 @@ class UsersControllerTest extends TestCase {
->method('fillStorageInfo')
->with('UID')
->willReturn(['DummyValue']);
$this->config
->expects($this->once())
->method('getSystemValue')
->with('force_language', 'ru')
->willReturn('ru');
$backend = $this->createMock(UserInterface::class);
$backend->expects($this->atLeastOnce())
@@ -1384,7 +1399,7 @@ class UsersControllerTest extends TestCase {
}
public function testEditUserRegularUserSelfEditChangeEmailInvalid() {
$this->expectException(\OCP\AppFramework\OCS\OCSException::class);
$this->expectExceptionCode(102);
@@ -1453,7 +1468,7 @@ class UsersControllerTest extends TestCase {
}
public function testEditUserRegularUserSelfEditChangeQuota() {
$this->expectException(\OCP\AppFramework\OCS\OCSException::class);
$this->expectExceptionCode(997);
@@ -1518,7 +1533,7 @@ class UsersControllerTest extends TestCase {
}
public function testEditUserAdminUserSelfEditChangeInvalidQuota() {
$this->expectException(\OCP\AppFramework\OCS\OCSException::class);
$this->expectExceptionMessage('Invalid quota value ABC');
@@ -1809,7 +1824,7 @@ class UsersControllerTest extends TestCase {
$this->assertEquals([], $this->api->editUser('UserToEdit', 'quota', '3042824')->getData());
}
public function testEditUserSubadminUserInaccessible() {
$this->expectException(\OCP\AppFramework\OCS\OCSException::class);
$this->expectExceptionCode(997);
@@ -1849,7 +1864,7 @@ class UsersControllerTest extends TestCase {
$this->api->editUser('UserToEdit', 'quota', 'value');
}
public function testDeleteUserNotExistingUser() {
$this->expectException(\OCP\AppFramework\OCS\OCSException::class);
$this->expectExceptionCode(101);
@@ -1872,7 +1887,7 @@ class UsersControllerTest extends TestCase {
$this->api->deleteUser('UserToDelete');
}
public function testDeleteUserSelf() {
$this->expectException(\OCP\AppFramework\OCS\OCSException::class);
$this->expectExceptionCode(101);
@@ -1933,7 +1948,7 @@ class UsersControllerTest extends TestCase {
$this->assertEquals([], $this->api->deleteUser('UserToDelete')->getData());
}
public function testDeleteUnsuccessfulUserAsAdmin() {
$this->expectException(\OCP\AppFramework\OCS\OCSException::class);
$this->expectExceptionCode(101);
@@ -2014,7 +2029,7 @@ class UsersControllerTest extends TestCase {
$this->assertEquals([], $this->api->deleteUser('UserToDelete')->getData());
}
public function testDeleteUnsuccessfulUserAsSubadmin() {
$this->expectException(\OCP\AppFramework\OCS\OCSException::class);
$this->expectExceptionCode(101);
@@ -2062,7 +2077,7 @@ class UsersControllerTest extends TestCase {
$this->api->deleteUser('UserToDelete');
}
public function testDeleteUserAsSubAdminAndUserIsNotAccessible() {
$this->expectException(\OCP\AppFramework\OCS\OCSException::class);
$this->expectExceptionCode(997);
@@ -2106,7 +2121,7 @@ class UsersControllerTest extends TestCase {
$this->api->deleteUser('UserToDelete');
}
public function testGetUsersGroupsTargetUserNotExisting() {
$this->expectException(\OCP\AppFramework\OCS\OCSException::class);
$this->expectExceptionCode(998);
@@ -2243,7 +2258,7 @@ class UsersControllerTest extends TestCase {
$this->assertEquals(['groups' => ['Group1']], $this->api->getUsersGroups('UserToLookup')->getData());
}
public function testGetUsersGroupsForSubAdminUserAndUserIsInaccessible() {
$this->expectException(\OCP\AppFramework\OCS\OCSException::class);
$this->expectExceptionCode(997);
@@ -2292,7 +2307,7 @@ class UsersControllerTest extends TestCase {
$this->api->getUsersGroups('UserToLookup');
}
public function testAddToGroupWithTargetGroupNotExisting() {
$this->expectException(\OCP\AppFramework\OCS\OCSException::class);
$this->expectExceptionCode(102);
@@ -2305,7 +2320,7 @@ class UsersControllerTest extends TestCase {
$this->api->addToGroup('TargetUser', 'GroupToAddTo');
}
public function testAddToGroupWithNoGroupSpecified() {
$this->expectException(\OCP\AppFramework\OCS\OCSException::class);
$this->expectExceptionCode(101);
@@ -2313,7 +2328,7 @@ class UsersControllerTest extends TestCase {
$this->api->addToGroup('TargetUser');
}
public function testAddToGroupWithTargetUserNotExisting() {
$this->expectException(\OCP\AppFramework\OCS\OCSException::class);
$this->expectExceptionCode(103);
@@ -2327,7 +2342,7 @@ class UsersControllerTest extends TestCase {
$this->api->addToGroup('TargetUser', 'GroupToAddTo');
}
public function testAddToGroupNoSubadmin() {
$this->expectException(\OCP\AppFramework\OCS\OCSException::class);
$this->expectExceptionCode(104);
@@ -2461,7 +2476,7 @@ class UsersControllerTest extends TestCase {
$this->assertEquals(new DataResponse(), $this->api->addToGroup('TargetUser', 'GroupToAddTo'));
}
public function testRemoveFromGroupWithNoTargetGroup() {
$this->expectException(\OCP\AppFramework\OCS\OCSException::class);
$this->expectExceptionCode(101);
@@ -2475,7 +2490,7 @@ class UsersControllerTest extends TestCase {
$this->api->removeFromGroup('TargetUser', '');
}
public function testRemoveFromGroupWithEmptyTargetGroup() {
$this->expectException(\OCP\AppFramework\OCS\OCSException::class);
$this->expectExceptionCode(101);
@@ -2489,7 +2504,7 @@ class UsersControllerTest extends TestCase {
$this->api->removeFromGroup('TargetUser', '');
}
public function testRemoveFromGroupWithNotExistingTargetGroup() {
$this->expectException(\OCP\AppFramework\OCS\OCSException::class);
$this->expectExceptionCode(102);
@@ -2508,7 +2523,7 @@ class UsersControllerTest extends TestCase {
$this->api->removeFromGroup('TargetUser', 'TargetGroup');
}
public function testRemoveFromGroupWithNotExistingTargetUser() {
$this->expectException(\OCP\AppFramework\OCS\OCSException::class);
$this->expectExceptionCode(103);
@@ -2533,7 +2548,7 @@ class UsersControllerTest extends TestCase {
$this->api->removeFromGroup('TargetUser', 'TargetGroup');
}
public function testRemoveFromGroupWithoutPermission() {
$this->expectException(\OCP\AppFramework\OCS\OCSException::class);
$this->expectExceptionCode(104);
@@ -2574,7 +2589,7 @@ class UsersControllerTest extends TestCase {
$this->api->removeFromGroup('TargetUser', 'TargetGroup');
}
public function testRemoveFromGroupAsAdminFromAdmin() {
$this->expectException(\OCP\AppFramework\OCS\OCSException::class);
$this->expectExceptionMessage('Cannot remove yourself from the admin group');
@@ -2624,7 +2639,7 @@ class UsersControllerTest extends TestCase {
$this->api->removeFromGroup('Admin', 'admin');
}
public function testRemoveFromGroupAsSubAdminFromSubAdmin() {
$this->expectException(\OCP\AppFramework\OCS\OCSException::class);
$this->expectExceptionMessage('Cannot remove yourself from this group as you are a SubAdmin');
@@ -2679,7 +2694,7 @@ class UsersControllerTest extends TestCase {
$this->api->removeFromGroup('SubAdmin', 'subadmin');
}
public function testRemoveFromGroupAsSubAdminFromLastSubAdminGroup() {
$this->expectException(\OCP\AppFramework\OCS\OCSException::class);
$this->expectExceptionMessage('Not viable to remove user from the last group you are SubAdmin of');
@@ -2782,7 +2797,7 @@ class UsersControllerTest extends TestCase {
$this->assertEquals([], $this->api->removeFromGroup('AnotherUser', 'admin')->getData());
}
public function testAddSubAdminWithNotExistingTargetUser() {
$this->expectException(\OCP\AppFramework\OCS\OCSException::class);
$this->expectExceptionMessage('User does not exist');
@@ -2797,7 +2812,7 @@ class UsersControllerTest extends TestCase {
$this->api->addSubAdmin('NotExistingUser', '');
}
public function testAddSubAdminWithNotExistingTargetGroup() {
$this->expectException(\OCP\AppFramework\OCS\OCSException::class);
$this->expectExceptionMessage('Group does not exist');
@@ -2819,7 +2834,7 @@ class UsersControllerTest extends TestCase {
$this->api->addSubAdmin('ExistingUser', 'NotExistingGroup');
}
public function testAddSubAdminToAdminGroup() {
$this->expectException(\OCP\AppFramework\OCS\OCSException::class);
$this->expectExceptionMessage('Cannot create subadmins for admin group');
@@ -2906,7 +2921,7 @@ class UsersControllerTest extends TestCase {
$this->assertEquals([], $this->api->addSubAdmin('ExistingUser', 'TargetGroup')->getData());
}
public function testRemoveSubAdminNotExistingTargetUser() {
$this->expectException(\OCP\AppFramework\OCS\OCSException::class);
$this->expectExceptionMessage('User does not exist');
@@ -2921,7 +2936,7 @@ class UsersControllerTest extends TestCase {
$this->api->removeSubAdmin('NotExistingUser', 'GroupToDeleteFrom');
}
public function testRemoveSubAdminNotExistingTargetGroup() {
$this->expectException(\OCP\AppFramework\OCS\OCSException::class);
$this->expectExceptionMessage('Group does not exist');
@@ -2943,7 +2958,7 @@ class UsersControllerTest extends TestCase {
}
public function testRemoveSubAdminFromNotASubadmin() {
$this->expectException(\OCP\AppFramework\OCS\OCSException::class);
$this->expectExceptionMessage('User is not a subadmin of this group');
@@ -3009,7 +3024,7 @@ class UsersControllerTest extends TestCase {
$this->assertEquals([], $this->api->removeSubAdmin('ExistingUser', 'GroupToDeleteFrom')->getData());
}
public function testGetUserSubAdminGroupsNotExistingTargetUser() {
$this->expectException(\OCP\AppFramework\OCS\OCSException::class);
$this->expectExceptionMessage('User does not exist');
@@ -3163,7 +3178,7 @@ class UsersControllerTest extends TestCase {
$this->assertSame($expected, $api->getCurrentUser()->getData());
}
public function testGetCurrentUserNotLoggedIn() {
$this->expectException(\OCP\AppFramework\OCS\OCSException::class);
@@ -3216,7 +3231,7 @@ class UsersControllerTest extends TestCase {
$this->assertSame($expected, $api->getUser('uid')->getData());
}
public function testResendWelcomeMessageWithNotExistingTargetUser() {
$this->expectException(\OCP\AppFramework\OCS\OCSException::class);
$this->expectExceptionCode(998);
@@ -3230,7 +3245,7 @@ class UsersControllerTest extends TestCase {
$this->api->resendWelcomeMessage('NotExistingUser');
}
public function testResendWelcomeMessageAsSubAdminAndUserIsNotAccessible() {
$this->expectException(\OCP\AppFramework\OCS\OCSException::class);
$this->expectExceptionCode(997);
@@ -3275,7 +3290,7 @@ class UsersControllerTest extends TestCase {
$this->api->resendWelcomeMessage('UserToGet');
}
public function testResendWelcomeMessageNoEmail() {
$this->expectException(\OCP\AppFramework\OCS\OCSException::class);
$this->expectExceptionMessage('Email address not available');
@@ -3316,7 +3331,7 @@ class UsersControllerTest extends TestCase {
$this->api->resendWelcomeMessage('UserToGet');
}
public function testResendWelcomeMessageNullEmail() {
$this->expectException(\OCP\AppFramework\OCS\OCSException::class);
$this->expectExceptionMessage('Email address not available');
@@ -3456,7 +3471,7 @@ class UsersControllerTest extends TestCase {
$this->api->resendWelcomeMessage('UserToGet');
}
public function testResendWelcomeMessageFailed() {
$this->expectException(\OCP\AppFramework\OCS\OCSException::class);
$this->expectExceptionMessage('Sending email failed');
@@ -236,6 +236,7 @@ class UsersController extends Controller {
$serverData['userCount'] = $userCount;
$serverData['languages'] = $languages;
$serverData['defaultLanguage'] = $this->config->getSystemValue('default_language', 'en');
$serverData['forceLanguage'] = $this->config->getSystemValue('force_language', false);
// Settings
$serverData['defaultQuota'] = $defaultQuota;
$serverData['canChangePassword'] = $canChangePassword;
@@ -195,7 +195,7 @@ Feature: sharing
| share_type | 3 |
| file_source | A_NUMBER |
| file_target | /FOLDER |
| permissions | 15 |
| permissions | 31 |
| stime | A_NUMBER |
| token | A_TOKEN |
| storage | A_NUMBER |
@@ -259,7 +259,7 @@ Feature: sharing
| share_type | 3 |
| file_source | A_NUMBER |
| file_target | /FOLDER |
| permissions | 15 |
| permissions | 31 |
| stime | A_NUMBER |
| token | A_TOKEN |
| storage | A_NUMBER |
+1 -1
View File
@@ -19,6 +19,6 @@
"scripts": {
"cs:fix": "php-cs-fixer fix",
"cs:check": "php-cs-fixer fix --dry-run --diff",
"lint": "find . -name \\*.php -not -path './lib/composer/*' -not -path './build/.phan/*' -exec php -l \"{}\" \\;"
"lint": "find . -name \\*.php -not -path './lib/composer/*' -not -path './build/.phan/*' -print0 | xargs -0 -n1 php -l"
}
}
+1 -1
View File
@@ -93,7 +93,7 @@ class OCJSController extends Controller {
$iniWrapper,
$urlGenerator,
$capabilitiesManager,
$initialStateService,
$initialStateService
);
}
+1 -1
View File
@@ -60,7 +60,7 @@ $color-yellow: #FC0;
// rgb(118, 118, 118) / #767676
// min. color contrast for normal text on white background according to WCAG AA
// (Works as well: color: #000; opacity: 0.57;)
$color-text-maxcontrast: nc-lighten($color-main-text, 46.2%) !default;
$color-text-maxcontrast: nc-lighten($color-main-text, 33%) !default;
$color-text-light: nc-lighten($color-main-text, 15%) !default;
$color-text-lighter: nc-lighten($color-main-text, 30%) !default;
+1 -1
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
+1 -1
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
+1 -1
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
+3 -3
View File
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
+2 -2
View File
@@ -787,11 +787,11 @@ const Dialogs = {
$conflict.find('.filename').text(original.name)
$originalDiv.find('.size').text(OC.Util.humanFileSize(original.size))
$originalDiv.find('.mtime').text(formatDate(original.mtime))
$originalDiv.find('.mtime').text(OC.Util.formatDate(original.mtime))
// ie sucks
if (replacement.size && replacement.lastModifiedDate) {
$replacementDiv.find('.size').text(OC.Util.humanFileSize(replacement.size))
$replacementDiv.find('.mtime').text(formatDate(replacement.lastModifiedDate))
$replacementDiv.find('.mtime').text(OC.Util.formatDate(replacement.lastModifiedDate))
}
var path = original.directory + '/' + original.name
var urlSpec = {
@@ -82,11 +82,11 @@ const recommended = {
spreed: {
description: t('core', 'Chatting, video calls, screensharing, online meetings and web conferencing in your browser and with mobile apps.'),
},
onlyoffice: {
richdocuments: {
description: t('core', 'Collaboratively edit office documents.'),
},
documentserver_community: {
description: t('core', 'Local document editing back-end used by the OnlyOffice app.'),
richdocumentscode: {
description: t('core', 'Local document editing back-end used by the Collabora Online app.'),
},
}
const recommendedIds = Object.keys(recommended)
+1 -1
View File
@@ -166,7 +166,7 @@ script('core', [
<input type="checkbox" id="install-recommended-apps" name="install-recommended-apps" class="checkbox checkbox--white" checked>
<label for="install-recommended-apps">
<?php p($l->t('Install recommended apps')); ?>
<span><?php p($l->t('Calendar, Contacts, Talk, Mail & OnlyOffice')); ?></span>
<span><?php p($l->t('Calendar, Contacts, Talk, Mail & Collaborative editing')); ?></span>
</label>
</p>
</fieldset>
@@ -37,8 +37,8 @@ class HubBundle extends Bundle {
'contacts',
'calendar',
'mail',
'documentserver_community',
'onlyoffice',
'richdocumentscode',
'richdocuments',
];
}
}
+4 -5
View File
@@ -41,7 +41,7 @@ use OCP\IConfig;
use OCP\ILogger;
abstract class Fetcher {
public const INVALIDATE_AFTER_SECONDS = 300;
public const INVALIDATE_AFTER_SECONDS = 3600;
/** @var IAppData */
protected $appData;
@@ -98,12 +98,11 @@ abstract class Fetcher {
$options = [
'timeout' => 10,
'headers' => ['Accept-Encoding' => 'gzip'],
];
if ($ETag !== '') {
$options['headers'] = [
'If-None-Match' => $ETag,
];
$options['headers']['If-None-Match'] = $ETag;
}
$client = $this->clientService->newClient();
@@ -153,7 +152,7 @@ abstract class Fetcher {
// No caching when the version has been updated
if (isset($jsonBlob['ncversion']) && $jsonBlob['ncversion'] === $this->getVersion()) {
// If the timestamp is older than 300 seconds request the files new
// If the timestamp is older than 3600 seconds request the files new
if ((int)$jsonBlob['timestamp'] > ($this->timeFactory->getTime() - self::INVALIDATE_AFTER_SECONDS)) {
return $jsonBlob['data'];
}
@@ -71,7 +71,9 @@ class CredentialRepository implements PublicKeyCredentialSourceRepository {
} catch (IMapperException $e) {
}
$defaultName = false;
if ($name === null) {
$defaultName = true;
$name = 'default';
}
@@ -79,7 +81,7 @@ class CredentialRepository implements PublicKeyCredentialSourceRepository {
if ($oldEntity) {
$entity->setId($oldEntity->getId());
if ($name === null) {
if ($defaultName) {
$entity->setName($oldEntity->getName());
}
}
+11 -2
View File
@@ -263,7 +263,7 @@ class Factory implements IFactory {
if ($this->languageExists($app, $locale)) {
return $locale;
}
// Try to split e.g: fr_FR => fr
$locale = explode('_', $locale)[0];
if ($this->languageExists($app, $locale)) {
@@ -585,7 +585,16 @@ class Factory implements IFactory {
public function getLanguages() {
$forceLanguage = $this->config->getSystemValue('force_language', false);
if ($forceLanguage !== false) {
return [];
$l = $this->get('lib', $forceLanguage);
$potentialName = (string) $l->t('__language_name__');
return [
'commonlanguages' => [[
'code' => $forceLanguage,
'name' => $potentialName,
]],
'languages' => [],
];
}
$languageCodes = $this->findAvailableLanguages();
+13 -7
View File
@@ -52,17 +52,14 @@ class Crypto implements ICrypto {
private $ivLength = 16;
/** @var IConfig */
private $config;
/** @var ISecureRandom */
private $random;
/**
* @param IConfig $config
* @param ISecureRandom $random
*/
public function __construct(IConfig $config, ISecureRandom $random) {
public function __construct(IConfig $config) {
$this->cipher = new AES();
$this->config = $config;
$this->random = $random;
}
/**
@@ -95,13 +92,14 @@ class Crypto implements ICrypto {
}
$this->cipher->setPassword($password);
$iv = $this->random->generate($this->ivLength);
$iv = \random_bytes($this->ivLength);
$this->cipher->setIV($iv);
$ciphertext = bin2hex($this->cipher->encrypt($plaintext));
$iv = bin2hex($iv);
$hmac = bin2hex($this->calculateHMAC($ciphertext.$iv, $password));
return $ciphertext.'|'.$iv.'|'.$hmac;
return $ciphertext.'|'.$iv.'|'.$hmac.'|2';
}
/**
@@ -119,7 +117,8 @@ class Crypto implements ICrypto {
$this->cipher->setPassword($password);
$parts = explode('|', $authenticatedCiphertext);
if (\count($parts) !== 3) {
$partCount = \count($parts);
if ($partCount < 3 || $partCount > 4) {
throw new \Exception('Authenticated ciphertext could not be decoded.');
}
@@ -127,6 +126,13 @@ class Crypto implements ICrypto {
$iv = $parts[1];
$hmac = hex2bin($parts[2]);
if ($partCount === 4) {
$version = $parts[3];
if ($version === '2') {
$iv = hex2bin($iv);
}
}
$this->cipher->setIV($iv);
if (!hash_equals($this->calculateHMAC($parts[0] . $parts[1], $password), $hmac)) {
+1
View File
@@ -543,6 +543,7 @@ class Setup {
$content .= "\n RewriteCond %{REQUEST_FILENAME} !/ocs-provider/";
$content .= "\n RewriteCond %{REQUEST_FILENAME} !/ocm-provider/";
$content .= "\n RewriteCond %{REQUEST_URI} !^/\\.well-known/(acme-challenge|pki-validation)/.*";
$content .= "\n RewriteCond %{REQUEST_FILENAME} !/richdocumentscode/proxy.php$";
$content .= "\n RewriteRule . index.php [PT,E=PATH_INFO:$1]";
$content .= "\n RewriteBase " . $rewriteBase;
$content .= "\n <IfModule mod_env.c>";
+8
View File
@@ -91,6 +91,14 @@ abstract class Controller {
unset($headers['Content-Type']);
}
$response->setHeaders(array_merge($dataHeaders, $headers));
if ($data->getETag() !== null) {
$response->setETag($data->getETag());
}
if ($data->getLastModified() !== null) {
$response->setLastModified($data->getLastModified());
}
return $response;
}
return new JSONResponse($data);
+4 -5
View File
@@ -105,12 +105,11 @@ class Response {
* @return $this
* @since 6.0.0 - return value was added in 7.0.0
*/
public function cacheFor(int $cacheSeconds) {
public function cacheFor(int $cacheSeconds, bool $public = false) {
if ($cacheSeconds > 0) {
$this->addHeader('Cache-Control', 'max-age=' . $cacheSeconds . ', must-revalidate');
// Old scool prama caching
$this->addHeader('Pragma', 'public');
$pragma = $public ? 'public' : 'private';
$this->addHeader('Cache-Control', $pragma . ', max-age=' . $cacheSeconds . ', must-revalidate');
$this->addHeader('Pragma', $pragma);
// Set expires header
$expires = new \DateTime();
@@ -185,6 +185,12 @@ class Definitions {
'description' => 'The type of the call: one2one, group or public',
'example' => 'one2one',
],
'link' => [
'since' => '19.0.0',
'required' => false,
'description' => 'The link to the conversation',
'example' => 'https://localhost/index.php/call/R4nd0mToken',
],
],
],
'circle' => [
+3 -3
View File
@@ -11089,9 +11089,9 @@
}
},
"yargs-parser": {
"version": "13.1.1",
"resolved": "https://registry.npmjs.org/yargs-parser/-/yargs-parser-13.1.1.tgz",
"integrity": "sha512-oVAVsHz6uFrg3XQheFII8ESO2ssAf9luWuAd6Wexsu4F3OtIW0o8IribPXYrD4WC24LWtPrJlGy87y5udK+dxQ==",
"version": "13.1.2",
"resolved": "https://registry.npmjs.org/yargs-parser/-/yargs-parser-13.1.2.tgz",
"integrity": "sha512-3lbsNRf/j+A4QuSZfDRA7HRSfWrzO0YjqTJd5kjAq37Zep1CEgaYmrH9Q3GwPiB9cHyd1Y1UwggGhJGoxipbzg==",
"requires": {
"camelcase": "^5.0.0",
"decamelize": "^1.2.0"
+4 -4
View File
@@ -911,10 +911,6 @@
"code": "en_US",
"name": "English (United States)"
},
{
"code": "en_US_POSIX",
"name": "English (United States, Computer)"
},
{
"code": "en_VC",
"name": "English (St. Vincent & Grenadines)"
@@ -1399,6 +1395,10 @@
"code": "ga",
"name": "Irish"
},
{
"code": "ga_GB",
"name": "Irish (United Kingdom)"
},
{
"code": "ga_IE",
"name": "Irish (Ireland)"
+9 -1
View File
@@ -29,13 +29,21 @@ if (!extension_loaded('intl')) {
exit(1);
}
$locales = array_map(function (string $localeCode) {
require '../3rdparty/autoload.php';
$locales = array_map(static function (string $localeCode) {
return [
'code' => $localeCode,
'name' => Locale::getDisplayName($localeCode, 'en')
];
}, ResourceBundle::getLocales(''));
$locales = array_filter($locales, static function (array $locale) {
return is_array(Punic\Data::explodeLocale($locale['code']));
});
$locales = array_values($locales);
if (file_put_contents(__DIR__ . '/locales.json', json_encode($locales, JSON_PRETTY_PRINT)) === false) {
echo 'Failed to update locales.json';
exit(1);
+49 -12
View File
@@ -239,7 +239,7 @@ abstract class FetcherBase extends TestCase {
$this->timeFactory
->expects($this->at(0))
->method('getTime')
->willReturn(1501);
->willReturn(4801);
$client = $this->createMock(IClient::class);
$this->clientService
->expects($this->once())
@@ -249,7 +249,15 @@ abstract class FetcherBase extends TestCase {
$client
->expects($this->once())
->method('get')
->with($this->endpoint)
->with(
$this->equalTo($this->endpoint),
$this->equalTo([
'timeout' => 10,
'headers' => [
'Accept-Encoding' => 'gzip',
]
])
)
->willReturn($response);
$response
->expects($this->once())
@@ -342,7 +350,15 @@ abstract class FetcherBase extends TestCase {
$client
->expects($this->once())
->method('get')
->with($this->endpoint)
->with(
$this->equalTo($this->endpoint),
$this->equalTo([
'timeout' => 10,
'headers' => [
'Accept-Encoding' => 'gzip',
]
])
)
->willReturn($response);
$response
->expects($this->once())
@@ -430,7 +446,15 @@ abstract class FetcherBase extends TestCase {
$client
->expects($this->once())
->method('get')
->with($this->endpoint)
->with(
$this->equalTo($this->endpoint),
$this->equalTo([
'timeout' => 10,
'headers' => [
'Accept-Encoding' => 'gzip',
]
])
)
->willReturn($response);
$response
->expects($this->once())
@@ -495,7 +519,15 @@ abstract class FetcherBase extends TestCase {
$client
->expects($this->once())
->method('get')
->with($this->endpoint)
->with(
$this->equalTo($this->endpoint),
$this->equalTo([
'timeout' => 10,
'headers' => [
'Accept-Encoding' => 'gzip',
]
])
)
->willThrowException(new \Exception());
$this->assertSame([], $this->fetcher->get());
@@ -533,11 +565,11 @@ abstract class FetcherBase extends TestCase {
$this->timeFactory
->expects($this->at(0))
->method('getTime')
->willReturn(1501);
->willReturn(4801);
$this->timeFactory
->expects($this->at(1))
->method('getTime')
->willReturn(1502);
->willReturn(4802);
$client = $this->createMock(IClient::class);
$this->clientService
->expects($this->once())
@@ -552,14 +584,15 @@ abstract class FetcherBase extends TestCase {
$this->equalTo([
'timeout' => 10,
'headers' => [
'If-None-Match' => '"myETag"'
'Accept-Encoding' => 'gzip',
'If-None-Match' => '"myETag"',
]
])
)->willReturn($response);
$response->method('getStatusCode')
->willReturn(304);
$newData = '{"data":[{"id":"MyNewApp","foo":"foo"},{"id":"bar"}],"timestamp":1502,"ncversion":"11.0.0.2","ETag":"\"myETag\""}';
$newData = '{"data":[{"id":"MyNewApp","foo":"foo"},{"id":"bar"}],"timestamp":4802,"ncversion":"11.0.0.2","ETag":"\"myETag\""}';
$file
->expects($this->at(1))
->method('putContent')
@@ -624,6 +657,7 @@ abstract class FetcherBase extends TestCase {
$this->equalTo([
'timeout' => 10,
'headers' => [
'Accept-Encoding' => 'gzip',
'If-None-Match' => '"myETag"',
]
])
@@ -638,7 +672,7 @@ abstract class FetcherBase extends TestCase {
$response->method('getHeader')
->with($this->equalTo('ETag'))
->willReturn('"newETag"');
$fileData = '{"data":[{"id":"MyNewApp","foo":"foo"},{"id":"bar"}],"timestamp":1502,"ncversion":"11.0.0.2","ETag":"\"newETag\""}';
$fileData = '{"data":[{"id":"MyNewApp","foo":"foo"},{"id":"bar"}],"timestamp":4802,"ncversion":"11.0.0.2","ETag":"\"newETag\""}';
$file
->expects($this->at(1))
->method('putContent')
@@ -650,11 +684,11 @@ abstract class FetcherBase extends TestCase {
$this->timeFactory
->expects($this->at(0))
->method('getTime')
->willReturn(1501);
->willReturn(4801);
$this->timeFactory
->expects($this->at(1))
->method('getTime')
->willReturn(1502);
->willReturn(4802);
$expected = [
[
@@ -710,6 +744,9 @@ abstract class FetcherBase extends TestCase {
$this->equalTo($this->endpoint),
$this->equalTo([
'timeout' => 10,
'headers' => [
'Accept-Encoding' => 'gzip',
],
])
)
->willReturn($response);
+1 -1
View File
@@ -267,7 +267,7 @@ class ResponseTest extends \Test\TestCase {
$this->assertEquals(Http::STATUS_NOT_FOUND, $this->childResponse->getStatus());
$this->assertEquals('hi', $this->childResponse->getEtag());
$this->assertEquals('Thu, 01 Jan 1970 00:00:01 +0000', $headers['Last-Modified']);
$this->assertEquals('max-age=33, must-revalidate',
$this->assertEquals('private, max-age=33, must-revalidate',
$headers['Cache-Control']);
}
+11 -4
View File
@@ -24,7 +24,7 @@ class CryptoTest extends \Test\TestCase {
protected function setUp(): void {
parent::setUp();
$this->crypto = new Crypto(\OC::$server->getConfig(), \OC::$server->getSecureRandom());
$this->crypto = new Crypto(\OC::$server->getConfig());
}
/**
@@ -35,7 +35,7 @@ class CryptoTest extends \Test\TestCase {
$this->assertEquals($stringToEncrypt, $this->crypto->decrypt($ciphertext));
}
public function testWrongPassword() {
$this->expectException(\Exception::class);
$this->expectExceptionMessage('HMAC does not match.');
@@ -51,7 +51,7 @@ class CryptoTest extends \Test\TestCase {
$this->assertEquals($stringToEncrypt, $this->crypto->decrypt($encryptedString, 'ThisIsAVeryS3cur3P4ssw0rd'));
}
public function testWrongIV() {
$this->expectException(\Exception::class);
$this->expectExceptionMessage('HMAC does not match.');
@@ -60,7 +60,7 @@ class CryptoTest extends \Test\TestCase {
$this->crypto->decrypt($encryptedString, 'ThisIsAVeryS3cur3P4ssw0rd');
}
public function testWrongParameters() {
$this->expectException(\Exception::class);
$this->expectExceptionMessage('Authenticated ciphertext could not be decoded.');
@@ -68,4 +68,11 @@ class CryptoTest extends \Test\TestCase {
$encryptedString = '1|2';
$this->crypto->decrypt($encryptedString, 'ThisIsAVeryS3cur3P4ssw0rd');
}
public function testLegacy() {
$cipherText = 'e16599188e3d212f5c7f17fdc2abca46|M1WfLAxbcAmITeD6|509457885d6ca5e6c3bfd3741852687a7f2bffce197f8d5ae97b65818b15a1b7f616b68326ff312371540f4ca8ac55f8e2de4aa13aab3474bd3431e51214e3ee';
$password = 'mypass';
$this->assertSame('legacy test', $this->crypto->decrypt($cipherText, $password));
}
}
+2 -2
View File
@@ -29,10 +29,10 @@
// between betas, final and RCs. This is _not_ the public version number. Reset minor/patchlevel
// when updating major/minor version number.
$OC_Version = [19, 0, 0, 9];
$OC_Version = [19, 0, 0, 12];
// The human readable string
$OC_VersionString = '19.0.0 RC1';
$OC_VersionString = '19.0.0';
$OC_VersionCanBeUpgradedFrom = [
'nextcloud' => [