From ceeb44bd04f2606bea4c94107850157719127581 Mon Sep 17 00:00:00 2001 From: Arthur Schiwon Date: Mon, 8 Aug 2016 23:31:26 +0200 Subject: Initial work on Apps page split: * interfaces for the Admin settings (IAdmin) and section (ISection) * SettingsManager service * example setup with LDAP app --- settings/Application.php | 23 + settings/Controller/AdminSettingsController.php | 114 +++++ settings/Controller/CheckSetupController.php | 2 +- settings/admin.php | 272 ----------- settings/routes.php | 4 +- settings/templates/admin.php | 578 ------------------------ settings/templates/admin/encryption.php | 92 ++++ settings/templates/admin/frame.php | 47 ++ settings/templates/admin/logging.php | 88 ++++ settings/templates/admin/server.php | 325 +++++++++++++ settings/templates/admin/sharing.php | 109 +++++ settings/templates/admin/tipstricks.php | 49 ++ 12 files changed, 850 insertions(+), 853 deletions(-) create mode 100644 settings/Controller/AdminSettingsController.php delete mode 100644 settings/admin.php delete mode 100644 settings/templates/admin.php create mode 100644 settings/templates/admin/encryption.php create mode 100644 settings/templates/admin/frame.php create mode 100644 settings/templates/admin/logging.php create mode 100644 settings/templates/admin/server.php create mode 100644 settings/templates/admin/sharing.php create mode 100644 settings/templates/admin/tipstricks.php (limited to 'settings') diff --git a/settings/Application.php b/settings/Application.php index 6db5e2aabf6..09ca0807e63 100644 --- a/settings/Application.php +++ b/settings/Application.php @@ -32,6 +32,7 @@ namespace OC\Settings; use OC\Files\View; use OC\Server; +use OC\Settings\Controller\AdminSettingsController; use OC\Settings\Controller\AppSettingsController; use OC\Settings\Controller\AuthSettingsController; use OC\Settings\Controller\CertificateController; @@ -178,6 +179,19 @@ class Application extends App { $c->query('Logger') ); }); + $container->registerService('AdminSettingsController', function(IContainer $c) { + return new AdminSettingsController( + $c->query('AppName'), + $c->query('Request'), + $c->query('INavigationManager'), + $c->query('L10N'), + $c->query('Config'), + $c->query('EncryptionManager'), + $c->query('UserManager'), + $c->query('DatabaseConnection'), + $c->query('SettingsManager') + ); + }); /** * Middleware @@ -269,5 +283,14 @@ class Application extends App { $server = $c->query('ServerContainer'); return $server->getIntegrityCodeChecker(); }); + $container->registerService('EventDispatcher', function (IContainer $c) { + return $c->query('ServerContainer')->getEventDispatcher(); + }); + $container->registerService('EncryptionManager', function (IContainer $c) { + return $c->query('ServerContainer')->getEncryptionManager(); + }); + $container->registerService('SettingsManager', function (IContainer $c) { + return $c->query('ServerContainer')->getSettingsManager(); + }); } } diff --git a/settings/Controller/AdminSettingsController.php b/settings/Controller/AdminSettingsController.php new file mode 100644 index 00000000000..68707addfe4 --- /dev/null +++ b/settings/Controller/AdminSettingsController.php @@ -0,0 +1,114 @@ + + * + * @author Arthur Schiwon + * + * @license GNU AGPL version 3 or any later version + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU Affero General Public License as + * published by the Free Software Foundation, either version 3 of the + * License, or (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU Affero General Public License for more details. + * + * You should have received a copy of the GNU Affero General Public License + * along with this program. If not, see . + * + */ + +namespace OC\Settings\Controller; + +use Doctrine\DBAL\Connection; +use OCP\AppFramework\Controller; +use OCP\AppFramework\Http\TemplateResponse; +use OC\Encryption\Manager as EncryptionManager; +use OCP\IConfig; +use OCP\IDBConnection; +use OCP\IL10N; +use OCP\INavigationManager; +use OCP\IRequest; +use OCP\IUserManager; +use OCP\Settings\IManager as ISettingsManager; + +/** + * @package OC\Settings\Controller + */ +class AdminSettingsController extends Controller { + + /** @var INavigationManager */ + private $navigationManager; + + /** @var ISettingsManager */ + private $settingsManager; + + public function __construct( + $appName, + IRequest $request, + INavigationManager $navigationManager, + IL10N $l, + IConfig $config, + EncryptionManager $encryptionManager, + IUserManager $userManager, + IDBConnection $db, + ISettingsManager $settingsManager + ) { + parent::__construct($appName, $request); + $this->navigationManager = $navigationManager; + $this->settingsManager = $settingsManager; + } + + /** + * @param string $section + * @return TemplateResponse + * + * @NoCSRFRequired + */ + public function index($section) { + $this->navigationManager->setActiveEntry('admin'); + + $templateParams = []; + $templateParams = array_merge($templateParams, $this->getNavigationParameters()); + $templateParams = array_merge($templateParams, $this->getSettings($section)); + + return new TemplateResponse('settings', 'admin/frame', $templateParams); + } + + public function form() { + + } + + private function getSettings($section) { + $settings = $this->settingsManager->getAdminSettings($section); + $html = ''; + foreach ($settings as $prioritizedSettings) { + foreach ($prioritizedSettings as $setting) { + /** @var \OCP\Settings\IAdmin $setting */ + $form = $setting->render(); + $html .= $form->fetchPage(); + } + } + return ['content' => $html]; + } + + private function getNavigationParameters() { + $a = 'anchor'; + $name = 'section-name'; + + $sections = $this->settingsManager->getAdminSections(); + $templateParameters = []; + foreach($sections as $prioritizedSections) { + foreach ($prioritizedSections as $section) { + $templateParameters[] = [$a => $section->getID(), $name => $section->getName()]; + } + } + + return [ + 'forms' => $templateParameters + ]; + } +} diff --git a/settings/Controller/CheckSetupController.php b/settings/Controller/CheckSetupController.php index 13e7e443621..0441c507f34 100644 --- a/settings/Controller/CheckSetupController.php +++ b/settings/Controller/CheckSetupController.php @@ -290,7 +290,7 @@ class CheckSetupController extends Controller { public function rescanFailedIntegrityCheck() { $this->checker->runInstanceVerification(); return new RedirectResponse( - $this->urlGenerator->linkToRoute('settings_admin') + $this->urlGenerator->linkToRoute('settings.AdminSettings.index') ); } diff --git a/settings/admin.php b/settings/admin.php deleted file mode 100644 index a458c813c11..00000000000 --- a/settings/admin.php +++ /dev/null @@ -1,272 +0,0 @@ - - * @author Björn Schießle - * @author Georg Ehrke - * @author Jan-Christoph Borchardt - * @author Joas Schilling - * @author Lukas Reschke - * @author Martin Mattel - * @author Morris Jobke - * @author Robin Appelman - * @author Roeland Jago Douma - * @author Thomas Müller - * @author Vincent Petry - * - * @license AGPL-3.0 - * - * This code is free software: you can redistribute it and/or modify - * it under the terms of the GNU Affero General Public License, version 3, - * as published by the Free Software Foundation. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU Affero General Public License for more details. - * - * You should have received a copy of the GNU Affero General Public License, version 3, - * along with this program. If not, see - * - */ - -use OC\Lock\NoopLockingProvider; - -OC_Util::checkAdminUser(); -\OC::$server->getNavigationManager()->setActiveEntry("admin"); - -$template = new OC_Template('settings', 'admin', 'user'); -$l = \OC::$server->getL10N('settings'); - -OC_Util::addScript('settings', 'certificates'); -OC_Util::addScript('files', 'jquery.fileupload'); - -\OC::$server->getEventDispatcher()->dispatch('OC\Settings\Admin::loadAdditionalScripts'); - -$logType = \OC::$server->getConfig()->getSystemValue('log_type', 'file'); -$showLog = ($logType === 'file' || $logType === 'owncloud'); -$numEntriesToLoad = 3; -$entries = \OC\Log\File::getEntries($numEntriesToLoad + 1); -$entriesRemaining = count($entries) > $numEntriesToLoad; -$entries = array_slice($entries, 0, $numEntriesToLoad); -$logFilePath = \OC\Log\File::getLogFilePath(); -$doesLogFileExist = file_exists($logFilePath); -$logFileSize = 0; -if($doesLogFileExist) { - $logFileSize = filesize($logFilePath); -} - -$config = \OC::$server->getConfig(); -$appConfig = \OC::$server->getAppConfig(); -$request = \OC::$server->getRequest(); -$certificateManager = \OC::$server->getCertificateManager(null); -$urlGenerator = \OC::$server->getURLGenerator(); - -// Should we display sendmail as an option? -$template->assign('sendmail_is_available', (bool) \OC_Helper::findBinaryPath('sendmail')); - -$template->assign('loglevel', $config->getSystemValue("loglevel", 2)); -$template->assign('mail_domain', $config->getSystemValue("mail_domain", '')); -$template->assign('mail_from_address', $config->getSystemValue("mail_from_address", '')); -$template->assign('mail_smtpmode', $config->getSystemValue("mail_smtpmode", '')); -$template->assign('mail_smtpsecure', $config->getSystemValue("mail_smtpsecure", '')); -$template->assign('mail_smtphost', $config->getSystemValue("mail_smtphost", '')); -$template->assign('mail_smtpport', $config->getSystemValue("mail_smtpport", '')); -$template->assign('mail_smtpauthtype', $config->getSystemValue("mail_smtpauthtype", '')); -$template->assign('mail_smtpauth', $config->getSystemValue("mail_smtpauth", false)); -$template->assign('mail_smtpname', $config->getSystemValue("mail_smtpname", '')); -$template->assign('mail_smtppassword', $config->getSystemValue("mail_smtppassword", '')); -$template->assign('entries', $entries); -$template->assign('entriesremain', $entriesRemaining); -$template->assign('logFileSize', $logFileSize); -$template->assign('doesLogFileExist', $doesLogFileExist); -$template->assign('showLog', $showLog); -$template->assign('readOnlyConfigEnabled', OC_Helper::isReadOnlyConfigEnabled()); -$template->assign('isLocaleWorking', OC_Util::isSetLocaleWorking()); -$template->assign('isAnnotationsWorking', OC_Util::isAnnotationsWorking()); -$template->assign('checkForWorkingWellKnownSetup', $config->getSystemValue('check_for_working_wellknown_setup', true)); -$template->assign('has_fileinfo', OC_Util::fileInfoLoaded()); -$template->assign('backgroundjobs_mode', $appConfig->getValue('core', 'backgroundjobs_mode', 'ajax')); -$template->assign('cron_log', $config->getSystemValue('cron_log', true)); -$template->assign('lastcron', $appConfig->getValue('core', 'lastcron', false)); -$template->assign('shareAPIEnabled', $appConfig->getValue('core', 'shareapi_enabled', 'yes')); -$template->assign('shareDefaultExpireDateSet', $appConfig->getValue('core', 'shareapi_default_expire_date', 'no')); -$template->assign('shareExpireAfterNDays', $appConfig->getValue('core', 'shareapi_expire_after_n_days', '7')); -$template->assign('shareEnforceExpireDate', $appConfig->getValue('core', 'shareapi_enforce_expire_date', 'no')); -$excludeGroups = $appConfig->getValue('core', 'shareapi_exclude_groups', 'no') === 'yes' ? true : false; -$template->assign('shareExcludeGroups', $excludeGroups); -$excludedGroupsList = $appConfig->getValue('core', 'shareapi_exclude_groups_list', ''); -$excludedGroupsList = json_decode($excludedGroupsList); -$template->assign('shareExcludedGroupsList', !is_null($excludedGroupsList) ? implode('|', $excludedGroupsList) : ''); -$template->assign('encryptionEnabled', \OC::$server->getEncryptionManager()->isEnabled()); -$backends = \OC::$server->getUserManager()->getBackends(); -$externalBackends = (count($backends) > 1) ? true : false; -$template->assign('encryptionReady', \OC::$server->getEncryptionManager()->isReady()); -$template->assign('externalBackendsEnabled', $externalBackends); - -/** @var \Doctrine\DBAL\Connection $connection */ -$connection = \OC::$server->getDatabaseConnection(); -try { - if ($connection->getDatabasePlatform() instanceof \Doctrine\DBAL\Platforms\SqlitePlatform) { - $template->assign('invalidTransactionIsolationLevel', false); - } else { - $template->assign('invalidTransactionIsolationLevel', $connection->getTransactionIsolation() !== \Doctrine\DBAL\Connection::TRANSACTION_READ_COMMITTED); - } -} catch (\Doctrine\DBAL\DBALException $e) { - // ignore - $template->assign('invalidTransactionIsolationLevel', false); -} - -$encryptionModules = \OC::$server->getEncryptionManager()->getEncryptionModules(); -$defaultEncryptionModuleId = \OC::$server->getEncryptionManager()->getDefaultEncryptionModuleId(); - -$encModulues = array(); -foreach ($encryptionModules as $module) { - $encModulues[$module['id']]['displayName'] = $module['displayName']; - $encModulues[$module['id']]['default'] = false; - if ($module['id'] === $defaultEncryptionModuleId) { - $encModulues[$module['id']]['default'] = true; - } -} -$template->assign('encryptionModules', $encModulues); - -// If the current web root is non-empty but the web root from the config is, -// and system cron is used, the URL generator fails to build valid URLs. -$shouldSuggestOverwriteCliUrl = $config->getAppValue('core', 'backgroundjobs_mode', 'ajax') === 'cron' && - \OC::$WEBROOT && \OC::$WEBROOT !== '/' && - !$config->getSystemValue('overwrite.cli.url', ''); -$suggestedOverwriteCliUrl = ($shouldSuggestOverwriteCliUrl) ? \OC::$WEBROOT : ''; -$template->assign('suggestedOverwriteCliUrl', $suggestedOverwriteCliUrl); - -$template->assign('allowLinks', $appConfig->getValue('core', 'shareapi_allow_links', 'yes')); -$template->assign('enforceLinkPassword', \OCP\Util::isPublicLinkPasswordRequired()); -$template->assign('allowPublicUpload', $appConfig->getValue('core', 'shareapi_allow_public_upload', 'yes')); -$template->assign('allowResharing', $appConfig->getValue('core', 'shareapi_allow_resharing', 'yes')); -$template->assign('allowPublicMailNotification', $appConfig->getValue('core', 'shareapi_allow_public_notification', 'no')); -$template->assign('allowMailNotification', $appConfig->getValue('core', 'shareapi_allow_mail_notification', 'no')); -$template->assign('allowShareDialogUserEnumeration', $appConfig->getValue('core', 'shareapi_allow_share_dialog_user_enumeration', 'yes')); -$template->assign('onlyShareWithGroupMembers', \OC\Share\Share::shareWithGroupMembersOnly()); -$template->assign('allowGroupSharing', $appConfig->getValue('core', 'shareapi_allow_group_sharing', 'yes')); -$databaseOverload = (strpos(\OCP\Config::getSystemValue('dbtype'), 'sqlite') !== false); -$template->assign('databaseOverload', $databaseOverload); -$template->assign('cronErrors', $appConfig->getValue('core', 'cronErrors')); - -// warn if php is not setup properly to get system variables with getenv -$path = getenv('PATH'); -$template->assign('getenvServerNotWorking', empty($path)); - -// warn if outdated version of a memcache module is used -$caches = [ - 'apcu' => ['name' => $l->t('APCu'), 'version' => '4.0.6'], - 'redis' => ['name' => $l->t('Redis'), 'version' => '2.2.5'], -]; - -$outdatedCaches = []; -foreach ($caches as $php_module => $data) { - $isOutdated = extension_loaded($php_module) && version_compare(phpversion($php_module), $data['version'], '<'); - if ($isOutdated) { - $outdatedCaches[$php_module] = $data; - } -} -$template->assign('OutdatedCacheWarning', $outdatedCaches); - -// add hardcoded forms from the template -$forms = OC_App::getForms('admin'); - -if ($config->getSystemValue('enable_certificate_management', false)) { - $certificatesTemplate = new OC_Template('settings', 'certificates'); - $certificatesTemplate->assign('type', 'admin'); - $certificatesTemplate->assign('uploadRoute', 'settings.Certificate.addSystemRootCertificate'); - $certificatesTemplate->assign('certs', $certificateManager->listCertificates()); - $certificatesTemplate->assign('urlGenerator', $urlGenerator); - $forms[] = $certificatesTemplate->fetchPage(); -} - -$formsAndMore = array(); -if ($request->getServerProtocol() !== 'https' || !OC_Util::isAnnotationsWorking() || - $suggestedOverwriteCliUrl || !OC_Util::isSetLocaleWorking() || - !OC_Util::fileInfoLoaded() || $databaseOverload -) { - $formsAndMore[] = array('anchor' => 'security-warning', 'section-name' => $l->t('Security & setup warnings')); -} -$formsAndMore[] = array('anchor' => 'shareAPI', 'section-name' => $l->t('Sharing')); -$formsAndMore[] = ['anchor' => 'encryptionAPI', 'section-name' => $l->t('Server-side encryption')]; - -// Prioritize fileSharingSettings and files_external and move updater to the version -$fileSharingSettings = $filesExternal = $updaterAppPanel = $ocDefaultEncryptionModulePanel = ''; -foreach ($forms as $index => $form) { - if (strpos($form, 'id="fileSharingSettings"')) { - $fileSharingSettings = $form; - unset($forms[$index]); - continue; - } - if (strpos($form, 'id="files_external"')) { - $filesExternal = $form; - unset($forms[$index]); - continue; - } - if (strpos($form, 'class="updater-admin"')) { - $updaterAppPanel = $form; - unset($forms[$index]); - continue; - } - if (strpos($form, 'id="ocDefaultEncryptionModule"')) { - $ocDefaultEncryptionModulePanel = $form; - unset($forms[$index]); - continue; - } -} -if ($filesExternal) { - $formsAndMore[] = array('anchor' => 'files_external', 'section-name' => $l->t('External Storage')); -} - -$template->assign('fileSharingSettings', $fileSharingSettings); -$template->assign('filesExternal', $filesExternal); -$template->assign('updaterAppPanel', $updaterAppPanel); -$template->assign('ocDefaultEncryptionModulePanel', $ocDefaultEncryptionModulePanel); -$lockingProvider = \OC::$server->getLockingProvider(); -if ($lockingProvider instanceof NoopLockingProvider) { - $template->assign('fileLockingType', 'none'); -} else if ($lockingProvider instanceof \OC\Lock\DBLockingProvider) { - $template->assign('fileLockingType', 'db'); -} else { - $template->assign('fileLockingType', 'cache'); -} - -$formsMap = array_map(function ($form) { - if (preg_match('%([^>]*)>.*?)%i', $form, $regs)) { - $sectionName = str_replace('', '', $regs[0]); - $sectionName = str_replace('', '', $sectionName); - $anchor = strtolower($sectionName); - $anchor = str_replace(' ', '-', $anchor); - - return array( - 'anchor' => $anchor, - 'section-name' => $sectionName, - 'form' => $form - ); - } - return array( - 'form' => $form - ); -}, $forms); - -$formsAndMore = array_merge($formsAndMore, $formsMap); - -// add bottom hardcoded forms from the template -$formsAndMore[] = ['anchor' => 'backgroundjobs', 'section-name' => $l->t('Cron')]; -$formsAndMore[] = ['anchor' => 'mail_general_settings', 'section-name' => $l->t('Email server')]; -$formsAndMore[] = ['anchor' => 'log-section', 'section-name' => $l->t('Log')]; -$formsAndMore[] = ['anchor' => 'admin-tips', 'section-name' => $l->t('Tips & tricks')]; -if ($updaterAppPanel) { - $formsAndMore[] = ['anchor' => 'updater', 'section-name' => $l->t('Updates')]; -} - -$template->assign('forms', $formsAndMore); - -$template->printPage(); - -$util = new \OC_Util(); -$util->createHtaccessTestFile(\OC::$server->getConfig()); - diff --git a/settings/routes.php b/settings/routes.php index 94732b3192a..f77da543e10 100644 --- a/settings/routes.php +++ b/settings/routes.php @@ -64,6 +64,8 @@ $application->registerRoutes($this, [ ['name' => 'Certificate#removePersonalRootCertificate', 'url' => '/settings/personal/certificate/{certificateIdentifier}', 'verb' => 'DELETE'], ['name' => 'Certificate#addSystemRootCertificate', 'url' => '/settings/admin/certificate', 'verb' => 'POST'], ['name' => 'Certificate#removeSystemRootCertificate', 'url' => '/settings/admin/certificate/{certificateIdentifier}', 'verb' => 'DELETE'], + ['name' => 'AdminSettings#index', 'url' => '/settings/admin/{section}', 'verb' => 'GET', 'defaults' => ['section' => 'server']], + ['name' => 'AdminSettings#form', 'url' => '/settings/admin/{section}', 'verb' => 'GET'], ] ]); @@ -76,8 +78,6 @@ $this->create('settings_personal', '/settings/personal') ->actionInclude('settings/personal.php'); $this->create('settings_users', '/settings/users') ->actionInclude('settings/users.php'); -$this->create('settings_admin', '/settings/admin') - ->actionInclude('settings/admin.php'); // Settings ajax actions // users $this->create('settings_ajax_setquota', '/settings/ajax/setquota.php') diff --git a/settings/templates/admin.php b/settings/templates/admin.php deleted file mode 100644 index 74fe585962d..00000000000 --- a/settings/templates/admin.php +++ /dev/null @@ -1,578 +0,0 @@ - - * This file is licensed under the Affero General Public License version 3 or later. - * See the COPYING-README file. - */ -/** - * @var array $_ - * @var \OCP\IL10N $l - * @var OC_Defaults $theme - */ - -style('settings', 'settings'); -script('settings', [ 'settings', 'admin', 'log'] ); -script('core', ['multiselect', 'setupchecks']); -vendor_script('select2/select2'); -vendor_style('select2/select2'); - -$levels = ['Debug', 'Info', 'Warning', 'Error', 'Fatal']; -$levelLabels = [ - $l->t( 'Everything (fatal issues, errors, warnings, info, debug)' ), - $l->t( 'Info, warnings, errors and fatal issues' ), - $l->t( 'Warnings, errors and fatal issues' ), - $l->t( 'Errors and fatal issues' ), - $l->t( 'Fatal issues only' ), -]; - -$mail_smtpauthtype = [ - '' => $l->t('None'), - 'LOGIN' => $l->t('Login'), - 'PLAIN' => $l->t('Plain'), - 'NTLM' => $l->t('NT LAN Manager'), -]; - -$mail_smtpsecure = [ - '' => $l->t('None'), - 'ssl' => $l->t('SSL'), - 'tls' => $l->t('TLS'), -]; - -$mail_smtpmode = [ - 'php', - 'smtp', -]; -if ($_['sendmail_is_available']) { - $mail_smtpmode[] = 'sendmail'; -} -if ($_['mail_smtpmode'] == 'qmail') { - $mail_smtpmode[] = 'qmail'; -} -?> - -
-
    - %s", \OCP\Util::sanitizeHTML($anchor), \OCP\Util::sanitizeHTML($sectionName))); - } - }?> -
-
- -
- -
-

t('Security & setup warnings'));?>

