diff options
author | Benjamin Gaussorgues <benjamin.gaussorgues@nextcloud.com> | 2024-03-14 10:04:12 +0100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2024-03-14 10:04:12 +0100 |
commit | 9f0028c8d7e61b252b9ce72aac897a14572fa986 (patch) | |
tree | 59c800db9c55f87b161be3285a870c2616c29e64 /apps | |
parent | ea9e01e21d824e91e9f1f1e9a032b3edd3157ac4 (diff) | |
parent | 0bea5146f4928d9f2fe0f97bc727bc4984e0a0e6 (diff) | |
download | nextcloud-server-9f0028c8d7e61b252b9ce72aac897a14572fa986.tar.gz nextcloud-server-9f0028c8d7e61b252b9ce72aac897a14572fa986.zip |
Merge pull request #44182 from nextcloud/backport/43334/stable28
Diffstat (limited to 'apps')
-rw-r--r-- | apps/settings/lib/Settings/Admin/Server.php | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/apps/settings/lib/Settings/Admin/Server.php b/apps/settings/lib/Settings/Admin/Server.php index 9aa8b1ed56d..aa81041cb1f 100644 --- a/apps/settings/lib/Settings/Admin/Server.php +++ b/apps/settings/lib/Settings/Admin/Server.php @@ -67,13 +67,17 @@ class Server implements IDelegatedSettings { * @return TemplateResponse */ public function getForm() { + $ownerConfigFile = fileowner(\OC::$configDir . 'config.php'); + $cliBasedCronPossible = function_exists('posix_getpwuid') && $ownerConfigFile !== false; + $cliBasedCronUser = $cliBasedCronPossible ? (posix_getpwuid($ownerConfigFile)['name'] ?? '') : ''; + // Background jobs $this->initialStateService->provideInitialState('backgroundJobsMode', $this->config->getAppValue('core', 'backgroundjobs_mode', 'ajax')); $this->initialStateService->provideInitialState('lastCron', (int)$this->config->getAppValue('core', 'lastcron', '0')); $this->initialStateService->provideInitialState('cronMaxAge', $this->cronMaxAge()); $this->initialStateService->provideInitialState('cronErrors', $this->config->getAppValue('core', 'cronErrors')); - $this->initialStateService->provideInitialState('cliBasedCronPossible', function_exists('posix_getpwuid')); - $this->initialStateService->provideInitialState('cliBasedCronUser', function_exists('posix_getpwuid') ? posix_getpwuid(fileowner(\OC::$configDir . 'config.php'))['name'] : ''); + $this->initialStateService->provideInitialState('cliBasedCronPossible', $cliBasedCronPossible); + $this->initialStateService->provideInitialState('cliBasedCronUser', $cliBasedCronUser); $this->initialStateService->provideInitialState('backgroundJobsDocUrl', $this->urlGenerator->linkToDocs('admin-background-jobs')); // Profile page |