diff options
Diffstat (limited to 'lib')
-rw-r--r-- | lib/private/App/AppManager.php | 5 | ||||
-rw-r--r-- | lib/private/Authentication/Token/DefaultTokenProvider.php | 4 | ||||
-rw-r--r-- | lib/private/Console/Application.php | 4 | ||||
-rw-r--r-- | lib/private/SystemTag/SystemTagManager.php | 3 | ||||
-rwxr-xr-x | lib/private/Template/ResourceLocator.php | 2 | ||||
-rw-r--r-- | lib/private/User/Session.php | 3 | ||||
-rw-r--r-- | lib/private/legacy/files.php | 4 |
7 files changed, 19 insertions, 6 deletions
diff --git a/lib/private/App/AppManager.php b/lib/private/App/AppManager.php index 6b819ef7ac1..6c1f5ba6940 100644 --- a/lib/private/App/AppManager.php +++ b/lib/private/App/AppManager.php @@ -32,6 +32,7 @@ namespace OC\App; use OCP\App\AppPathNotFoundException; +use OC_App; use OCP\App\IAppManager; use OCP\App\ManagerEvent; use OCP\IAppConfig; @@ -210,8 +211,12 @@ class AppManager implements IAppManager { * Enable an app for every user * * @param string $appId + * @throws \Exception */ public function enableApp($appId) { + if(OC_App::getAppPath($appId) === false) { + throw new \Exception("$appId can't be enabled since it is not installed."); + } $this->installedAppsCache[$appId] = 'yes'; $this->appConfig->setValue($appId, 'enabled', 'yes'); $this->dispatcher->dispatch(ManagerEvent::EVENT_APP_ENABLE, new ManagerEvent( diff --git a/lib/private/Authentication/Token/DefaultTokenProvider.php b/lib/private/Authentication/Token/DefaultTokenProvider.php index 0e1196a9da4..6fd85295e03 100644 --- a/lib/private/Authentication/Token/DefaultTokenProvider.php +++ b/lib/private/Authentication/Token/DefaultTokenProvider.php @@ -253,10 +253,10 @@ class DefaultTokenProvider implements IProvider { */ public function invalidateOldTokens() { $olderThan = $this->time->getTime() - (int) $this->config->getSystemValue('session_lifetime', 60 * 60 * 24); - $this->logger->debug('Invalidating session tokens older than ' . date('c', $olderThan)); + $this->logger->debug('Invalidating session tokens older than ' . date('c', $olderThan), ['app' => 'cron']); $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->debug('Invalidating remembered session tokens older than ' . date('c', $rememberThreshold)); + $this->logger->debug('Invalidating remembered session tokens older than ' . date('c', $rememberThreshold), ['app' => 'cron']); $this->mapper->invalidateOld($rememberThreshold, IToken::REMEMBER); } diff --git a/lib/private/Console/Application.php b/lib/private/Console/Application.php index 7d2f03d593e..693381ea2b4 100644 --- a/lib/private/Console/Application.php +++ b/lib/private/Console/Application.php @@ -37,6 +37,7 @@ use Symfony\Component\Console\Application as SymfonyApplication; use Symfony\Component\Console\Input\InputInterface; use Symfony\Component\Console\Input\InputOption; use Symfony\Component\Console\Output\OutputInterface; +use Symfony\Component\Console\Output\ConsoleOutputInterface; use Symfony\Component\EventDispatcher\EventDispatcherInterface; class Application { @@ -97,7 +98,8 @@ class Application { throw new NeedsUpdateException(); } elseif ($this->config->getSystemValue('maintenance', false)) { if ($input->getArgument('command') !== '_completion') { - $output->writeln("Nextcloud is in maintenance mode - no apps have been loaded"); + $errOutput = $output->getErrorOutput(); + $errOutput->writeln('<comment>Nextcloud is in maintenance mode - no app have been loaded</comment>' . PHP_EOL); } } else { OC_App::loadApps(); diff --git a/lib/private/SystemTag/SystemTagManager.php b/lib/private/SystemTag/SystemTagManager.php index 7c21c0e004e..d0854e885eb 100644 --- a/lib/private/SystemTag/SystemTagManager.php +++ b/lib/private/SystemTag/SystemTagManager.php @@ -400,6 +400,9 @@ class SystemTagManager implements ISystemTagManager { 'gid' => $query->createParameter('gid'), ]); foreach ($groupIds as $groupId) { + if ($groupId === '') { + continue; + } $query->setParameter('gid', $groupId); $query->execute(); } diff --git a/lib/private/Template/ResourceLocator.php b/lib/private/Template/ResourceLocator.php index 9015bf5d97c..e82a77ba65f 100755 --- a/lib/private/Template/ResourceLocator.php +++ b/lib/private/Template/ResourceLocator.php @@ -84,7 +84,7 @@ abstract class ResourceLocator { $this->doFindTheme($resource); } catch (ResourceNotFoundException $e) { $resourceApp = substr($resource, 0, strpos($resource, '/')); - $this->logger->debug('Could not find resource file "' . $e->getResourcePath() . '"', ['app' => $resourceApp]); + $this->logger->debug('Could not find resource file in theme "' . $e->getResourcePath() . '"', ['app' => $resourceApp]); } } } diff --git a/lib/private/User/Session.php b/lib/private/User/Session.php index c03cbd5891b..4980318b554 100644 --- a/lib/private/User/Session.php +++ b/lib/private/User/Session.php @@ -14,6 +14,7 @@ * @author Robin McCorkell <robin@mccorkell.me.uk> * @author Thomas Müller <thomas.mueller@tmit.eu> * @author Vincent Petry <pvince81@owncloud.com> + * @author Felix Rupp <kontakt@felixrupp.com> * * @license AGPL-3.0 * @@ -70,6 +71,7 @@ use Symfony\Component\EventDispatcher\GenericEvent; * - preRememberedLogin(string $uid) * - postRememberedLogin(\OC\User\User $user) * - logout() + * - postLogout() * * @package OC\User */ @@ -796,6 +798,7 @@ class Session implements IUserSession, Emitter { $this->setToken(null); $this->unsetMagicInCookie(); $this->session->clear(); + $this->manager->emit('\OC\User', 'postLogout'); } /** diff --git a/lib/private/legacy/files.php b/lib/private/legacy/files.php index ed3aa719409..017691805c9 100644 --- a/lib/private/legacy/files.php +++ b/lib/private/legacy/files.php @@ -264,12 +264,12 @@ class OC_Files { if (\OC\Files\Filesystem::isReadable($filename)) { self::sendHeaders($filename, $name, $rangeArray); } elseif (!\OC\Files\Filesystem::file_exists($filename)) { - header("HTTP/1.0 404 Not Found"); + header("HTTP/1.1 404 Not Found"); $tmpl = new OC_Template('', '404', 'guest'); $tmpl->printPage(); exit(); } else { - header("HTTP/1.0 403 Forbidden"); + header("HTTP/1.1 403 Forbidden"); die('403 Forbidden'); } if (isset($params['head']) && $params['head']) { |