-
    - -
  • - t('php does not seem to be setup properly to query system environment variables. The test with getenv("PATH") only returns an empty response.')); ?>
    - t('Please check the installation documentation ↗ for php configuration notes and the php configuration of your server, especially when using php-fpm.', link_to_docs('admin-php-fpm'))); ?> -
  • - -
  • - t('The Read-Only config has been enabled. This prevents setting some configurations via the web-interface. Furthermore, the file needs to be made writable manually for every update.')); ?> -
  • - -
  • - t('PHP is apparently setup to strip inline doc blocks. This will make several core apps inaccessible.')); ?>
    - t('This is probably caused by a cache/accelerator such as Zend OPcache or eAccelerator.')); ?> -
  • - -
  • - t('Your database does not run with "READ COMMITTED" transaction isolation level. This can cause problems when multiple actions are executed in parallel.')); ?> -
  • - $data) { - ?> -
  • - t('%1$s below version %2$s is installed, for stability and performance reasons we recommend updating to a newer %1$s version.', $data)); ?> -
  • - -
  • - t('The PHP module \'fileinfo\' is missing. We strongly recommend to enable this module to get best results with mime-type detection.')); ?> -
  • - -
  • - t('Transactional file locking is disabled, this might lead to issues with race conditions. Enable \'filelocking.enabled\' in config.php to avoid these problems. See the documentation ↗ for more information.', link_to_docs('admin-transactional-locking'))); ?> -
  • - -
  • - t('System locale can not be set to a one which supports UTF-8.')); - ?> -
    - t('This means that there might be problems with certain characters in file names.')); - ?> -
    - t('We strongly suggest installing the required packages on your system to support one of the following locales: %s.', [$locales])); - ?> -
  • - -
  • - t('If your installation is not installed in the root of the domain and uses system cron, there can be issues with the URL generation. To avoid these problems, please set the "overwrite.cli.url" option in your config.php file to the webroot path of your installation (Suggested: "%s")', $_['suggestedOverwriteCliUrl'])); ?> -
  • - -
  • - t('It was not possible to execute the cronjob via CLI. The following technical errors have appeared:')); ?> -
    -
      - error)) {?> -
    1. error) ?> hint) ?>
    2. - -
    -
  • - -
