Skip to content

Commit

Permalink
Merge pull request #44182 from nextcloud/backport/43334/stable28
Browse files Browse the repository at this point in the history
  • Loading branch information
Altahrim authored Mar 14, 2024
2 parents ea9e01e + 0bea514 commit 9f0028c
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions apps/settings/lib/Settings/Admin/Server.php
Original file line number Diff line number Diff line change
Expand Up @@ -67,13 +67,17 @@ public function __construct(IDBConnection $connection,
* @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
Expand Down

0 comments on commit 9f0028c

Please sign in to comment.