aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--.htaccess9
-rw-r--r--apps/dav/lib/CalDAV/BirthdayService.php6
-rw-r--r--apps/dav/tests/unit/CardDAV/BirthdayServiceTest.php1
-rw-r--r--lib/base.php13
-rw-r--r--lib/private/Authentication/Token/DefaultTokenProvider.php4
-rw-r--r--lib/private/Files/Filesystem.php4
-rw-r--r--settings/Controller/AuthSettingsController.php3
-rw-r--r--tests/Settings/Controller/AuthSettingsControllerTest.php5
8 files changed, 29 insertions, 16 deletions
diff --git a/.htaccess b/.htaccess
index 206d2be33bc..c5dbf194b04 100644
--- a/.htaccess
+++ b/.htaccess
@@ -21,8 +21,13 @@
</IfModule>
# Add cache control for static resources
- <FilesMatch "\.(css|js|woff|svg|gif)$">
- Header set Cache-Control "max-age=7200, public"
+ <FilesMatch "\.(css|js|svg|gif)$">
+ Header set Cache-Control "max-age=15778463"
+ </FilesMatch>
+
+ # Let browsers cache WOFF files for a week
+ <FilesMatch "\.woff$">
+ Header set Cache-Control "max-age=604800"
</FilesMatch>
</IfModule>
<IfModule mod_php5.c>
diff --git a/apps/dav/lib/CalDAV/BirthdayService.php b/apps/dav/lib/CalDAV/BirthdayService.php
index bf26aec5377..104eec6b496 100644
--- a/apps/dav/lib/CalDAV/BirthdayService.php
+++ b/apps/dav/lib/CalDAV/BirthdayService.php
@@ -1,10 +1,12 @@
<?php
/**
* @copyright Copyright (c) 2016, ownCloud, Inc.
+ * @copyright Copyright (c) 2016, Georg Ehrke
*
* @author Achim Königs <garfonso@tratschtante.de>
* @author Robin Appelman <robin@icewind.nl>
* @author Thomas Müller <thomas.mueller@tmit.eu>
+ * @author Georg Ehrke <georg@nextcloud.com>
*
* @license AGPL-3.0
*
@@ -147,6 +149,8 @@ class BirthdayService {
} catch (Exception $e) {
return null;
}
+
+ $summary = $title . ' (' . $summarySymbol . $date->format('Y') . ')';
$vCal = new VCalendar();
$vCal->VERSION = '2.0';
$vEvent = $vCal->createComponent('VEVENT');
@@ -163,7 +167,7 @@ class BirthdayService {
$vEvent->DTEND['VALUE'] = 'DATE';
$vEvent->{'UID'} = $doc->UID;
$vEvent->{'RRULE'} = 'FREQ=YEARLY';
- $vEvent->{'SUMMARY'} = $title . ' (' . $summarySymbol . $date->format('Y') . ')';
+ $vEvent->{'SUMMARY'} = $summary;
$vEvent->{'TRANSP'} = 'TRANSPARENT';
$alarm = $vCal->createComponent('VALARM');
$alarm->add($vCal->createProperty('TRIGGER', '-PT0M', ['VALUE' => 'DURATION']));
diff --git a/apps/dav/tests/unit/CardDAV/BirthdayServiceTest.php b/apps/dav/tests/unit/CardDAV/BirthdayServiceTest.php
index 8f8d02f9890..5eeb6772a60 100644
--- a/apps/dav/tests/unit/CardDAV/BirthdayServiceTest.php
+++ b/apps/dav/tests/unit/CardDAV/BirthdayServiceTest.php
@@ -240,6 +240,7 @@ class BirthdayServiceTest extends TestCase {
[true, "BEGIN:VCARD\r\nVERSION:3.0\r\nPRODID:-//Sabre//Sabre VObject 4.1.1//EN\r\nUID:12345\r\nFN:12345\r\nN:12345;;;;\r\nBDAY:\r\nEND:VCARD\r\n", "Dr. Foo Bar"],
[true, "BEGIN:VCARD\r\nVERSION:3.0\r\nPRODID:-//Sabre//Sabre VObject 4.1.1//EN\r\nUID:12345\r\nFN:12345\r\nN:12345;;;;\r\nBDAY:someday\r\nEND:VCARD\r\n", "Dr. Foo Bar"],
[false, "BEGIN:VCARD\r\nVERSION:3.0\r\nPRODID:-//Sabre//Sabre VObject 4.1.1//EN\r\nUID:12345\r\nFN:12345\r\nN:12345;;;;\r\nBDAY:1900-01-01\r\nEND:VCARD\r\n", "Dr. Foo Bar"],
+ [false, "BEGIN:VCARD\r\nVERSION:3.0\r\nPRODID:-//Sabre//Sabre VObject 4.1.1//EN\r\nUID:12345\r\nFN:12345\r\nN:12345;;;;\r\nBDAY:1900-12-31\r\nEND:VCARD\r\n", "Dr. Foo Bar"],
];
}
}
diff --git a/lib/base.php b/lib/base.php
index 909a62040ee..d6c6e17eff9 100644
--- a/lib/base.php
+++ b/lib/base.php
@@ -377,7 +377,7 @@ class OC {
\OCP\Util::addScript('update');
\OCP\Util::addStyle('update');
- /** @var \OCP\App\IAppManager $appManager */
+ /** @var \OC\App\AppManager $appManager */
$appManager = \OC::$server->getAppManager();
$tmpl = new OC_Template('', 'update.admin', 'guest');
@@ -387,14 +387,19 @@ class OC {
// get third party apps
$ocVersion = \OCP\Util::getVersion();
$incompatibleApps = $appManager->getIncompatibleApps($ocVersion);
+ $incompatibleShippedApps = [];
foreach ($incompatibleApps as $appInfo) {
if ($appManager->isShipped($appInfo['id'])) {
- $l = \OC::$server->getL10N('core');
- $hint = $l->t('The files of the app "%$1s" (%$2s) were not replaced correctly.', [$appInfo['name'], $appInfo['id']]);
- throw new \OC\HintException('The files of the app "' . $appInfo['name'] . '" (' . $appInfo['id'] . ') were not replaced correctly.', $hint);
+ $incompatibleShippedApps[] = $appInfo['name'] . ' (' . $appInfo['id'] . ')';
}
}
+ if (!empty($incompatibleShippedApps)) {
+ $l = \OC::$server->getL10N('core');
+ $hint = $l->t('The files of the app %$1s were not replaced correctly. Make sure it is a version compatible with the server.', [implode(', ', $incompatibleShippedApps)]);
+ throw new \OC\HintException('The files of the app ' . implode(', ', $incompatibleShippedApps) . ' were not replaced correctly. Make sure it is a version compatible with the server.', $hint);
+ }
+
$tmpl->assign('appsToUpgrade', $appManager->getAppsNeedingUpgrade($ocVersion));
$tmpl->assign('incompatibleAppsList', $incompatibleApps);
$tmpl->assign('productName', 'Nextcloud'); // for now
diff --git a/lib/private/Authentication/Token/DefaultTokenProvider.php b/lib/private/Authentication/Token/DefaultTokenProvider.php
index 0fdbc4a51dd..ec4cc10c269 100644
--- a/lib/private/Authentication/Token/DefaultTokenProvider.php
+++ b/lib/private/Authentication/Token/DefaultTokenProvider.php
@@ -252,10 +252,10 @@ class DefaultTokenProvider implements IProvider {
*/
public function invalidateOldTokens() {
$olderThan = $this->time->getTime() - (int) $this->config->getSystemValue('session_lifetime', 60 * 60 * 24);
- $this->logger->info('Invalidating session tokens older than ' . date('c', $olderThan));
+ $this->logger->debug('Invalidating session tokens older than ' . date('c', $olderThan));
$this->mapper->invalidateOld($olderThan, IToken::DO_NOT_REMEMBER);
$rememberThreshold = $this->time->getTime() - (int) $this->config->getSystemValue('remember_login_cookie_lifetime', 60 * 60 * 24 * 15);
- $this->logger->info('Invalidating remembered session tokens older than ' . date('c', $rememberThreshold));
+ $this->logger->debug('Invalidating remembered session tokens older than ' . date('c', $rememberThreshold));
$this->mapper->invalidateOld($rememberThreshold, IToken::REMEMBER);
}
diff --git a/lib/private/Files/Filesystem.php b/lib/private/Files/Filesystem.php
index 42a6d950332..51e494c372e 100644
--- a/lib/private/Files/Filesystem.php
+++ b/lib/private/Files/Filesystem.php
@@ -451,11 +451,11 @@ class Filesystem {
self::listenForNewMountProviders($mountConfigManager, $userManager);
} else {
- self::$mounts->addMount(new MountPoint(
+ self::getMountManager()->addMount(new MountPoint(
new NullStorage([]),
'/' . $user
));
- self::$mounts->addMount(new MountPoint(
+ self::getMountManager()->addMount(new MountPoint(
new NullStorage([]),
'/' . $user . '/files'
));
diff --git a/settings/Controller/AuthSettingsController.php b/settings/Controller/AuthSettingsController.php
index 4e3d05a14e8..2a4b30dbd76 100644
--- a/settings/Controller/AuthSettingsController.php
+++ b/settings/Controller/AuthSettingsController.php
@@ -192,8 +192,7 @@ class AuthSettingsController extends Controller {
public function update($id, array $scope) {
$token = $this->tokenProvider->getTokenById($id);
$token->setScope([
- 'filesystem' => $scope['filesystem'],
- 'app' => array_values($scope['apps'])
+ 'filesystem' => $scope['filesystem']
]);
$this->tokenProvider->updateToken($token);
return [];
diff --git a/tests/Settings/Controller/AuthSettingsControllerTest.php b/tests/Settings/Controller/AuthSettingsControllerTest.php
index 782c9f644e0..bb87958cf0f 100644
--- a/tests/Settings/Controller/AuthSettingsControllerTest.php
+++ b/tests/Settings/Controller/AuthSettingsControllerTest.php
@@ -212,15 +212,14 @@ class AuthSettingsControllerTest extends TestCase {
$token->expects($this->once())
->method('setScope')
->with($this->equalTo([
- 'filesystem' => true,
- 'app' => ['dav', 'myapp']
+ 'filesystem' => true
]));
$this->tokenProvider->expects($this->once())
->method('updateToken')
->with($this->equalTo($token));
- $this->assertSame([], $this->controller->update(42, ['filesystem' => true, 'apps' => ['dav', 'myapp']]));
+ $this->assertSame([], $this->controller->update(42, ['filesystem' => true]));
}
}