- -
-
- - - - -
-
- -
-
- -
-

t('Sharing'));?>

- -

- /> -
-

-

- /> -
-

- -

- /> -
- - /> -
- - /> -
- - /> -
- -

-

- t( 'Expire after ' )); ?> - ' /> - t( 'days' )); ?> - /> -
-

-

- /> -
-

-

- /> -
-

-

- /> -
-

-

- /> -
-

-

- /> -
-

-

- -
- t('These groups will still be able to receive shares, but not to initiate them.')); ?> -

-

- /> -
-

- - -
- - - - -
- - -
-

t('Cron'));?>

- -

- - - - t("Last cron job execution: %s.", [$relative_time]));?> - - - - - t("Last cron job execution: %s. Something seems wrong.", [$relative_time]));?> - - - - t("Cron was not executed yet!")); - endif; ?> -

- - - -

- > -
- t("Execute one task with each page loaded")); ?> -

-

- > -
- t("cron.php is registered at a webcron service to call cron.php every 15 minutes over http.")); ?> -

-

- > -
- t("Use system's cron service to call the cron.php file every 15 minutes.")); ?> -

-
- -
-

t('Server-side encryption')); ?>

- - -

- /> -
-

- - - -
-
- t('No encryption module loaded, please enable an encryption module in the app menu.')); - } else { ?> -

t('Select default encryption module:')) ?>

