summaryrefslogtreecommitdiffstats
path: root/settings
diff options
context:
space:
mode:
authorArthur Schiwon <blizzz@arthur-schiwon.de>2016-08-08 23:31:26 +0200
committerArthur Schiwon <blizzz@arthur-schiwon.de>2016-08-09 18:05:09 +0200
commitceeb44bd04f2606bea4c94107850157719127581 (patch)
tree7ecb64a3ca929a7b3a721cfed65c65bf0c61831d /settings
parentedeb41ccaff186b116852df4caf8df144db682c8 (diff)
downloadnextcloud-server-ceeb44bd04f2606bea4c94107850157719127581.tar.gz
nextcloud-server-ceeb44bd04f2606bea4c94107850157719127581.zip
Initial work on Apps page split:
* interfaces for the Admin settings (IAdmin) and section (ISection) * SettingsManager service * example setup with LDAP app
Diffstat (limited to 'settings')
-rw-r--r--settings/Application.php23
-rw-r--r--settings/Controller/AdminSettingsController.php114
-rw-r--r--settings/Controller/CheckSetupController.php2
-rw-r--r--settings/admin.php272
-rw-r--r--settings/routes.php4
-rw-r--r--settings/templates/admin.php578
-rw-r--r--settings/templates/admin/encryption.php92
-rw-r--r--settings/templates/admin/frame.php47
-rw-r--r--settings/templates/admin/logging.php88
-rw-r--r--settings/templates/admin/server.php325
-rw-r--r--settings/templates/admin/sharing.php109
-rw-r--r--settings/templates/admin/tipstricks.php49
12 files changed, 850 insertions, 853 deletions
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 @@
+<?php
+/**
+ * @copyright Copyright (c) 2016 Arthur Schiwon <blizzz@arthur-schiwon.de>
+ *
+ * @author Arthur Schiwon <blizzz@arthur-schiwon.de>
+ *
+ * @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 <http://www.gnu.org/licenses/>.
+ *
+ */
+
+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 @@
-<?php
-/**
- * @copyright Copyright (c) 2016, ownCloud, Inc.
- *
- * @author Bart Visscher <bartv@thisnet.nl>
- * @author Björn Schießle <bjoern@schiessle.org>
- * @author Georg Ehrke <georg@owncloud.com>
- * @author Jan-Christoph Borchardt <hey@jancborchardt.net>
- * @author Joas Schilling <coding@schilljs.com>
- * @author Lukas Reschke <lukas@statuscode.ch>
- * @author Martin Mattel <martin.mattel@diemattels.at>
- * @author Morris Jobke <hey@morrisjobke.de>
- * @author Robin Appelman <robin@icewind.nl>
- * @author Roeland Jago Douma <roeland@famdouma.nl>
- * @author Thomas Müller <thomas.mueller@tmit.eu>
- * @author Vincent Petry <pvince81@owncloud.com>
- *
- * @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 <http://www.gnu.org/licenses/>
- *
- */
-
-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('%(<h2(?P<class>[^>]*)>.*?</h2>)%i', $form, $regs)) {
- $sectionName = str_replace('<h2'.$regs['class'].'>', '', $regs[0]);
- $sectionName = str_replace('</h2>', '', $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 @@
-<?php
-/**
- * Copyright (c) 2011, Robin Appelman <icewind1991@gmail.com>
- * 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';
-}
-?>
-
-<div id="app-navigation">
- <ul>
- <?php foreach($_['forms'] as $form) {
- if (isset($form['anchor'])) {
- $anchor = '#' . $form['anchor'];
- $sectionName = $form['section-name'];
- print_unescaped(sprintf("<li><a href='%s'>%s</a></li>", \OCP\Util::sanitizeHTML($anchor), \OCP\Util::sanitizeHTML($sectionName)));
- }
- }?>
- </ul>
-</div>
-
-<div id="app-content">
-
-<div id="security-warning" class="section">
- <h2><?php p($l->t('Security & setup warnings'));?></h2>
- <ul>
-<?php
-// is php setup properly to query system environment variables like getenv('PATH')
-if ($_['getenvServerNotWorking']) {
-?>
- <li>
- <?php p($l->t('php does not seem to be setup properly to query system environment variables. The test with getenv("PATH") only returns an empty response.')); ?><br>
- <?php print_unescaped($l->t('Please check the <a target="_blank" rel="noreferrer" href="%s">installation documentation ↗</a> for php configuration notes and the php configuration of your server, especially when using php-fpm.', link_to_docs('admin-php-fpm'))); ?>
- </li>
-<?php
-}
-
-// is read only config enabled
-if ($_['readOnlyConfigEnabled']) {
-?>
- <li>
- <?php p($l->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.')); ?>
- </li>
-<?php
-}
-
-// Are doc blocks accessible?
-if (!$_['isAnnotationsWorking']) {
- ?>
- <li>
- <?php p($l->t('PHP is apparently setup to strip inline doc blocks. This will make several core apps inaccessible.')); ?><br>
- <?php p($l->t('This is probably caused by a cache/accelerator such as Zend OPcache or eAccelerator.')); ?>
- </li>
-<?php
-}
-
-// Is the Transaction isolation level READ_COMMITTED?
-if ($_['invalidTransactionIsolationLevel']) {
- ?>
- <li>
- <?php p($l->t('Your database does not run with "READ COMMITTED" transaction isolation level. This can cause problems when multiple actions are executed in parallel.')); ?>
- </li>
-<?php
-}
-
-// Warning if memcache is outdated
-foreach ($_['OutdatedCacheWarning'] as $php_module => $data) {
- ?>
- <li>
- <?php p($l->t('%1$s below version %2$s is installed, for stability and performance reasons we recommend updating to a newer %1$s version.', $data)); ?>
- </li>
-<?php
-}
-
-// if module fileinfo available?
-if (!$_['has_fileinfo']) {
- ?>
- <li>
- <?php p($l->t('The PHP module \'fileinfo\' is missing. We strongly recommend to enable this module to get best results with mime-type detection.')); ?>
- </li>
-<?php
-}
-
-// locking configured optimally?
-if ($_['fileLockingType'] === 'none') {
- ?>
- <li>
- <?php print_unescaped($l->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 <a target="_blank" rel="noreferrer" href="%s">documentation ↗</a> for more information.', link_to_docs('admin-transactional-locking'))); ?>
- </li>
- <?php
-}
-
-// is locale working ?
-if (!$_['isLocaleWorking']) {
- ?>
- <li>
- <?php
- $locales = 'en_US.UTF-8/fr_FR.UTF-8/es_ES.UTF-8/de_DE.UTF-8/ru_RU.UTF-8/pt_BR.UTF-8/it_IT.UTF-8/ja_JP.UTF-8/zh_CN.UTF-8';
- p($l->t('System locale can not be set to a one which supports UTF-8.'));
- ?>
- <br>
- <?php
- p($l->t('This means that there might be problems with certain characters in file names.'));
- ?>
- <br>
- <?php
- p($l->t('We strongly suggest installing the required packages on your system to support one of the following locales: %s.', [$locales]));
- ?>
- </li>
-<?php
-}
-
-if ($_['suggestedOverwriteCliUrl']) {
- ?>
- <li>
- <?php p($l->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'])); ?>
- </li>
-<?php
-}
-
-if ($_['cronErrors']) {
- ?>
- <li>
- <?php p($l->t('It was not possible to execute the cronjob via CLI. The following technical errors have appeared:')); ?>
- <br>
- <ol>
- <?php foreach(json_decode($_['cronErrors']) as $error) { if(isset($error->error)) {?>
- <li><?php p($error->error) ?> <?php p($error->hint) ?></li>
- <?php }};?>
- </ol>
- </li>
-<?php
-}
-?>
-</ul>
-
-<div id="postsetupchecks" data-check-wellknown="<?php if($_['checkForWorkingWellKnownSetup']) { p('true'); } else { p('false'); } ?>">
- <div class="loading"></div>
- <ul class="errors hidden"></ul>
- <ul class="warnings hidden"></ul>
- <ul class="info hidden"></ul>
- <p class="hint hidden">
- <?php print_unescaped($l->t('Please double check the <a target="_blank" rel="noreferrer" href="%s">installation guides ↗</a>, and check for any errors or warnings in the <a href="#log-section">log</a>.', link_to_docs('admin-install'))); ?>
- </p>
-</div>
-<div id="security-warning-state">
- <span class="hidden icon-checkmark"><?php p($l->t('All checks passed.'));?></span>
-</div>
-</div>
-
- <div class="section" id="shareAPI">
- <h2><?php p($l->t('Sharing'));?></h2>
- <a target="_blank" el="noreferrer" class="icon-info"
- title="<?php p($l->t('Open documentation'));?>"
- href="<?php p(link_to_docs('admin-sharing')); ?>"></a>
- <p id="enable">
- <input type="checkbox" name="shareapi_enabled" id="shareAPIEnabled" class="checkbox"
- value="1" <?php if ($_['shareAPIEnabled'] === 'yes') print_unescaped('checked="checked"'); ?> />
- <label for="shareAPIEnabled"><?php p($l->t('Allow apps to use the Share API'));?></label><br/>
- </p>
- <p class="<?php if ($_['shareAPIEnabled'] === 'no') p('hidden');?>">
- <input type="checkbox" name="shareapi_allow_links" id="allowLinks" class="checkbox"
- value="1" <?php if ($_['allowLinks'] === 'yes') print_unescaped('checked="checked"'); ?> />
- <label for="allowLinks"><?php p($l->t('Allow users to share via link'));?></label><br/>
- </p>
-
- <p id="publicLinkSettings" class="indent <?php if ($_['allowLinks'] !== 'yes' || $_['shareAPIEnabled'] === 'no') p('hidden'); ?>">
- <input type="checkbox" name="shareapi_allow_public_upload" id="allowPublicUpload" class="checkbox"
- value="1" <?php if ($_['allowPublicUpload'] == 'yes') print_unescaped('checked="checked"'); ?> />
- <label for="allowPublicUpload"><?php p($l->t('Allow public uploads'));?></label><br/>
-
- <input type="checkbox" name="shareapi_enforce_links_password" id="enforceLinkPassword" class="checkbox"
- value="1" <?php if ($_['enforceLinkPassword']) print_unescaped('checked="checked"'); ?> />
- <label for="enforceLinkPassword"><?php p($l->t('Enforce password protection'));?></label><br/>
-
- <input type="checkbox" name="shareapi_default_expire_date" id="shareapiDefaultExpireDate" class="checkbox"
- value="1" <?php if ($_['shareDefaultExpireDateSet'] === 'yes') print_unescaped('checked="checked"'); ?> />
- <label for="shareapiDefaultExpireDate"><?php p($l->t('Set default expiration date'));?></label><br/>
-
- <input type="checkbox" name="shareapi_allow_public_notification" id="allowPublicMailNotification" class="checkbox"
- value="1" <?php if ($_['allowPublicMailNotification'] == 'yes') print_unescaped('checked="checked"'); ?> />
- <label for="allowPublicMailNotification"><?php p($l->t('Allow users to send mail notification for shared files'));?></label><br/>
-
- </p>
- <p id="setDefaultExpireDate" class="double-indent <?php if ($_['allowLinks'] !== 'yes' || $_['shareDefaultExpireDateSet'] === 'no' || $_['shareAPIEnabled'] === 'no') p('hidden');?>">
- <?php p($l->t( 'Expire after ' )); ?>
- <input type="text" name='shareapi_expire_after_n_days' id="shareapiExpireAfterNDays" placeholder="<?php p('7')?>"
- value='<?php p($_['shareExpireAfterNDays']) ?>' />
- <?php p($l->t( 'days' )); ?>
- <input type="checkbox" name="shareapi_enforce_expire_date" id="shareapiEnforceExpireDate" class="checkbox"
- value="1" <?php if ($_['shareEnforceExpireDate'] === 'yes') print_unescaped('checked="checked"'); ?> />
- <label for="shareapiEnforceExpireDate"><?php p($l->t('Enforce expiration date'));?></label><br/>
- </p>
- <p class="<?php if ($_['shareAPIEnabled'] === 'no') p('hidden');?>">
- <input type="checkbox" name="shareapi_allow_resharing" id="allowResharing" class="checkbox"
- value="1" <?php if ($_['allowResharing'] === 'yes') print_unescaped('checked="checked"'); ?> />
- <label for="allowResharing"><?php p($l->t('Allow resharing'));?></label><br/>
- </p>
- <p class="<?php if ($_['shareAPIEnabled'] === 'no') p('hidden');?>">
- <input type="checkbox" name="shareapi_allow_group_sharing" id="allowGroupSharing" class="checkbox"
- value="1" <?php if ($_['allowGroupSharing'] === 'yes') print_unescaped('checked="checked"'); ?> />
- <label for="allowGroupSharing"><?php p($l->t('Allow sharing with groups'));?></label><br />
- </p>
- <p class="<?php if ($_['shareAPIEnabled'] === 'no') p('hidden');?>">
- <input type="checkbox" name="shareapi_only_share_with_group_members" id="onlyShareWithGroupMembers" class="checkbox"
- value="1" <?php if ($_['onlyShareWithGroupMembers']) print_unescaped('checked="checked"'); ?> />
- <label for="onlyShareWithGroupMembers"><?php p($l->t('Restrict users to only share with users in their groups'));?></label><br/>
- </p>
- <p class="<?php if ($_['shareAPIEnabled'] === 'no') p('hidden');?>">
- <input type="checkbox" name="shareapi_allow_mail_notification" id="allowMailNotification" class="checkbox"
- value="1" <?php if ($_['allowMailNotification'] === 'yes') print_unescaped('checked="checked"'); ?> />
- <label for="allowMailNotification"><?php p($l->t('Allow users to send mail notification for shared files to other users'));?></label><br/>
- </p>
- <p class="<?php if ($_['shareAPIEnabled'] === 'no') p('hidden');?>">
- <input type="checkbox" name="shareapi_exclude_groups" id="shareapiExcludeGroups" class="checkbox"
- value="1" <?php if ($_['shareExcludeGroups']) print_unescaped('checked="checked"'); ?> />
- <label for="shareapiExcludeGroups"><?php p($l->t('Exclude groups from sharing'));?></label><br/>
- </p>
- <p id="selectExcludedGroups" class="indent <?php if (!$_['shareExcludeGroups'] || $_['shareAPIEnabled'] === 'no') p('hidden'); ?>">
- <input name="shareapi_exclude_groups_list" type="hidden" id="excludedGroups" value="<?php p($_['shareExcludedGroupsList']) ?>" style="width: 400px"/>
- <br />
- <em><?php p($l->t('These groups will still be able to receive shares, but not to initiate them.')); ?></em>
- </p>
- <p class="<?php if ($_['shareAPIEnabled'] === 'no') p('hidden');?>">
- <input type="checkbox" name="shareapi_allow_share_dialog_user_enumeration" value="1" id="shareapi_allow_share_dialog_user_enumeration" class="checkbox"
- <?php if ($_['allowShareDialogUserEnumeration'] === 'yes') print_unescaped('checked="checked"'); ?> />
- <label for="shareapi_allow_share_dialog_user_enumeration"><?php p($l->t('Allow username autocompletion in share dialog. If this is disabled the full username needs to be entered.'));?></label><br />
- </p>
-
- <?php print_unescaped($_['fileSharingSettings']); ?>
- </div>
-
-<?php print_unescaped($_['filesExternal']); ?>
-
-<?php foreach($_['forms'] as $form) {
- if (isset($form['form'])) {?>
- <div id="<?php isset($form['anchor']) ? p($form['anchor']) : p('');?>"><?php print_unescaped($form['form']);?></div>
- <?php }
-};?>
-
-<div class="section" id="backgroundjobs">
- <h2 class="inlineblock"><?php p($l->t('Cron'));?></h2>
- <?php if ($_['cron_log']): ?>
- <p class="cronlog inlineblock">
- <?php if ($_['lastcron'] !== false):
- $relative_time = relative_modified_date($_['lastcron']);
- $absolute_time = OC_Util::formatDate($_['lastcron']);
- if (time() - $_['lastcron'] <= 3600): ?>
- <span class="status success"></span>
- <span class="crondate" title="<?php p($absolute_time);?>">
- <?php p($l->t("Last cron job execution: %s.", [$relative_time]));?>
- </span>
- <?php else: ?>
- <span class="status error"></span>
- <span class="crondate" title="<?php p($absolute_time);?>">
- <?php p($l->t("Last cron job execution: %s. Something seems wrong.", [$relative_time]));?>
- </span>
- <?php endif;
- else: ?>
- <span class="status error"></span>
- <?php p($l->t("Cron was not executed yet!"));
- endif; ?>
- </p>
- <?php endif; ?>
- <a target="_blank" rel="noreferrer" class="icon-info"
- title="<?php p($l->t('Open documentation'));?>"
- href="<?php p(link_to_docs('admin-background-jobs')); ?>"></a>
-
- <p>
- <input type="radio" name="mode" value="ajax" class="radio"
- id="backgroundjobs_ajax" <?php if ($_['backgroundjobs_mode'] === "ajax") {
- print_unescaped('checked="checked"');
- } ?>>
- <label for="backgroundjobs_ajax">AJAX</label><br/>
- <em><?php p($l->t("Execute one task with each page loaded")); ?></em>
- </p>
- <p>
- <input type="radio" name="mode" value="webcron" class="radio"
- id="backgroundjobs_webcron" <?php if ($_['backgroundjobs_mode'] === "webcron") {
- print_unescaped('checked="checked"');
- } ?>>
- <label for="backgroundjobs_webcron">Webcron</label><br/>
- <em><?php p($l->t("cron.php is registered at a webcron service to call cron.php every 15 minutes over http.")); ?></em>
- </p>
- <p>
- <input type="radio" name="mode" value="cron" class="radio"
- id="backgroundjobs_cron" <?php if ($_['backgroundjobs_mode'] === "cron") {
- print_unescaped('checked="checked"');
- } ?>>
- <label for="backgroundjobs_cron">Cron</label><br/>
- <em><?php p($l->t("Use system's cron service to call the cron.php file every 15 minutes.")); ?></em>
- </p>
-</div>
-
-<div class="section" id='encryptionAPI'>
- <h2><?php p($l->t('Server-side encryption')); ?></h2>
- <a target="_blank" rel="noreferrer" class="icon-info"
- title="<?php p($l->t('Open documentation'));?>"
- href="<?php p(link_to_docs('admin-encryption')); ?>"></a>
-
- <p id="enable">
- <input type="checkbox"
- id="enableEncryption" class="checkbox"
- value="1" <?php if ($_['encryptionEnabled']) print_unescaped('checked="checked" disabled="disabled"'); ?> />
- <label
- for="enableEncryption"><?php p($l->t('Enable server-side encryption')); ?> <span id="startmigration_msg" class="msg"></span> </label><br/>
- </p>
-
- <div id="EncryptionWarning" class="warning hidden">
- <p><?php p($l->t('Please read carefully before activating server-side encryption: ')); ?></p>
- <ul>
- <li><?php p($l->t('Once encryption is enabled, all files uploaded to the server from that point forward will be encrypted at rest on the server. It will only be possible to disable encryption at a later date if the active encryption module supports that function, and all pre-conditions (e.g. setting a recover key) are met.')); ?></li>
- <li><?php p($l->t('Encryption alone does not guarantee security of the system. Please see documentation for more information about how the encryption app works, and the supported use cases.')); ?></li>
- <li><?php p($l->t('Be aware that encryption always increases the file size.')); ?></li>
- <li><?php p($l->t('It is always good to create regular backups of your data, in case of encryption make sure to backup the encryption keys along with your data.')); ?></li>
- </ul>
-
- <p><?php p($l->t('This is the final warning: Do you really want to enable encryption?')) ?> <input type="button"
- id="reallyEnableEncryption"
- value="<?php p($l->t("Enable encryption")); ?>" /></p>
- </div>
-
- <div id="EncryptionSettingsArea" class="<?php if (!$_['encryptionEnabled']) p('hidden'); ?>">
- <div id='selectEncryptionModules' class="<?php if (!$_['encryptionReady']) p('hidden'); ?>">
- <?php
- if (empty($_['encryptionModules'])) {
- p($l->t('No encryption module loaded, please enable an encryption module in the app menu.'));
- } else { ?>
- <h3><?php p($l->t('Select default encryption module:')) ?></h3>
- <fieldset id='encryptionModules'>
- <?php foreach ($_['encryptionModules'] as $id => $module): ?>
- <input type="radio" id="<?php p($id) ?>"
- name="default_encryption_module"
- value="<?php p($id) ?>"
- <?php if ($module['default']) {
- p('checked');
- } ?>>
- <label
- for="<?php p($id) ?>"><?php p($module['displayName']) ?></label>
- <br/>
-
- <?php if ($id === 'OC_DEFAULT_MODULE') print_unescaped($_['ocDefaultEncryptionModulePanel']); ?>
- <?php endforeach; ?>
- </fieldset>
- <?php } ?>
- </div>
- <div id="migrationWarning" class="<?php if ($_['encryptionReady']) p('hidden'); ?>">
- <?php
- if ($_['encryptionReady'] === false && $_['externalBackendsEnabled'] === true) {
- p($l->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.')); ?>
- <input type="submit" name="startmigration" id="startmigration"
- value="<?php p($l->t('Start migration')); ?>"/>
- <?php } ?>
- </div>
- </div>
-</div>
-
-<div class="section" id="mail_general_settings">
- <form id="mail_general_settings_form" class="mail_settings">
- <h2><?php p($l->t('Email server'));?></h2>
- <a target="_blank" rel="noreferrer" class="icon-info"
- title="<?php p($l->t('Open documentation'));?>"
- href="<?php p(link_to_docs('admin-email')); ?>"></a>
-
- <p><?php p($l->t('This is used for sending out notifications.')); ?> <span id="mail_settings_msg" class="msg"></span></p>
-
- <p>
- <label for="mail_smtpmode"><?php p($l->t( 'Send mode' )); ?></label>
- <select name='mail_smtpmode' id='mail_smtpmode'>
- <?php foreach ($mail_smtpmode as $smtpmode):
- $selected = '';
- if ($smtpmode == $_['mail_smtpmode']):
- $selected = 'selected="selected"';
- endif; ?>
- <option value='<?php p($smtpmode)?>' <?php p($selected) ?>><?php p($smtpmode) ?></option>
- <?php endforeach;?>
- </select>
-
- <label id="mail_smtpsecure_label" for="mail_smtpsecure"
- <?php if ($_['mail_smtpmode'] != 'smtp') print_unescaped(' class="hidden"'); ?>>
- <?php p($l->t( 'Encryption' )); ?>
- </label>
- <select name="mail_smtpsecure" id="mail_smtpsecure"
- <?php if ($_['mail_smtpmode'] != 'smtp') print_unescaped(' class="hidden"'); ?>>
- <?php foreach ($mail_smtpsecure as $secure => $name):
- $selected = '';
- if ($secure == $_['mail_smtpsecure']):
- $selected = 'selected="selected"';
- endif; ?>
- <option value='<?php p($secure)?>' <?php p($selected) ?>><?php p($name) ?></option>
- <?php endforeach;?>
- </select>
- </p>
-
- <p>
- <label for="mail_from_address"><?php p($l->t( 'From address' )); ?></label>
- <input type="text" name='mail_from_address' id="mail_from_address" placeholder="<?php p($l->t('mail'))?>"
- value='<?php p($_['mail_from_address']) ?>' />@
- <input type="text" name='mail_domain' id="mail_domain" placeholder="example.com"
- value='<?php p($_['mail_domain']) ?>' />
- </p>
-
- <p id="setting_smtpauth" <?php if ($_['mail_smtpmode'] != 'smtp') print_unescaped(' class="hidden"'); ?>>
- <label for="mail_smtpauthtype"><?php p($l->t( 'Authentication method' )); ?></label>
- <select name='mail_smtpauthtype' id='mail_smtpauthtype'>
- <?php foreach ($mail_smtpauthtype as $authtype => $name):
- $selected = '';
- if ($authtype == $_['mail_smtpauthtype']):
- $selected = 'selected="selected"';
- endif; ?>
- <option value='<?php p($authtype)?>' <?php p($selected) ?>><?php p($name) ?></option>
- <?php endforeach;?>
- </select>
-
- <input type="checkbox" name="mail_smtpauth" id="mail_smtpauth" class="checkbox" value="1"
- <?php if ($_['mail_smtpauth']) print_unescaped('checked="checked"'); ?> />
- <label for="mail_smtpauth"><?php p($l->t( 'Authentication required' )); ?></label>
- </p>
-
- <p id="setting_smtphost" <?php if ($_['mail_smtpmode'] != 'smtp') print_unescaped(' class="hidden"'); ?>>
- <label for="mail_smtphost"><?php p($l->t( 'Server address' )); ?></label>
- <input type="text" name='mail_smtphost' id="mail_smtphost" placeholder="smtp.example.com"
- value='<?php p($_['mail_smtphost']) ?>' />
- :
- <input type="text" name='mail_smtpport' id="mail_smtpport" placeholder="<?php p($l->t('Port'))?>"
- value='<?php p($_['mail_smtpport']) ?>' />
- </p>
- </form>
- <form class="mail_settings" id="mail_credentials_settings">
- <p id="mail_credentials" <?php if (!$_['mail_smtpauth'] || $_['mail_smtpmode'] != 'smtp') print_unescaped(' class="hidden"'); ?>>
- <label for="mail_smtpname"><?php p($l->t( 'Credentials' )); ?></label>
- <input type="text" name='mail_smtpname' id="mail_smtpname" placeholder="<?php p($l->t('SMTP Username'))?>"
- value='<?php p($_['mail_smtpname']) ?>' />
- <input type="password" name='mail_smtppassword' id="mail_smtppassword" autocomplete="off"
- placeholder="<?php p($l->t('SMTP Password'))?>" value='<?php p($_['mail_smtppassword']) ?>' />
- <input id="mail_credentials_settings_submit" type="button" value="<?php p($l->t('Store credentials')) ?>">
- </p>
- </form>
-
- <br />
- <em><?php p($l->t( 'Test email settings' )); ?></em>
- <input type="submit" name="sendtestemail" id="sendtestemail" value="<?php p($l->t( 'Send email' )); ?>"/>
- <span id="sendtestmail_msg" class="msg"></span>
-</div>
-
-<div class="section" id="log-section">
- <h2><?php p($l->t('Log'));?></h2>
-<?php if ($_['showLog'] && $_['doesLogFileExist']): ?>
- <table id="log" class="grid">
- <?php foreach ($_['entries'] as $entry): ?>
- <tr>
- <td>
- <?php p($levels[$entry->level]);?>
- </td>
- <td>
- <?php p($entry->app);?>
- </td>
- <td class="log-message">
- <?php p($entry->message);?>
- </td>
- <td class="date">
- <?php if(is_int($entry->time)){
- p(OC_Util::formatDate($entry->time));
- } else {
- p($entry->time);
- }?>
- </td>
- <td><?php isset($entry->user) ? p($entry->user) : p('--') ?></td>
- </tr>
- <?php endforeach;?>
- </table>
- <p><?php p($l->t('What to log'));?> <select name='loglevel' id='loglevel'>
- <?php for ($i = 0; $i < 5; $i++):
- $selected = '';
- if ($i == $_['loglevel']):
- $selected = 'selected="selected"';
- endif; ?>
- <option value='<?php p($i)?>' <?php p($selected) ?>><?php p($levelLabels[$i])?></option>
- <?php endfor;?>
- </select></p>
-
- <?php if ($_['logFileSize'] > 0): ?>
- <a href="<?php print_unescaped(OC::$server->getURLGenerator()->linkToRoute('settings.LogSettings.download')); ?>" class="button" id="downloadLog"><?php p($l->t('Download logfile'));?></a>
- <?php endif; ?>
- <?php if ($_['entriesremain']): ?>
- <input id="moreLog" type="button" value="<?php p($l->t('More'));?>...">
- <input id="lessLog" type="button" value="<?php p($l->t('Less'));?>...">
- <?php endif; ?>
- <?php if ($_['logFileSize'] > (100 * 1024 * 1024)): ?>
- <br>
- <em>
- <?php p($l->t('The logfile is bigger than 100 MB. Downloading it may take some time!')); ?>
- </em>
- <?php endif; ?>
- <?php endif; ?>
-</div>
-
-<div class="section" id="admin-tips">
- <h2><?php p($l->t('Tips & tricks'));?></h2>
- <ul>
- <?php
- // SQLite database performance issue
- if ($_['databaseOverload']) {
- ?>
- <li>
- <?php p($l->t('SQLite is used as database. For larger installations we recommend to switch to a different database backend.')); ?><br>
- <?php p($l->t('Especially when using the desktop client for file syncing the use of SQLite is discouraged.')); ?><br>
- <?php print_unescaped($l->t('To migrate to another database use the command line tool: \'occ db:convert-type\', or see the <a target="_blank" rel="noreferrer" href="%s">documentation ↗</a>.', link_to_docs('admin-db-conversion') )); ?>
- </li>
- <?php } ?>
- <li><a target="_blank" rel="noreferrer" href="<?php p(link_to_docs('admin-backup')); ?>"><?php p($l->t('How to do backups'));?> ↗</a></li>
- <li><a target="_blank" rel="noreferrer" href="<?php p(link_to_docs('admin-monitoring')); ?>"><?php p($l->t('Advanced monitoring'));?> ↗</a></li>
- <li><a target="_blank" rel="noreferrer" href="<?php p(link_to_docs('admin-performance')); ?>"><?php p($l->t('Performance tuning'));?> ↗</a></li>
- <li><a target="_blank" rel="noreferrer" href="<?php p(link_to_docs('admin-config')); ?>"><?php p($l->t('Improving the config.php'));?> ↗</a></li>
- <li><a target="_blank" rel="noreferrer" href="<?php p(link_to_docs('developer-theming')); ?>"><?php p($l->t('Theming'));?> ↗</a></li>
- <li><a target="_blank" rel="noreferrer" href="<?php p(link_to_docs('admin-security')); ?>"><?php p($l->t('Hardening and security guidance'));?> ↗</a></li>
- </ul>
-</div>
-
-<?php if (!empty($_['updaterAppPanel'])): ?>
- <div id="updater"><?php print_unescaped($_['updaterAppPanel']); ?></div>
-<?php endif; ?>
-
-<div class="section">
- <h2><?php p($l->t('Version'));?></h2>
- <p><a href="<?php print_unescaped($theme->getBaseUrl()); ?>" rel="noreferrer" target="_blank"><?php p($theme->getTitle()); ?></a> <?php p(OC_Util::getHumanVersion()) ?></p>
- <p><?php include('settings.development.notice.php'); ?></p>
-</div>
-
-
-
-
-</div>
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 @@
+<?php
+/**
+ * @copyright Copyright (c) 2016 Arthur Schiwon <blizzz@arthur-schiwon.de>
+ *
+ * @author Arthur Schiwon <blizzz@arthur-schiwon.de>
+ *
+ * @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 <http://www.gnu.org/licenses/>.
+ *
+ */
+
+/** @var \OCP\IL10N $l */
+/** @var array $_ */
+
+?>
+
+<div class="section" id='encryptionAPI'>
+ <h2><?php p($l->t('Server-side encryption')); ?></h2>
+ <a target="_blank" rel="noreferrer" class="icon-info"
+ title="<?php p($l->t('Open documentation'));?>"
+ href="<?php p(link_to_docs('admin-encryption')); ?>"></a>
+
+ <p id="enable">
+ <input type="checkbox"
+ id="enableEncryption" class="checkbox"
+ value="1" <?php if ($_['encryptionEnabled']) print_unescaped('checked="checked" disabled="disabled"'); ?> />
+ <label
+ for="enableEncryption"><?php p($l->t('Enable server-side encryption')); ?> <span id="startmigration_msg" class="msg"></span> </label><br/>
+ </p>
+
+ <div id="EncryptionWarning" class="warning hidden">
+ <p><?php p($l->t('Please read carefully before activating server-side encryption: ')); ?></p>
+ <ul>
+ <li><?php p($l->t('Once encryption is enabled, all files uploaded to the server from that point forward will be encrypted at rest on the server. It will only be possible to disable encryption at a later date if the active encryption module supports that function, and all pre-conditions (e.g. setting a recover key) are met.')); ?></li>
+ <li><?php p($l->t('Encryption alone does not guarantee security of the system. Please see documentation for more information about how the encryption app works, and the supported use cases.')); ?></li>
+ <li><?php p($l->t('Be aware that encryption always increases the file size.')); ?></li>
+ <li><?php p($l->t('It is always good to create regular backups of your data, in case of encryption make sure to backup the encryption keys along with your data.')); ?></li>
+ </ul>
+
+ <p><?php p($l->t('This is the final warning: Do you really want to enable encryption?')) ?> <input type="button"
+ id="reallyEnableEncryption"
+ value="<?php p($l->t("Enable encryption")); ?>" /></p>
+ </div>
+
+ <div id="EncryptionSettingsArea" class="<?php if (!$_['encryptionEnabled']) p('hidden'); ?>">
+ <div id='selectEncryptionModules' class="<?php if (!$_['encryptionReady']) p('hidden'); ?>">
+ <?php
+ if (empty($_['encryptionModules'])) {
+ p($l->t('No encryption module loaded, please enable an encryption module in the app menu.'));
+ } else { ?>
+ <h3><?php p($l->t('Select default encryption module:')) ?></h3>
+ <fieldset id='encryptionModules'>
+ <?php foreach ($_['encryptionModules'] as $id => $module): ?>
+ <input type="radio" id="<?php p($id) ?>"
+ name="default_encryption_module"
+ value="<?php p($id) ?>"
+ <?php if ($module['default']) {
+ p('checked');
+ } ?>>
+ <label
+ for="<?php p($id) ?>"><?php p($module['displayName']) ?></label>
+ <br/>
+
+ <?php if ($id === 'OC_DEFAULT_MODULE') print_unescaped($_['ocDefaultEncryptionModulePanel']); ?>
+ <?php endforeach; ?>
+ </fieldset>
+ <?php } ?>
+ </div>
+ <div id="migrationWarning" class="<?php if ($_['encryptionReady']) p('hidden'); ?>">
+ <?php
+ if ($_['encryptionReady'] === false && $_['externalBackendsEnabled'] === true) {
+ p($l->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.')); ?>
+ <input type="submit" name="startmigration" id="startmigration"
+ value="<?php p($l->t('Start migration')); ?>"/>
+ <?php } ?>
+ </div>
+ </div>
+</div>
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 @@
+<?php
+/**
+ * @copyright Copyright (c) 2016 Arthur Schiwon <blizzz@arthur-schiwon.de>
+ *
+ * @author Arthur Schiwon <blizzz@arthur-schiwon.de>
+ *
+ * @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 <http://www.gnu.org/licenses/>.
+ *
+ */
+
+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');
+
+?>
+
+<div id="app-navigation">
+ <ul>
+ <?php foreach($_['forms'] as $form) {
+ if (isset($form['anchor'])) {
+ $anchor = \OC::$server->getURLGenerator()->linkToRoute('settings.AdminSettings.index', ['section' => $form['anchor']]);
+ $sectionName = $form['section-name'];
+ print_unescaped(sprintf("<li><a href='%s'>%s</a></li>", \OCP\Util::sanitizeHTML($anchor), \OCP\Util::sanitizeHTML($sectionName)));
+ }
+ }?>
+ </ul>
+</div>
+
+<div id="app-content">
+ <?php print_unescaped($_['content']); ?>
+</div>
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 @@
+<?php
+/**
+ * @copyright Copyright (c) 2016 Arthur Schiwon <blizzz@arthur-schiwon.de>
+ *
+ * @author Arthur Schiwon <blizzz@arthur-schiwon.de>
+ *
+ * @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 <http://www.gnu.org/licenses/>.
+ *
+ */
+
+/** @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' ),
+];
+
+?>
+
+<div class="section" id="log-section">
+ <h2><?php p($l->t('Log'));?></h2>
+ <?php if ($_['showLog'] && $_['doesLogFileExist']): ?>
+ <table id="log" class="grid">
+ <?php foreach ($_['entries'] as $entry): ?>
+ <tr>
+ <td>
+ <?php p($levels[$entry->level]);?>
+ </td>
+ <td>
+ <?php p($entry->app);?>
+ </td>
+ <td class="log-message">
+ <?php p($entry->message);?>
+ </td>
+ <td class="date">
+ <?php if(is_int($entry->time)){
+ p(OC_Util::formatDate($entry->time));
+ } else {
+ p($entry->time);
+ }?>
+ </td>
+ <td><?php isset($entry->user) ? p($entry->user) : p('--') ?></td>
+ </tr>
+ <?php endforeach;?>
+ </table>
+ <p><?php p($l->t('What to log'));?> <select name='loglevel' id='loglevel'>
+ <?php for ($i = 0; $i < 5; $i++):
+ $selected = '';
+ if ($i == $_['loglevel']):
+ $selected = 'selected="selected"';
+ endif; ?>
+ <option value='<?php p($i)?>' <?php p($selected) ?>><?php p($levelLabels[$i])?></option>
+ <?php endfor;?>
+ </select></p>
+
+ <?php if ($_['logFileSize'] > 0): ?>
+ <a href="<?php print_unescaped(OC::$server->getURLGenerator()->linkToRoute('settings.LogSettings.download')); ?>" class="button" id="downloadLog"><?php p($l->t('Download logfile'));?></a>
+ <?php endif; ?>
+ <?php if ($_['entriesremain']): ?>
+ <input id="moreLog" type="button" value="<?php p($l->t('More'));?>...">
+ <input id="lessLog" type="button" value="<?php p($l->t('Less'));?>...">
+ <?php endif; ?>
+ <?php if ($_['logFileSize'] > (100 * 1024 * 1024)): ?>
+ <br>
+ <em>
+ <?php p($l->t('The logfile is bigger than 100 MB. Downloading it may take some time!')); ?>
+ </em>
+ <?php endif; ?>
+ <?php endif; ?>
+</div>
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 @@
+<?php
+/**
+ * @copyright Copyright (c) 2016 Arthur Schiwon <blizzz@arthur-schiwon.de>
+ *
+ * @author Arthur Schiwon <blizzz@arthur-schiwon.de>
+ *
+ * @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 <http://www.gnu.org/licenses/>.
+ *
+ */
+
+/** @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';
+}
+?>
+
+<div id="security-warning" class="section">
+ <h2><?php p($l->t('Security & setup warnings'));?></h2>
+ <ul>
+ <?php
+ // is php setup properly to query system environment variables like getenv('PATH')
+ if ($_['getenvServerNotWorking']) {
+ ?>
+ <li>
+ <?php p($l->t('php does not seem to be setup properly to query system environment variables. The test with getenv("PATH") only returns an empty response.')); ?><br>
+ <?php print_unescaped($l->t('Please check the <a target="_blank" rel="noreferrer" href="%s">installation documentation ↗</a> for php configuration notes and the php configuration of your server, especially when using php-fpm.', link_to_docs('admin-php-fpm'))); ?>
+ </li>
+ <?php
+ }
+
+ // is read only config enabled
+ if ($_['readOnlyConfigEnabled']) {
+ ?>
+ <li>
+ <?php p($l->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.')); ?>
+ </li>
+ <?php
+ }
+
+ // Are doc blocks accessible?
+ if (!$_['isAnnotationsWorking']) {
+ ?>
+ <li>
+ <?php p($l->t('PHP is apparently setup to strip inline doc blocks. This will make several core apps inaccessible.')); ?><br>
+ <?php p($l->t('This is probably caused by a cache/accelerator such as Zend OPcache or eAccelerator.')); ?>
+ </li>
+ <?php
+ }
+
+ // Is the Transaction isolation level READ_COMMITTED?
+ if ($_['invalidTransactionIsolationLevel']) {
+ ?>
+ <li>
+ <?php p($l->t('Your database does not run with "READ COMMITTED" transaction isolation level. This can cause problems when multiple actions are executed in parallel.')); ?>
+ </li>
+ <?php
+ }
+
+ // Warning if memcache is outdated
+ foreach ($_['OutdatedCacheWarning'] as $php_module => $data) {
+ ?>
+ <li>
+ <?php p($l->t('%1$s below version %2$s is installed, for stability and performance reasons we recommend updating to a newer %1$s version.', $data)); ?>
+ </li>
+ <?php
+ }
+
+ // if module fileinfo available?
+ if (!$_['has_fileinfo']) {
+ ?>
+ <li>
+ <?php p($l->t('The PHP module \'fileinfo\' is missing. We strongly recommend to enable this module to get best results with mime-type detection.')); ?>
+ </li>
+ <?php
+ }
+
+ // locking configured optimally?
+ if ($_['fileLockingType'] === 'none') {
+ ?>
+ <li>
+ <?php print_unescaped($l->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 <a target="_blank" rel="noreferrer" href="%s">documentation ↗</a> for more information.', link_to_docs('admin-transactional-locking'))); ?>
+ </li>
+ <?php
+ }
+
+ // is locale working ?
+ if (!$_['isLocaleWorking']) {
+ ?>
+ <li>
+ <?php
+ $locales = 'en_US.UTF-8/fr_FR.UTF-8/es_ES.UTF-8/de_DE.UTF-8/ru_RU.UTF-8/pt_BR.UTF-8/it_IT.UTF-8/ja_JP.UTF-8/zh_CN.UTF-8';
+ p($l->t('System locale can not be set to a one which supports UTF-8.'));
+ ?>
+ <br>
+ <?php
+ p($l->t('This means that there might be problems with certain characters in file names.'));
+ ?>
+ <br>
+ <?php
+ p($l->t('We strongly suggest installing the required packages on your system to support one of the following locales: %s.', [$locales]));
+ ?>
+ </li>
+ <?php
+ }
+
+ if ($_['suggestedOverwriteCliUrl']) {
+ ?>
+ <li>
+ <?php p($l->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'])); ?>
+ </li>
+ <?php
+ }
+
+ if ($_['cronErrors']) {
+ ?>
+ <li>
+ <?php p($l->t('It was not possible to execute the cronjob via CLI. The following technical errors have appeared:')); ?>
+ <br>
+ <ol>
+ <?php foreach(json_decode($_['cronErrors']) as $error) { if(isset($error->error)) {?>
+ <li><?php p($error->error) ?> <?php p($error->hint) ?></li>
+ <?php }};?>
+ </ol>
+ </li>
+ <?php
+ }
+ ?>
+ </ul>
+
+ <div id="postsetupchecks" data-check-wellknown="<?php if($_['checkForWorkingWellKnownSetup']) { p('true'); } else { p('false'); } ?>">
+ <div class="loading"></div>
+ <ul class="errors hidden"></ul>
+ <ul class="warnings hidden"></ul>
+ <ul class="info hidden"></ul>
+ <p class="hint hidden">
+ <?php print_unescaped($l->t('Please double check the <a target="_blank" rel="noreferrer" href="%s">installation guides ↗</a>, and check for any errors or warnings in the <a href="#log-section">log</a>.', link_to_docs('admin-install'))); ?>
+ </p>
+ </div>
+ <div id="security-warning-state">
+ <span class="hidden icon-checkmark"><?php p($l->t('All checks passed.'));?></span>
+ </div>
+</div>
+
+<div class="section" id="backgroundjobs">
+ <h2 class="inlineblock"><?php p($l->t('Cron'));?></h2>
+ <?php if ($_['cron_log']): ?>
+ <p class="cronlog inlineblock">
+ <?php if ($_['lastcron'] !== false):
+ $relative_time = relative_modified_date($_['lastcron']);
+ $absolute_time = OC_Util::formatDate($_['lastcron']);
+ if (time() - $_['lastcron'] <= 3600): ?>
+ <span class="status success"></span>
+ <span class="crondate" title="<?php p($absolute_time);?>">
+ <?php p($l->t("Last cron job execution: %s.", [$relative_time]));?>
+ </span>
+ <?php else: ?>
+ <span class="status error"></span>
+ <span class="crondate" title="<?php p($absolute_time);?>">
+ <?php p($l->t("Last cron job execution: %s. Something seems wrong.", [$relative_time]));?>
+ </span>
+ <?php endif;
+ else: ?>
+ <span class="status error"></span>
+ <?php p($l->t("Cron was not executed yet!"));
+ endif; ?>
+ </p>
+ <?php endif; ?>
+ <a target="_blank" rel="noreferrer" class="icon-info"
+ title="<?php p($l->t('Open documentation'));?>"
+ href="<?php p(link_to_docs('admin-background-jobs')); ?>"></a>
+
+ <p>
+ <input type="radio" name="mode" value="ajax" class="radio"
+ id="backgroundjobs_ajax" <?php if ($_['backgroundjobs_mode'] === "ajax") {
+ print_unescaped('checked="checked"');
+ } ?>>
+ <label for="backgroundjobs_ajax">AJAX</label><br/>
+ <em><?php p($l->t("Execute one task with each page loaded")); ?></em>
+ </p>
+ <p>
+ <input type="radio" name="mode" value="webcron" class="radio"
+ id="backgroundjobs_webcron" <?php if ($_['backgroundjobs_mode'] === "webcron") {
+ print_unescaped('checked="checked"');
+ } ?>>
+ <label for="backgroundjobs_webcron">Webcron</label><br/>
+ <em><?php p($l->t("cron.php is registered at a webcron service to call cron.php every 15 minutes over http.")); ?></em>
+ </p>
+ <p>
+ <input type="radio" name="mode" value="cron" class="radio"
+ id="backgroundjobs_cron" <?php if ($_['backgroundjobs_mode'] === "cron") {
+ print_unescaped('checked="checked"');
+ } ?>>
+ <label for="backgroundjobs_cron">Cron</label><br/>
+ <em><?php p($l->t("Use system's cron service to call the cron.php file every 15 minutes.")); ?></em>
+ </p>
+</div>
+
+<div class="section" id="mail_general_settings">
+ <form id="mail_general_settings_form" class="mail_settings">
+ <h2><?php p($l->t('Email server'));?></h2>
+ <a target="_blank" rel="noreferrer" class="icon-info"
+ title="<?php p($l->t('Open documentation'));?>"
+ href="<?php p(link_to_docs('admin-email')); ?>"></a>
+
+ <p><?php p($l->t('This is used for sending out notifications.')); ?> <span id="mail_settings_msg" class="msg"></span></p>
+
+ <p>
+ <label for="mail_smtpmode"><?php p($l->t( 'Send mode' )); ?></label>
+ <select name='mail_smtpmode' id='mail_smtpmode'>
+ <?php foreach ($mail_smtpmode as $smtpmode):
+ $selected = '';
+ if ($smtpmode == $_['mail_smtpmode']):
+ $selected = 'selected="selected"';
+ endif; ?>
+ <option value='<?php p($smtpmode)?>' <?php p($selected) ?>><?php p($smtpmode) ?></option>
+ <?php endforeach;?>
+ </select>
+
+ <label id="mail_smtpsecure_label" for="mail_smtpsecure"
+ <?php if ($_['mail_smtpmode'] != 'smtp') print_unescaped(' class="hidden"'); ?>>
+ <?php p($l->t( 'Encryption' )); ?>
+ </label>
+ <select name="mail_smtpsecure" id="mail_smtpsecure"
+ <?php if ($_['mail_smtpmode'] != 'smtp') print_unescaped(' class="hidden"'); ?>>
+ <?php foreach ($mail_smtpsecure as $secure => $name):
+ $selected = '';
+ if ($secure == $_['mail_smtpsecure']):
+ $selected = 'selected="selected"';
+ endif; ?>
+ <option value='<?php p($secure)?>' <?php p($selected) ?>><?php p($name) ?></option>
+ <?php endforeach;?>
+ </select>
+ </p>
+
+ <p>
+ <label for="mail_from_address"><?php p($l->t( 'From address' )); ?></label>
+ <input type="text" name='mail_from_address' id="mail_from_address" placeholder="<?php p($l->t('mail'))?>"
+ value='<?php p($_['mail_from_address']) ?>' />@
+ <input type="text" name='mail_domain' id="mail_domain" placeholder="example.com"
+ value='<?php p($_['mail_domain']) ?>' />
+ </p>
+
+ <p id="setting_smtpauth" <?php if ($_['mail_smtpmode'] != 'smtp') print_unescaped(' class="hidden"'); ?>>
+ <label for="mail_smtpauthtype"><?php p($l->t( 'Authentication method' )); ?></label>
+ <select name='mail_smtpauthtype' id='mail_smtpauthtype'>
+ <?php foreach ($mail_smtpauthtype as $authtype => $name):
+ $selected = '';
+ if ($authtype == $_['mail_smtpauthtype']):
+ $selected = 'selected="selected"';
+ endif; ?>
+ <option value='<?php p($authtype)?>' <?php p($selected) ?>><?php p($name) ?></option>
+ <?php endforeach;?>
+ </select>
+
+ <input type="checkbox" name="mail_smtpauth" id="mail_smtpauth" class="checkbox" value="1"
+ <?php if ($_['mail_smtpauth']) print_unescaped('checked="checked"'); ?> />
+ <label for="mail_smtpauth"><?php p($l->t( 'Authentication required' )); ?></label>
+ </p>
+
+ <p id="setting_smtphost" <?php if ($_['mail_smtpmode'] != 'smtp') print_unescaped(' class="hidden"'); ?>>
+ <label for="mail_smtphost"><?php p($l->t( 'Server address' )); ?></label>
+ <input type="text" name='mail_smtphost' id="mail_smtphost" placeholder="smtp.example.com"
+ value='<?php p($_['mail_smtphost']) ?>' />
+ :
+ <input type="text" name='mail_smtpport' id="mail_smtpport" placeholder="<?php p($l->t('Port'))?>"
+ value='<?php p($_['mail_smtpport']) ?>' />
+ </p>
+ </form>
+ <form class="mail_settings" id="mail_credentials_settings">
+ <p id="mail_credentials" <?php if (!$_['mail_smtpauth'] || $_['mail_smtpmode'] != 'smtp') print_unescaped(' class="hidden"'); ?>>
+ <label for="mail_smtpname"><?php p($l->t( 'Credentials' )); ?></label>
+ <input type="text" name='mail_smtpname' id="mail_smtpname" placeholder="<?php p($l->t('SMTP Username'))?>"
+ value='<?php p($_['mail_smtpname']) ?>' />
+ <input type="password" name='mail_smtppassword' id="mail_smtppassword" autocomplete="off"
+ placeholder="<?php p($l->t('SMTP Password'))?>" value='<?php p($_['mail_smtppassword']) ?>' />
+ <input id="mail_credentials_settings_submit" type="button" value="<?php p($l->t('Store credentials')) ?>">
+ </p>
+ </form>
+
+ <br />
+ <em><?php p($l->t( 'Test email settings' )); ?></em>
+ <input type="submit" name="sendtestemail" id="sendtestemail" value="<?php p($l->t( 'Send email' )); ?>"/>
+ <span id="sendtestmail_msg" class="msg"></span>
+</div>
+
+<div class="section">
+ <h2><?php p($l->t('Version'));?></h2>
+ <p><a href="<?php print_unescaped($theme->getBaseUrl()); ?>" rel="noreferrer" target="_blank"><?php p($theme->getTitle()); ?></a> <?php p(OC_Util::getHumanVersion()) ?></p>
+ <p><?php include(__DIR__ . '/../settings.development.notice.php'); ?></p>
+</div>
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 @@
+<?php
+/**
+ * @copyright Copyright (c) 2016 Arthur Schiwon <blizzz@arthur-schiwon.de>
+ *
+ * @author Arthur Schiwon <blizzz@arthur-schiwon.de>
+ *
+ * @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 <http://www.gnu.org/licenses/>.
+ *
+ */
+
+/** @var \OCP\IL10N $l */
+/** @var array $_ */
+
+?>
+
+<div class="section" id="shareAPI">
+ <h2><?php p($l->t('Sharing'));?></h2>
+ <a target="_blank" rel="noreferrer" class="icon-info"
+ title="<?php p($l->t('Open documentation'));?>"
+ href="<?php p(link_to_docs('admin-sharing')); ?>"></a>
+ <p id="enable">
+ <input type="checkbox" name="shareapi_enabled" id="shareAPIEnabled" class="checkbox"
+ value="1" <?php if ($_['shareAPIEnabled'] === 'yes') print_unescaped('checked="checked"'); ?> />
+ <label for="shareAPIEnabled"><?php p($l->t('Allow apps to use the Share API'));?></label><br/>
+ </p>
+ <p class="<?php if ($_['shareAPIEnabled'] === 'no') p('hidden');?>">
+ <input type="checkbox" name="shareapi_allow_links" id="allowLinks" class="checkbox"
+ value="1" <?php if ($_['allowLinks'] === 'yes') print_unescaped('checked="checked"'); ?> />
+ <label for="allowLinks"><?php p($l->t('Allow users to share via link'));?></label><br/>
+ </p>
+
+ <p id="publicLinkSettings" class="indent <?php if ($_['allowLinks'] !== 'yes' || $_['shareAPIEnabled'] === 'no') p('hidden'); ?>">
+ <input type="checkbox" name="shareapi_allow_public_upload" id="allowPublicUpload" class="checkbox"
+ value="1" <?php if ($_['allowPublicUpload'] == 'yes') print_unescaped('checked="checked"'); ?> />
+ <label for="allowPublicUpload"><?php p($l->t('Allow public uploads'));?></label><br/>
+
+ <input type="checkbox" name="shareapi_enforce_links_password" id="enforceLinkPassword" class="checkbox"
+ value="1" <?php if ($_['enforceLinkPassword']) print_unescaped('checked="checked"'); ?> />
+ <label for="enforceLinkPassword"><?php p($l->t('Enforce password protection'));?></label><br/>
+
+ <input type="checkbox" name="shareapi_default_expire_date" id="shareapiDefaultExpireDate" class="checkbox"
+ value="1" <?php if ($_['shareDefaultExpireDateSet'] === 'yes') print_unescaped('checked="checked"'); ?> />
+ <label for="shareapiDefaultExpireDate"><?php p($l->t('Set default expiration date'));?></label><br/>
+
+ <input type="checkbox" name="shareapi_allow_public_notification" id="allowPublicMailNotification" class="checkbox"
+ value="1" <?php if ($_['allowPublicMailNotification'] == 'yes') print_unescaped('checked="checked"'); ?> />
+ <label for="allowPublicMailNotification"><?php p($l->t('Allow users to send mail notification for shared files'));?></label><br/>
+
+ </p>
+ <p id="setDefaultExpireDate" class="double-indent <?php if ($_['allowLinks'] !== 'yes' || $_['shareDefaultExpireDateSet'] === 'no' || $_['shareAPIEnabled'] === 'no') p('hidden');?>">
+ <?php p($l->t( 'Expire after ' )); ?>
+ <input type="text" name='shareapi_expire_after_n_days' id="shareapiExpireAfterNDays" placeholder="<?php p('7')?>"
+ value='<?php p($_['shareExpireAfterNDays']) ?>' />
+ <?php p($l->t( 'days' )); ?>
+ <input type="checkbox" name="shareapi_enforce_expire_date" id="shareapiEnforceExpireDate" class="checkbox"
+ value="1" <?php if ($_['shareEnforceExpireDate'] === 'yes') print_unescaped('checked="checked"'); ?> />
+ <label for="shareapiEnforceExpireDate"><?php p($l->t('Enforce expiration date'));?></label><br/>
+ </p>
+ <p class="<?php if ($_['shareAPIEnabled'] === 'no') p('hidden');?>">
+ <input type="checkbox" name="shareapi_allow_resharing" id="allowResharing" class="checkbox"
+ value="1" <?php if ($_['allowResharing'] === 'yes') print_unescaped('checked="checked"'); ?> />
+ <label for="allowResharing"><?php p($l->t('Allow resharing'));?></label><br/>
+ </p>
+ <p class="<?php if ($_['shareAPIEnabled'] === 'no') p('hidden');?>">
+ <input type="checkbox" name="shareapi_allow_group_sharing" id="allowGroupSharing" class="checkbox"
+ value="1" <?php if ($_['allowGroupSharing'] === 'yes') print_unescaped('checked="checked"'); ?> />
+ <label for="allowGroupSharing"><?php p($l->t('Allow sharing with groups'));?></label><br />
+ </p>
+ <p class="<?php if ($_['shareAPIEnabled'] === 'no') p('hidden');?>">
+ <input type="checkbox" name="shareapi_only_share_with_group_members" id="onlyShareWithGroupMembers" class="checkbox"
+ value="1" <?php if ($_['onlyShareWithGroupMembers']) print_unescaped('checked="checked"'); ?> />
+ <label for="onlyShareWithGroupMembers"><?php p($l->t('Restrict users to only share with users in their groups'));?></label><br/>
+ </p>
+ <p class="<?php if ($_['shareAPIEnabled'] === 'no') p('hidden');?>">
+ <input type="checkbox" name="shareapi_allow_mail_notification" id="allowMailNotification" class="checkbox"
+ value="1" <?php if ($_['allowMailNotification'] === 'yes') print_unescaped('checked="checked"'); ?> />
+ <label for="allowMailNotification"><?php p($l->t('Allow users to send mail notification for shared files to other users'));?></label><br/>
+ </p>
+ <p class="<?php if ($_['shareAPIEnabled'] === 'no') p('hidden');?>">
+ <input type="checkbox" name="shareapi_exclude_groups" id="shareapiExcludeGroups" class="checkbox"
+ value="1" <?php if ($_['shareExcludeGroups']) print_unescaped('checked="checked"'); ?> />
+ <label for="shareapiExcludeGroups"><?php p($l->t('Exclude groups from sharing'));?></label><br/>
+ </p>
+ <p id="selectExcludedGroups" class="indent <?php if (!$_['shareExcludeGroups'] || $_['shareAPIEnabled'] === 'no') p('hidden'); ?>">
+ <input name="shareapi_exclude_groups_list" type="hidden" id="excludedGroups" value="<?php p($_['shareExcludedGroupsList']) ?>" style="width: 400px"/>
+ <br />
+ <em><?php p($l->t('These groups will still be able to receive shares, but not to initiate them.')); ?></em>
+ </p>
+ <p class="<?php if ($_['shareAPIEnabled'] === 'no') p('hidden');?>">
+ <input type="checkbox" name="shareapi_allow_share_dialog_user_enumeration" value="1" id="shareapi_allow_share_dialog_user_enumeration" class="checkbox"
+ <?php if ($_['allowShareDialogUserEnumeration'] === 'yes') print_unescaped('checked="checked"'); ?> />
+ <label for="shareapi_allow_share_dialog_user_enumeration"><?php p($l->t('Allow username autocompletion in share dialog. If this is disabled the full username needs to be entered.'));?></label><br />
+ </p>
+
+ <?php print_unescaped($_['fileSharingSettings']); ?>
+</div>
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 @@
+<?php
+/**
+ * @copyright Copyright (c) 2016 Arthur Schiwon <blizzz@arthur-schiwon.de>
+ *
+ * @author Arthur Schiwon <blizzz@arthur-schiwon.de>
+ *
+ * @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 <http://www.gnu.org/licenses/>.
+ *
+ */
+
+/** @var \OCP\IL10N $l */
+/** @var array $_ */
+
+?>
+
+<div class="section" id="admin-tips">
+ <h2><?php p($l->t('Tips & tricks'));?></h2>
+ <ul>
+ <?php
+ // SQLite database performance issue
+ if ($_['databaseOverload']) {
+ ?>
+ <li>
+ <?php p($l->t('SQLite is used as database. For larger installations we recommend to switch to a different database backend.')); ?><br>
+ <?php p($l->t('Especially when using the desktop client for file syncing the use of SQLite is discouraged.')); ?><br>
+ <?php print_unescaped($l->t('To migrate to another database use the command line tool: \'occ db:convert-type\', or see the <a target="_blank" rel="noreferrer" href="%s">documentation ↗</a>.', link_to_docs('admin-db-conversion') )); ?>
+ </li>
+ <?php } ?>
+ <li><a target="_blank" rel="noreferrer" href="<?php p(link_to_docs('admin-backup')); ?>"><?php p($l->t('How to do backups'));?> ↗</a></li>
+ <li><a target="_blank" rel="noreferrer" href="<?php p(link_to_docs('admin-monitoring')); ?>"><?php p($l->t('Advanced monitoring'));?> ↗</a></li>
+ <li><a target="_blank" rel="noreferrer" href="<?php p(link_to_docs('admin-performance')); ?>"><?php p($l->t('Performance tuning'));?> ↗</a></li>
+ <li><a target="_blank" rel="noreferrer" href="<?php p(link_to_docs('admin-config')); ?>"><?php p($l->t('Improving the config.php'));?> ↗</a></li>
+ <li><a target="_blank" rel="noreferrer" href="<?php p(link_to_docs('developer-theming')); ?>"><?php p($l->t('Theming'));?> ↗</a></li>
+ <li><a target="_blank" rel="noreferrer" href="<?php p(link_to_docs('admin-security')); ?>"><?php p($l->t('Hardening and security guidance'));?> ↗</a></li>
+ </ul>
+</div>