-
- $module): ?> - > - -
- - - -
- -
-
- t('You need to migrate your encryption keys from the old encryption (ownCloud <= 8.0) to the new one. Please enable the "Default encryption module" and run \'occ encryption:migrate\'')); - } elseif ($_['encryptionReady'] === false && $_['externalBackendsEnabled'] === false) { - p($l->t('You need to migrate your encryption keys from the old encryption (ownCloud <= 8.0) to the new one.')); ?> - - -
-
-
- -
-
-

t('Email server'));?>

- - -

t('This is used for sending out notifications.')); ?>

- -

- - - - - -

- -

- - ' />@ - ' /> -

- - - - -
-
- -
- -
- t( 'Test email settings' )); ?> - - -
- -
-

t('Log'));?>

- - - - - - - - - - - -
- level]);?> - - app);?> - - message);?> - - time)){ - p(OC_Util::formatDate($entry->time)); - } else { - p($entry->time); - }?> - user) ? p($entry->user) : p('--') ?>
-

t('What to log'));?>

- - 0): ?> - t('Download logfile'));?> - - - - - - (100 * 1024 * 1024)): ?> -
- - t('The logfile is bigger than 100 MB. Downloading it may take some time!')); ?> - - - -
- -
-

t('Tips & tricks'));?>

- -
- - -
- - -
-

t('Version'));?>

-

getTitle()); ?>

-

-
- - - - -
diff --git a/settings/templates/admin/encryption.php b/settings/templates/admin/encryption.php new file mode 100644 index 00000000000..d4c3be8b2c8 --- /dev/null +++ b/settings/templates/admin/encryption.php @@ -0,0 +1,92 @@ + + * + * @author Arthur Schiwon + * + * @license GNU AGPL version 3 or any later version + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU Affero General Public License as + * published by the Free Software Foundation, either version 3 of the + * License, or (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU Affero General Public License for more details. + * + * You should have received a copy of the GNU Affero General Public License + * along with this program. If not, see . + * + */ + +/** @var \OCP\IL10N $l */ +/** @var array $_ */ + +?> + +
+

t('Server-side encryption')); ?>

+ + +

+ /> +
+

+ + + +
+
+ t('No encryption module loaded, please enable an encryption module in the app menu.')); + } else { ?> +

t('Select default encryption module:')) ?>

+
+ $module): ?> + > + +
+ + + +
+ +
+
+ t('You need to migrate your encryption keys from the old encryption (ownCloud <= 8.0) to the new one. Please enable the "Default encryption module" and run \'occ encryption:migrate\'')); + } elseif ($_['encryptionReady'] === false && $_['externalBackendsEnabled'] === false) { + p($l->t('You need to migrate your encryption keys from the old encryption (ownCloud <= 8.0) to the new one.')); ?> + + +
+
+
diff --git a/settings/templates/admin/frame.php b/settings/templates/admin/frame.php new file mode 100644 index 00000000000..e0fee1555a3 --- /dev/null +++ b/settings/templates/admin/frame.php @@ -0,0 +1,47 @@ + + * + * @author Arthur Schiwon + * + * @license GNU AGPL version 3 or any later version + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU Affero General Public License as + * published by the Free Software Foundation, either version 3 of the + * License, or (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU Affero General Public License for more details. + * + * You should have received a copy of the GNU Affero General Public License + * along with this program. If not, see . + * + */ + +style('settings', 'settings'); +script('settings', [ 'settings', 'admin', 'log', 'certificates'] ); +script('core', ['multiselect', 'setupchecks']); +script('files', 'jquery.fileupload'); +vendor_script('select2/select2'); +vendor_style('select2/select2'); + +?> + +
+
    + getURLGenerator()->linkToRoute('settings.AdminSettings.index', ['section' => $form['anchor']]); + $sectionName = $form['section-name']; + print_unescaped(sprintf("
  • %s
  • ", \OCP\Util::sanitizeHTML($anchor), \OCP\Util::sanitizeHTML($sectionName))); + } + }?> +
+
+ +
+ +
diff --git a/settings/templates/admin/logging.php b/settings/templates/admin/logging.php new file mode 100644 index 00000000000..2f60629c42a --- /dev/null +++ b/settings/templates/admin/logging.php @@ -0,0 +1,88 @@ + + * + * @author Arthur Schiwon + * + * @license GNU AGPL version 3 or any later version + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU Affero General Public License as + * published by the Free Software Foundation, either version 3 of the + * License, or (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU Affero General Public License for more details. + * + * You should have received a copy of the GNU Affero General Public License + * along with this program. If not, see . + * + */ + +/** @var \OCP\IL10N $l */ +/** @var array $_ */ + +$levels = ['Debug', 'Info', 'Warning', 'Error', 'Fatal']; +$levelLabels = [ + $l->t( 'Everything (fatal issues, errors, warnings, info, debug)' ), + $l->t( 'Info, warnings, errors and fatal issues' ), + $l->t( 'Warnings, errors and fatal issues' ), + $l->t( 'Errors and fatal issues' ), + $l->t( 'Fatal issues only' ), +]; + +?> + +
+

t('Log'));?>

+ + + + + + + + + + + +
+ level]);?> + + app);?> + + message);?> + + time)){ + p(OC_Util::formatDate($entry->time)); + } else { + p($entry->time); + }?> + user) ? p($entry->user) : p('--') ?>
+

t('What to log'));?>

+ + 0): ?> + t('Download logfile'));?> + + + + + + (100 * 1024 * 1024)): ?> +
+ + t('The logfile is bigger than 100 MB. Downloading it may take some time!')); ?> + + + +
diff --git a/settings/templates/admin/server.php b/settings/templates/admin/server.php new file mode 100644 index 00000000000..1bf068de392 --- /dev/null +++ b/settings/templates/admin/server.php @@ -0,0 +1,325 @@ + + * + * @author Arthur Schiwon + * + * @license GNU AGPL version 3 or any later version + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU Affero General Public License as + * published by the Free Software Foundation, either version 3 of the + * License, or (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU Affero General Public License for more details. + * + * You should have received a copy of the GNU Affero General Public License + * along with this program. If not, see . + * + */ + +/** @var \OCP\IL10N $l */ +/** @var array $_ */ + +$mail_smtpauthtype = [ + '' => $l->t('None'), + 'LOGIN' => $l->t('Login'), + 'PLAIN' => $l->t('Plain'), + 'NTLM' => $l->t('NT LAN Manager'), +]; + +$mail_smtpsecure = [ + '' => $l->t('None'), + 'ssl' => $l->t('SSL'), + 'tls' => $l->t('TLS'), +]; + +$mail_smtpmode = [ + 'php', + 'smtp', +]; +if ($_['sendmail_is_available']) { + $mail_smtpmode[] = 'sendmail'; +} +if ($_['mail_smtpmode'] == 'qmail') { + $mail_smtpmode[] = 'qmail'; +} +?> + +
+

t('Security & setup warnings'));?>

+
    + +
  • + t('php does not seem to be setup properly to query system environment variables. The test with getenv("PATH") only returns an empty response.')); ?>
    + t('Please check the installation documentation ↗ for php configuration notes and the php configuration of your server, especially when using php-fpm.', link_to_docs('admin-php-fpm'))); ?> +
  • + +
  • + t('The Read-Only config has been enabled. This prevents setting some configurations via the web-interface. Furthermore, the file needs to be made writable manually for every update.')); ?> +
  • + +
  • + t('PHP is apparently setup to strip inline doc blocks. This will make several core apps inaccessible.')); ?>
    + t('This is probably caused by a cache/accelerator such as Zend OPcache or eAccelerator.')); ?> +
  • + +
  • + t('Your database does not run with "READ COMMITTED" transaction isolation level. This can cause problems when multiple actions are executed in parallel.')); ?> +
  • + $data) { + ?> +
  • + t('%1$s below version %2$s is installed, for stability and performance reasons we recommend updating to a newer %1$s version.', $data)); ?> +
  • + +
  • + t('The PHP module \'fileinfo\' is missing. We strongly recommend to enable this module to get best results with mime-type detection.')); ?> +
  • + +
  • + t('Transactional file locking is disabled, this might lead to issues with race conditions. Enable \'filelocking.enabled\' in config.php to avoid these problems. See the documentation ↗ for more information.', link_to_docs('admin-transactional-locking'))); ?> +
  • + +
  • + t('System locale can not be set to a one which supports UTF-8.')); + ?> +
    + t('This means that there might be problems with certain characters in file names.')); + ?> +
    + t('We strongly suggest installing the required packages on your system to support one of the following locales: %s.', [$locales])); + ?> +
  • + +
  • + t('If your installation is not installed in the root of the domain and uses system cron, there can be issues with the URL generation. To avoid these problems, please set the "overwrite.cli.url" option in your config.php file to the webroot path of your installation (Suggested: "%s")', $_['suggestedOverwriteCliUrl'])); ?> +
  • + +
  • + t('It was not possible to execute the cronjob via CLI. The following technical errors have appeared:')); ?> +
    +
      + error)) {?> +
    1. error) ?> hint) ?>
    2. + +
    +
  • + +
+ +
+
+ + + + +
+
+ +
+
+ +
+

t('Cron'));?>

+ +

+ + + + t("Last cron job execution: %s.", [$relative_time]));?> + + + + + t("Last cron job execution: %s. Something seems wrong.", [$relative_time]));?> + + + + t("Cron was not executed yet!")); + endif; ?> +

+ + + +

+ > +
+ t("Execute one task with each page loaded")); ?> +

+

+ > +
+ t("cron.php is registered at a webcron service to call cron.php every 15 minutes over http.")); ?> +

+

+ > +
+ t("Use system's cron service to call the cron.php file every 15 minutes.")); ?> +

+
+ +
+
+

t('Email server'));?>

+ + +

t('This is used for sending out notifications.')); ?>

+ +

+ + + + + +

+ +

+ + ' />@ + ' /> +

+ + + + +
+
+ +
+ +
+ t( 'Test email settings' )); ?> + + +
+ +
+

t('Version'));?>

+

getTitle()); ?>

+

+
diff --git a/settings/templates/admin/sharing.php b/settings/templates/admin/sharing.php new file mode 100644 index 00000000000..c81f7e2ae1c --- /dev/null +++ b/settings/templates/admin/sharing.php @@ -0,0 +1,109 @@ + + * + * @author Arthur Schiwon + * + * @license GNU AGPL version 3 or any later version + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU Affero General Public License as + * published by the Free Software Foundation, either version 3 of the + * License, or (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU Affero General Public License for more details. + * + * You should have received a copy of the GNU Affero General Public License + * along with this program. If not, see . + * + */ + +/** @var \OCP\IL10N $l */ +/** @var array $_ */ + +?> + +
+

t('Sharing'));?>

+ +

+ /> +
+

+

+ /> +
+

+ +

+ /> +
+ + /> +
+ + /> +
+ + /> +
+ +

+

+ t( 'Expire after ' )); ?> + ' /> + t( 'days' )); ?> + /> +
+

+

+ /> +
+

+

+ /> +
+

+

+ /> +
+

+

+ /> +
+

+

+ /> +
+

+

+ +
+ t('These groups will still be able to receive shares, but not to initiate them.')); ?> +

+

+ /> +
+

+ + +
diff --git a/settings/templates/admin/tipstricks.php b/settings/templates/admin/tipstricks.php new file mode 100644 index 00000000000..e924a96dead --- /dev/null +++ b/settings/templates/admin/tipstricks.php @@ -0,0 +1,49 @@ + + * + * @author Arthur Schiwon + * + * @license GNU AGPL version 3 or any later version + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU Affero General Public License as + * published by the Free Software Foundation, either version 3 of the + * License, or (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU Affero General Public License for more details. + * + * You should have received a copy of the GNU Affero General Public License + * along with this program. If not, see . + * + */ + +/** @var \OCP\IL10N $l */ +/** @var array $_ */ + +?> + +
+

t('Tips & tricks'));?>

+ +
-- cgit v1.2.3