diff options
author | Christoph Wurst <christoph@winzerhof-wurst.at> | 2019-09-17 16:33:27 +0200 |
---|---|---|
committer | npmbuildbot[bot] <npmbuildbot[bot]@users.noreply.github.com> | 2019-09-28 09:39:28 +0000 |
commit | de6940352a2f708376219a89ec84a8e6d25ca59e (patch) | |
tree | 459bacfc183b24d611be1877fbe22bbcd4efb1d6 /apps/settings/templates | |
parent | c8cd607681ac128228f57114ce14dd67ab05de04 (diff) | |
download | nextcloud-server-de6940352a2f708376219a89ec84a8e6d25ca59e.tar.gz nextcloud-server-de6940352a2f708376219a89ec84a8e6d25ca59e.zip |
Move settings to an app
Signed-off-by: Christoph Wurst <christoph@winzerhof-wurst.at>
Signed-off-by: npmbuildbot[bot] <npmbuildbot[bot]@users.noreply.github.com>
Diffstat (limited to 'apps/settings/templates')
-rw-r--r-- | apps/settings/templates/certificates.php | 44 | ||||
-rw-r--r-- | apps/settings/templates/help.php | 33 | ||||
-rw-r--r-- | apps/settings/templates/settings-vue.php | 31 | ||||
-rw-r--r-- | apps/settings/templates/settings/additional.php | 33 | ||||
-rw-r--r-- | apps/settings/templates/settings/admin/additional-mail.php | 152 | ||||
-rw-r--r-- | apps/settings/templates/settings/admin/overview.php | 66 | ||||
-rw-r--r-- | apps/settings/templates/settings/admin/security.php | 97 | ||||
-rw-r--r-- | apps/settings/templates/settings/admin/server.php | 100 | ||||
-rw-r--r-- | apps/settings/templates/settings/admin/sharing.php | 120 | ||||
-rw-r--r-- | apps/settings/templates/settings/empty.php | 25 | ||||
-rw-r--r-- | apps/settings/templates/settings/frame.php | 92 | ||||
-rw-r--r-- | apps/settings/templates/settings/personal/development.notice.php | 66 | ||||
-rw-r--r-- | apps/settings/templates/settings/personal/personal.info.php | 383 | ||||
-rw-r--r-- | apps/settings/templates/settings/personal/security.php | 106 | ||||
-rw-r--r-- | apps/settings/templates/settings/personal/security/authtokens.php | 31 |
15 files changed, 1379 insertions, 0 deletions
diff --git a/apps/settings/templates/certificates.php b/apps/settings/templates/certificates.php new file mode 100644 index 00000000000..d9587f97946 --- /dev/null +++ b/apps/settings/templates/certificates.php @@ -0,0 +1,44 @@ +<div class="section"> + <h2 data-anchor-name="ssl-root-certificate"><?php p($l->t('SSL Root Certificates')); ?></h2> + <table id="sslCertificate" class="grid" data-type="<?php p($_['type']); ?>"> + <thead> + <tr> + <th><?php p($l->t('Common Name')); ?></th> + <th><?php p($l->t('Valid until')); ?></th> + <th><?php p($l->t('Issued By')); ?></th> + </tr> + </thead> + <tbody> + <?php foreach ($_['certs'] as $rootCert): /**@var \OCP\ICertificate $rootCert */ ?> + <tr class="<?php echo $rootCert->isExpired() ? 'expired' : 'valid' ?>" + data-name="<?php p($rootCert->getName()) ?>"> + <td class="rootCert" + title="<?php p($rootCert->getOrganization()) ?>"> + <?php p($rootCert->getCommonName()) ?> + </td> + <td title="<?php p($l->t('Valid until %s', $l->l('date', $rootCert->getExpireDate()))) ?>"> + <?php echo $l->l('date', $rootCert->getExpireDate()) ?> + </td> + <td title="<?php p($rootCert->getIssuerOrganization()) ?>"> + <?php p($rootCert->getIssuerName()) ?> + </td> + <td <?php if ($rootCert != ''): ?>class="remove" + <?php else: ?>style="visibility:hidden;" + <?php endif; ?>><img alt="<?php p($l->t('Delete')); ?>" + title="<?php p($l->t('Delete')); ?>" + class="action" + src="<?php print_unescaped(image_path('core', 'actions/delete.svg')); ?>"/> + </td> + </tr> + <?php endforeach; ?> + </tbody> + </table> + <form class="uploadButton" method="post" + action="<?php p($_['urlGenerator']->linkToRoute($_['uploadRoute'])); ?>" + target="certUploadFrame"> + <label for="rootcert_import" class="inlineblock button" + id="rootcert_import_button"><?php p($l->t('Import root certificate')); ?></label> + <input type="file" id="rootcert_import" name="rootcert_import" + class="hiddenuploadfield"> + </form> +</div> diff --git a/apps/settings/templates/help.php b/apps/settings/templates/help.php new file mode 100644 index 00000000000..f58fc66f1b2 --- /dev/null +++ b/apps/settings/templates/help.php @@ -0,0 +1,33 @@ +<div id="app-navigation"> + <ul> + <?php if($_['admin']) { ?> + <li> + <a class="icon-user <?php p($_['style1']); ?>" + href="<?php print_unescaped($_['url1']); ?> class= ""> + <?php p($l->t('User documentation')); ?> + </a> + </li> + <li> + <a class="icon-user-admin <?php p($_['style2']); ?>" + href="<?php print_unescaped($_['url2']); ?>"> + <?php p($l->t('Administrator documentation')); ?> + </a> + </li> + <?php } ?> + + <li> + <a href="https://docs.nextcloud.com" class="icon-category-office" target="_blank" rel="noreferrer noopener"> + <?php p($l->t('Documentation')); ?> ↗ + </a> + </li> + <li> + <a href="https://help.nextcloud.com" class="icon-comment" target="_blank" rel="noreferrer noopener"> + <?php p($l->t('Forum')); ?> ↗ + </a> + </li> +</div> + +<div id="app-content" class="help-includes"> + <iframe src="<?php print_unescaped($_['url']); ?>" class="help-iframe"> + </iframe> +</div> diff --git a/apps/settings/templates/settings-vue.php b/apps/settings/templates/settings-vue.php new file mode 100644 index 00000000000..f04d577fdae --- /dev/null +++ b/apps/settings/templates/settings-vue.php @@ -0,0 +1,31 @@ +<?php +/** + * @copyright Copyright (c) 2018 John Molakvoæ <skjnldsv@protonmail.com> + * + * @author John Molakvoæ <skjnldsv@protonmail.com> + * + * @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/>. + * + */ + +script('settings', 'vue-settings-apps-users-management'); +style('settings', 'settings'); + +// Do we have some data to inject ? +if(is_array($_['serverData'])) { +?> +<span id="serverData" data-server="<?php p(json_encode($_['serverData']));?>"></span> +<?php } ?> diff --git a/apps/settings/templates/settings/additional.php b/apps/settings/templates/settings/additional.php new file mode 100644 index 00000000000..3af78adde71 --- /dev/null +++ b/apps/settings/templates/settings/additional.php @@ -0,0 +1,33 @@ +<?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 $_ */ + +?> + +<?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 } +} ?> diff --git a/apps/settings/templates/settings/admin/additional-mail.php b/apps/settings/templates/settings/admin/additional-mail.php new file mode 100644 index 00000000000..609aa3222d5 --- /dev/null +++ b/apps/settings/templates/settings/admin/additional-mail.php @@ -0,0 +1,152 @@ +<?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'), + 'tls' => $l->t('STARTTLS'), +]; + +$mail_smtpmode = [ + ['smtp', 'SMTP'], +]; +if ($_['sendmail_is_available']) { + $mail_smtpmode[] = ['sendmail', 'Sendmail']; +} +if ($_['mail_smtpmode'] === 'qmail') { + $mail_smtpmode[] = ['qmail', 'qmail']; +} + +$mail_sendmailmode = [ + 'smtp' => 'smtp (-bs)', + 'pipe' => 'pipe (-t)' +]; + +?> + +<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 noopener" class="icon-info" + title="<?php p($l->t('Open documentation'));?>" + href="<?php p(link_to_docs('admin-email')); ?>"></a> + <p class="settings-hint"><?php p($l->t('It is important to set up this server to be able to send emails, like for password reset and notifications.')); ?></p> + <p><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[0] == $_['mail_smtpmode']): + $selected = 'selected="selected"'; + endif; ?> + <option value="<?php p($smtpmode[0])?>" <?php p($selected) ?>><?php p($smtpmode[1]) ?></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> + + <label id="mail_sendmailmode_label" for="mail_sendmailmode" class="<?= $_['mail_smtpmode'] !== 'sendmail' ? 'hidden' : '' ?>"> + <?php p($l->t('Sendmail mode')); ?> + </label> + <select name="mail_sendmailmode" id="mail_sendmailmode" class="<?= $_['mail_smtpmode'] !== 'sendmail' ? 'hidden' : '' ?>"> + <?php foreach ($mail_sendmailmode as $sendmailmodeValue => $sendmailmodeLabel): ?> + <option value="<?php p($sendmailmodeValue)?>" <?= $sendmailmodeValue === $_['mail_sendmailmode'] ? 'selected="selected"' : '' ?>><?php p($sendmailmodeLabel) ?></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="text" 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('Save')) ?>"> + </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> diff --git a/apps/settings/templates/settings/admin/overview.php b/apps/settings/templates/settings/admin/overview.php new file mode 100644 index 00000000000..cbb7e136da0 --- /dev/null +++ b/apps/settings/templates/settings/admin/overview.php @@ -0,0 +1,66 @@ +<?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 $_ */ +/** @var \OCP\Defaults $theme */ + +?> + +<div id="security-warning" class="section"> + <h2><?php p($l->t('Security & setup warnings'));?></h2> + <p class="settings-hint"><?php p($l->t('It\'s important for the security and performance of your instance that everything is configured correctly. To help you with that we are doing some automatic checks. Please see the linked documentation for more information.'));?></p> + + <div id="security-warning-state-ok" class="hidden"> + <span class="icon icon-checkmark-white"></span><span class="message"><?php p($l->t('All checks passed.'));?></span> + </div> + <div id="security-warning-state-failure" class="hidden"> + <span class="icon icon-close-white"></span><span class="message"><?php p($l->t('There are some errors regarding your setup.'));?></span> + </div> + <div id="security-warning-state-warning" class="hidden"> + <span class="icon icon-error-white"></span><span class="message"><?php p($l->t('There are some warnings regarding your setup.'));?></span> + </div> + <div id="security-warning-state-loading"> + <span class="icon loading"></span><span class="message"><?php p($l->t('Checking for system and security issues.'));?></span> + </div> + + <div id="postsetupchecks" data-check-wellknown="<?php if($_['checkForWorkingWellKnownSetup']) { p('true'); } else { p('false'); } ?>"> + <ul class="errors hidden"></ul> + <ul class="warnings hidden"></ul> + <ul class="info hidden"></ul> + </div> + <p id="postsetupchecks-hint" class="hidden"> + <?php print_unescaped($l->t('Please double check the <a target="_blank" rel="noreferrer noopener" href="%1$s">installation guides ↗</a>, and check for any errors or warnings in the <a href="%2$s">log</a>.', [link_to_docs('admin-install'), \OC::$server->getURLGenerator()->linkToRoute('settings.AdminSettings.index', ['section' => 'logging'])] )); ?> + </p> + + <p class="extra-top-margin"> + <?php print_unescaped($l->t('Check the security of your Nextcloud over <a target="_blank" rel="noreferrer noopener" href="%s">our security scan ↗</a>.', ['https://scan.nextcloud.com']));?> + </p> + +</div> + +<div id="version" class="section"> + <!-- should be the last part, so Updater can follow if enabled (it has no heading therefore). --> + <h2><?php p($l->t('Version'));?></h2> + <p><strong><a href="<?php print_unescaped($theme->getBaseUrl()); ?>" rel="noreferrer noopener" target="_blank"><?php p($theme->getTitle()); ?></a> <?php p(OC_Util::getHumanVersion()) ?></strong></p> +</div> diff --git a/apps/settings/templates/settings/admin/security.php b/apps/settings/templates/settings/admin/security.php new file mode 100644 index 00000000000..7d528818e42 --- /dev/null +++ b/apps/settings/templates/settings/admin/security.php @@ -0,0 +1,97 @@ +<?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 $_ */ + +script('settings', 'vue-settings-admin-security'); + +?> + +<div id="two-factor-auth" class="section"> + <h2><?php p($l->t('Two-Factor Authentication'));?></h2> + <div id="two-factor-auth-settings"></div> +</div> + +<div class="section" id='encryptionAPI'> + <h2><?php p($l->t('Server-side encryption')); ?></h2> + <a target="_blank" rel="noreferrer noopener" class="icon-info" + title="<?php p($l->t('Open documentation'));?>" + href="<?php p(link_to_docs('admin-encryption')); ?>"></a> + <p class="settings-hint"><?php p($l->t('Server-side encryption makes it possible to encrypt files which are uploaded to this server. This comes with limitations like a performance penalty, so enable this only if needed.')); ?></p> + <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) ?>" class="radio" + 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 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/apps/settings/templates/settings/admin/server.php b/apps/settings/templates/settings/admin/server.php new file mode 100644 index 00000000000..92bf433ca6c --- /dev/null +++ b/apps/settings/templates/settings/admin/server.php @@ -0,0 +1,100 @@ +<?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="backgroundjobs"> + <h2 class="inlineblock"><?php p($l->t('Background jobs'));?></h2> + <p class="cronlog inlineblock"> + <?php if ($_['lastcron'] !== false): + $relative_time = relative_modified_date($_['lastcron']); + + $formatter = \OC::$server->getDateTimeFormatter(); + $absolute_time = $formatter->formatDateTime($_['lastcron'], 'long', 'long'); + if (time() - $_['lastcron'] <= 600): ?> + <span class="status success"></span> + <span class="crondate" title="<?php p($absolute_time);?>"> + <?php p($l->t("Last job ran %s.", [$relative_time]));?> + </span> + <?php else: ?> + <span class="status error"></span> + <span class="crondate" title="<?php p($absolute_time);?>"> + <?php p($l->t("Last job execution ran %s. Something seems wrong.", [$relative_time]));?> + </span> + <?php endif; + else: ?> + <span class="status error"></span> + <?php p($l->t("Background job didn’t run yet!")); + endif; ?> + </p> + <a target="_blank" rel="noreferrer noopener" class="icon-info" + title="<?php p($l->t('Open documentation'));?>" + href="<?php p(link_to_docs('admin-background-jobs')); ?>"></a> + + <p class="settings-hint"><?php p($l->t('For optimal performance it\'s important to configure background jobs correctly. For bigger instances \'Cron\' is the recommended setting. Please see the documentation for more information.'));?></p> + <form action="#"> + <fieldset> + <legend class="hidden-visually"><?php p($l->t('Pick background job setting'));?></legend> + <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 5 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"'); + } + if (!$_['cli_based_cron_possible']) { + print_unescaped('disabled'); + }?>> + <label for="backgroundjobs_cron">Cron</label><br/> + <em><?php p($l->t("Use system cron service to call the cron.php file every 5 minutes.")); ?> + <?php if($_['cli_based_cron_possible']) { + p($l->t('The cron.php needs to be executed by the system user "%s".', [$_['cli_based_cron_user']])); + } else { + print_unescaped(str_replace( + ['{linkstart}', '{linkend}'], + ['<a href="http://php.net/manual/en/book.posix.php">', ' ↗</a>'], + $l->t('To run this you need the PHP POSIX extension. See {linkstart}PHP documentation{linkend} for more details.') + )); + } ?></em> + + </p> + </fieldset> + </form> +</div> diff --git a/apps/settings/templates/settings/admin/sharing.php b/apps/settings/templates/settings/admin/sharing.php new file mode 100644 index 00000000000..5913524be40 --- /dev/null +++ b/apps/settings/templates/settings/admin/sharing.php @@ -0,0 +1,120 @@ +<?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 noopener" class="icon-info" + title="<?php p($l->t('Open documentation'));?>" + href="<?php p(link_to_docs('admin-sharing')); ?>"></a> + <p class="settings-hint"><?php p($l->t('As admin you can fine-tune the sharing behavior. Please see the documentation for more information.'));?></p> + <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_enable_link_password_by_default" id="enableLinkPasswordByDefault" class="checkbox" + value="1" <?php if ($_['enableLinkPasswordByDefault'] === 'yes') print_unescaped('checked="checked"'); ?> /> + <label for="enableLinkPasswordByDefault"><?php p($l->t('Always ask for a password'));?></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/> + + </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_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" class="noJSAutoUpdate"/> + <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 or email address needs to be entered.'));?></label><br /> + </p> + <p> + <input type="checkbox" id="publicShareDisclaimer" class="checkbox noJSAutoUpdate" + <?php if ($_['publicShareDisclaimerText'] !== null) print_unescaped('checked="checked"'); ?> /> + <label for="publicShareDisclaimer"><?php p($l->t('Show disclaimer text on the public link upload page. (Only shown when the file list is hidden.)'));?></label> + <span id="publicShareDisclaimerStatus" class="msg" style="display:none"></span> + <br/> + <textarea placeholder="<?php p($l->t('This text will be shown on the public link upload page when the file list is hidden.')) ?>" id="publicShareDisclaimerText" <?php if ($_['publicShareDisclaimerText'] === null) { print_unescaped('class="hidden"'); } ?>><?php p($_['publicShareDisclaimerText']) ?></textarea> + </p> + + <h3><?php p($l->t('Default share permissions'));?></h3> + <input type="hidden" name="shareapi_default_permissions" id="shareApiDefaultPermissions" class="checkbox" + value="<?php p($_['shareApiDefaultPermissions']) ?>" /> + <p id="shareApiDefaultPermissionsSection" class="indent <?php if ($_['shareAPIEnabled'] === 'no') p('hidden'); ?>"> + <?php foreach ($_['shareApiDefaultPermissionsCheckboxes'] as $perm): ?> + <input type="checkbox" name="shareapi_default_permission_<?php p($perm['id']) ?>" id="shareapi_default_permission_<?php p($perm['id']) ?>" + class="noautosave checkbox" value="<?php p($perm['value']) ?>" <?php if (($_['shareApiDefaultPermissions'] & $perm['value']) !== 0) print_unescaped('checked="checked"'); ?> /> + <label for="shareapi_default_permission_<?php p($perm['id']) ?>"><?php p($perm['label']);?></label> + <?php endforeach ?> + </p> +</div> diff --git a/apps/settings/templates/settings/empty.php b/apps/settings/templates/settings/empty.php new file mode 100644 index 00000000000..0ed8a873d3c --- /dev/null +++ b/apps/settings/templates/settings/empty.php @@ -0,0 +1,25 @@ +<?php +/** + * @copyright Copyright (c) 2017 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/>. + * + */ + + # used for Personal/Additional settings as fallback for legacy settings +?> diff --git a/apps/settings/templates/settings/frame.php b/apps/settings/templates/settings/frame.php new file mode 100644 index 00000000000..e32c4ed2fc9 --- /dev/null +++ b/apps/settings/templates/settings/frame.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/>. + * + */ + +style('settings', 'settings'); +script('settings', [ 'settings', 'admin', 'log', 'certificates'] ); +script('core', 'setupchecks'); +script('files', 'jquery.fileupload'); + +?> + +<div id="app-navigation"> + <ul> + <?php if(!empty($_['forms']['admin'])) { ?> + <li class="app-navigation-caption"><?php p($l->t('Personal')); ?></li> + <?php + } + foreach($_['forms']['personal'] as $form) { + if (isset($form['anchor'])) { + $anchor = \OC::$server->getURLGenerator()->linkToRoute('settings.PersonalSettings.index', ['section' => $form['anchor']]); + $class = 'nav-icon-' . $form['anchor']; + $sectionName = $form['section-name']; + $active = $form['active'] ? ' class="active"' : ''; + ?> + <li <?php print_unescaped($form['active'] ? ' class="active"' : ''); ?>> + <a href="<?php p($anchor); ?>"> + <?php if (!empty($form['icon'])) { ?> + <img alt="" src="<?php print_unescaped($form['icon']); ?>"> + <span><?php p($form['section-name']); ?></span> + <?php } else { ?> + <span class="no-icon"><?php p($form['section-name']); ?></span> + <?php } ?> + </a> + </li> + <?php + } + } + ?> + + <?php + if(!empty($_['forms']['admin'])) { + ?> + <li class="app-navigation-caption"><?php p($l->t('Administration')); ?></li> + <?php + } + foreach($_['forms']['admin'] as $form) { + if (isset($form['anchor'])) { + + $anchor = \OC::$server->getURLGenerator()->linkToRoute('settings.AdminSettings.index', ['section' => $form['anchor']]); + $class = 'nav-icon-' . $form['anchor']; + $sectionName = $form['section-name']; + $active = $form['active'] ? ' class="active"' : ''; + ?> + <li <?php print_unescaped($form['active'] ? ' class="active"' : ''); ?>> + <a href="<?php p($anchor); ?>"> + <?php if (!empty($form['icon'])) { ?> + <img alt="" src="<?php print_unescaped($form['icon']); ?>"> + <span><?php p($form['section-name']); ?></span> + <?php } else { ?> + <span class="no-icon"><?php p($form['section-name']); ?></span> + <?php } ?> + </a> + </li> + <?php + } + } + ?> + </ul> +</div> + +<div id="app-content"> + <?php print_unescaped($_['content']); ?> +</div> diff --git a/apps/settings/templates/settings/personal/development.notice.php b/apps/settings/templates/settings/personal/development.notice.php new file mode 100644 index 00000000000..eac457a5fae --- /dev/null +++ b/apps/settings/templates/settings/personal/development.notice.php @@ -0,0 +1,66 @@ +<div class="followupsection"> + <p> + <?php print_unescaped(str_replace( + [ + '{communityopen}', + '{githubopen}', + '{licenseopen}', + '{linkclose}', + ], + [ + '<a href="https://nextcloud.com/contribute" target="_blank" rel="noreferrer noopener">', + '<a href="https://github.com/nextcloud" target="_blank" rel="noreferrer noopener">', + '<a href="https://www.gnu.org/licenses/agpl-3.0.html" target="_blank" rel="noreferrer noopener">', + '</a>', + ], + $l->t('Developed by the {communityopen}Nextcloud community{linkclose}, the {githubopen}source code{linkclose} is licensed under the {licenseopen}AGPL{linkclose}.') + )); ?> + </p> + + <p class="social-button"> + <?php print_unescaped(str_replace( + [ + '{facebookimage}', + '{twitterimage}', + '{mastodonimage}', + '{rssimage}', + '{mailimage}', + '{facebookopen}', + '{twitteropen}', + '{mastodonopen}', + '{rssopen}', + '{newsletteropen}', + '{linkclose}', + '{facebooktext}', + '{twittertext}', + '{mastodontext}', + '{rsstext}', + '{mailtext}', + ], + [ + image_path('core', 'facebook.svg'), + image_path('core', 'twitter.svg'), + image_path('core', 'mastodon.svg'), + image_path('core', 'rss.svg'), + image_path('core', 'mail.svg'), + '<a target="_blank" rel="noreferrer noopener" href="https://www.facebook.com/Nextclouders/">', + '<a target="_blank" rel="noreferrer noopener" href="https://twitter.com/nextclouders">', + '<a target="_blank" rel="noreferrer noopener" href="https://mastodon.xyz/@nextcloud">', + '<a target="_blank" rel="noreferrer noopener" href="https://nextcloud.com/news/">', + '<a target="_blank" rel="noreferrer noopener" href="https://newsletter.nextcloud.com/?p=subscribe&id=1">', + '</a>', + $l->t('Like our Facebook page'), + $l->t('Follow us on Twitter'), + $l->t('Follow us on Mastodon'), + $l->t('Check out our blog'), + $l->t('Subscribe to our newsletter'), + + ], +'{facebookopen}<img width="50" src="{facebookimage}" title="{facebooktext}" alt="{facebooktext}">{linkclose} +{twitteropen}<img width="50" src="{twitterimage}" title="{twittertext}" alt="{twittertext}">{linkclose} +{mastodonopen}<img width="50" src="{mastodonimage}" title="{mastodontext}" alt="{mastodontext}">{linkclose} +{rssopen}<img class="img-circle" width="50" src="{rssimage}" title="{rsstext}" alt="{rsstext}">{linkclose} +{newsletteropen}<img width="50" src="{mailimage}" title="{mailtext}" alt="{mailtext}">{linkclose}' + )); ?> + </p> +</div> diff --git a/apps/settings/templates/settings/personal/personal.info.php b/apps/settings/templates/settings/personal/personal.info.php new file mode 100644 index 00000000000..ad5f8ac547f --- /dev/null +++ b/apps/settings/templates/settings/personal/personal.info.php @@ -0,0 +1,383 @@ +<?php +/** + * @copyright Copyright (c) 2017 Arthur Schiwon <blizzz@arthur-schiwon.de> + * + * @author Arthur Schiwon <blizzz@arthur-schiwon.de> + * @author Thomas Citharel <tcit@tcit.fr> + * + * @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 $_ */ + +script('settings', [ + 'usersettings', + 'templates', + 'federationsettingsview', + 'federationscopemenu', + 'settings/personalInfo', +]); +?> + +<div id="personal-settings"> + <div id="personal-settings-avatar-container" class="personal-settings-container"> + <div> + <form id="avatarform" class="section" method="post" action="<?php p(\OC::$server->getURLGenerator()->linkToRoute('core.avatar.postAvatar')); ?>"> + <h3> + <label><?php p($l->t('Profile picture')); ?></label> + <div class="federation-menu" tabindex="0"> + <span class="icon-federation-menu icon-password"> + <span class="icon-triangle-s"></span> + </span> + </div> + </h3> + <div id="displayavatar"> + <div class="avatardiv"></div> + <div class="warning hidden"></div> + <?php if ($_['avatarChangeSupported']): ?> + <label for="uploadavatar" class="inlineblock button icon-upload svg" id="uploadavatarbutton" title="<?php p($l->t('Upload new')); ?>"></label> + <div class="inlineblock button icon-folder svg" id="selectavatar" title="<?php p($l->t('Select from Files')); ?>"></div> + <div class="hidden button icon-delete svg" id="removeavatar" title="<?php p($l->t('Remove image')); ?>"></div> + <input type="file" name="files[]" id="uploadavatar" class="hiddenuploadfield"> + <p><em><?php p($l->t('png or jpg, max. 20 MB')); ?></em></p> + <?php else: ?> + <?php p($l->t('Picture provided by original account')); ?> + <?php endif; ?> + </div> + + <div id="cropper" class="hidden"> + <div class="inner-container"> + <div class="inlineblock button" id="abortcropperbutton"><?php p($l->t('Cancel')); ?></div> + <div class="inlineblock button primary" id="sendcropperbutton"><?php p($l->t('Choose as profile picture')); ?></div> + </div> + </div> + <span class="icon-checkmark hidden"></span> + <?php if($_['lookupServerUploadEnabled']) { ?> + <input type="hidden" id="avatarscope" value="<?php p($_['avatarScope']) ?>"> + <?php } ?> + </form> + </div> + <div class="personal-settings-setting-box personal-settings-group-box section"> + <h3><?php p($l->t('Details')); ?></h3> + <div id="groups" class="personal-info icon-user"> + <p><?php p($l->t('You are a member of the following groups:')); ?></p> + <p id="groups-groups"> + <strong><?php p(implode(', ', $_['groups'])); ?></strong> + </p> + </div> + <div id="quota" class="personal-info icon-quota"> + <div class="quotatext-bg"> + <p class="quotatext"> + <?php if ($_['quota'] === \OCP\Files\FileInfo::SPACE_UNLIMITED): ?> + <?php print_unescaped($l->t('You are using <strong>%s</strong>', + [$_['usage']]));?> + <?php else: ?> + <?php print_unescaped($l->t('You are using <strong>%1$s</strong> of <strong>%2$s</strong> (<strong>%3$s %%</strong>)', + [$_['usage'], $_['total_space'], $_['usage_relative']]));?> + <?php endif ?> + </p> + </div> + <progress value="<?php p($_['usage_relative']); ?>" max="100"<?php if($_['usage_relative'] > 80): ?> class="warn" <?php endif; ?>></progress> + </div> + </div> + </div> + + <div class="personal-settings-container"> + <div class="personal-settings-setting-box"> + <form id="displaynameform" class="section"> + <h3> + <label for="displayname"><?php p($l->t('Full name')); ?></label> + <div class="federation-menu" tabindex="0"> + <span class="icon-federation-menu icon-password"> + <span class="icon-triangle-s"></span> + </span> + </div> + </h3> + <input type="text" id="displayname" name="displayname" + <?php if(!$_['displayNameChangeSupported']) { print_unescaped('class="hidden"'); } ?> + value="<?php p($_['displayName']) ?>" + autocomplete="on" autocapitalize="none" autocorrect="off" /> + <?php if(!$_['displayNameChangeSupported']) { ?> + <span><?php if(isset($_['displayName']) && !empty($_['displayName'])) { p($_['displayName']); } else { p($l->t('No display name set')); } ?></span> + <?php } ?> + <span class="icon-checkmark hidden"></span> + <span class="icon-error hidden" ></span> + <?php if($_['lookupServerUploadEnabled']) { ?> + <input type="hidden" id="displaynamescope" value="<?php p($_['displayNameScope']) ?>"> + <?php } ?> + </form> + </div> + <div class="personal-settings-setting-box"> + <form id="emailform" class="section"> + <h3> + <label for="email"><?php p($l->t('Email')); ?></label> + <div class="federation-menu" tabindex="0"> + <span class="icon-federation-menu icon-password"> + <span class="icon-triangle-s"></span> + </span> + </div> + </h3> + <div class="verify <?php if ($_['email'] === '' || $_['emailScope'] !== 'public') p('hidden'); ?>"> + <img id="verify-email" title="<?php p($_['emailMessage']); ?>" data-status="<?php p($_['emailVerification']) ?>" src=" + <?php + switch($_['emailVerification']) { + case \OC\Accounts\AccountManager::VERIFICATION_IN_PROGRESS: + p(image_path('core', 'actions/verifying.svg')); + break; + case \OC\Accounts\AccountManager::VERIFIED: + p(image_path('core', 'actions/verified.svg')); + break; + default: + p(image_path('core', 'actions/verify.svg')); + } + ?>"> + </div> + <input type="email" name="email" id="email" value="<?php p($_['email']); ?>" + <?php if(!$_['displayNameChangeSupported']) { print_unescaped('class="hidden"'); } ?> + placeholder="<?php p($l->t('Your email address')); ?>" + autocomplete="on" autocapitalize="none" autocorrect="off" /> + <span class="icon-checkmark hidden"></span> + <span class="icon-error hidden" ></span> + <?php if(!$_['displayNameChangeSupported']) { ?> + <span><?php if(isset($_['email']) && !empty($_['email'])) { p($_['email']); } else { p($l->t('No email address set')); }?></span> + <?php } ?> + <?php if($_['displayNameChangeSupported']) { ?> + <em><?php p($l->t('For password reset and notifications')); ?></em> + <?php } ?> + <?php if($_['lookupServerUploadEnabled']) { ?> + <input type="hidden" id="emailscope" value="<?php p($_['emailScope']) ?>"> + <?php } ?> + </form> + </div> + <?php if (!empty($_['phone']) || $_['lookupServerUploadEnabled']) { ?> + <div class="personal-settings-setting-box"> + <form id="phoneform" class="section"> + <h3> + <label for="phone"><?php p($l->t('Phone number')); ?></label> + <div class="federation-menu" tabindex="0"> + <span class="icon-federation-menu icon-password"> + <span class="icon-triangle-s"></span> + </span> + </div> + </h3> + <input type="tel" id="phone" name="phone" <?php if(!$_['lookupServerUploadEnabled']) print_unescaped('disabled="1"'); ?> + value="<?php p($_['phone']) ?>" + placeholder="<?php p($l->t('Your phone number')); ?>" + autocomplete="on" autocapitalize="none" autocorrect="off" /> + <span class="icon-checkmark hidden"></span> + <?php if($_['lookupServerUploadEnabled']) { ?> + <input type="hidden" id="phonescope" value="<?php p($_['phoneScope']) ?>"> + <?php } ?> + </form> + </div> + <?php } ?> + <?php if (!empty($_['address']) || $_['lookupServerUploadEnabled']) { ?> + <div class="personal-settings-setting-box"> + <form id="addressform" class="section"> + <h3> + <label for="address"><?php p($l->t('Address')); ?></label> + <div class="federation-menu" tabindex="0"> + <span class="icon-federation-menu icon-password"> + <span class="icon-triangle-s"></span> + </span> + </div> + </h3> + <input type="text" id="address" name="address" <?php if(!$_['lookupServerUploadEnabled']) print_unescaped('disabled="1"'); ?> + placeholder="<?php p($l->t('Your postal address')); ?>" + value="<?php p($_['address']) ?>" + autocomplete="on" autocapitalize="none" autocorrect="off" /> + <span class="icon-checkmark hidden"></span> + <?php if($_['lookupServerUploadEnabled']) { ?> + <input type="hidden" id="addressscope" value="<?php p($_['addressScope']) ?>"> + <?php } ?> + </form> + </div> + <?php } ?> + <?php if (!empty($_['website']) || $_['lookupServerUploadEnabled']) { ?> + <div class="personal-settings-setting-box"> + <form id="websiteform" class="section"> + <h3> + <label for="website"><?php p($l->t('Website')); ?></label> + <div class="federation-menu" tabindex="0"> + <span class="icon-federation-menu icon-password"> + <span class="icon-triangle-s"></span> + </span> + </div> + </h3> + <?php if($_['lookupServerUploadEnabled']) { ?> + <div class="verify <?php if ($_['website'] === '' || $_['websiteScope'] !== 'public') p('hidden'); ?>"> + <img id="verify-website" title="<?php p($_['websiteMessage']); ?>" data-status="<?php p($_['websiteVerification']) ?>" src=" + <?php + switch($_['websiteVerification']) { + case \OC\Accounts\AccountManager::VERIFICATION_IN_PROGRESS: + p(image_path('core', 'actions/verifying.svg')); + break; + case \OC\Accounts\AccountManager::VERIFIED: + p(image_path('core', 'actions/verified.svg')); + break; + default: + p(image_path('core', 'actions/verify.svg')); + } + ?>" + <?php if($_['websiteVerification'] === \OC\Accounts\AccountManager::VERIFICATION_IN_PROGRESS || $_['websiteVerification'] === \OC\Accounts\AccountManager::NOT_VERIFIED) print_unescaped(' class="verify-action"') ?> + > + <div class="verification-dialog popovermenu bubble menu"> + <div class="verification-dialog-content"> + <p class="explainVerification"></p> + <p class="verificationCode"></p> + <p><?php p($l->t('It can take up to 24 hours before the account is displayed as verified.'));?></p> + </div> + </div> + </div> + <?php } ?> + <input type="url" name="website" id="website" value="<?php p($_['website']); ?>" + placeholder="<?php p($l->t('Link https://…')); ?>" + autocomplete="on" autocapitalize="none" autocorrect="off" + <?php if(!$_['lookupServerUploadEnabled']) print_unescaped('disabled="1"'); ?> + /> + <span class="icon-checkmark hidden"></span> + <?php if($_['lookupServerUploadEnabled']) { ?> + <input type="hidden" id="websitescope" value="<?php p($_['websiteScope']) ?>"> + <?php } ?> + </form> + </div> + <?php } ?> + <?php if (!empty($_['twitter']) || $_['lookupServerUploadEnabled']) { ?> + <div class="personal-settings-setting-box"> + <form id="twitterform" class="section"> + <h3> + <label for="twitter"><?php p($l->t('Twitter')); ?></label> + <div class="federation-menu" tabindex="0"> + <span class="icon-federation-menu icon-password"> + <span class="icon-triangle-s"></span> + </span> + </div> + </h3> + <?php if($_['lookupServerUploadEnabled']) { ?> + <div class="verify <?php if ($_['twitter'] === '' || $_['twitterScope'] !== 'public') p('hidden'); ?>"> + <img id="verify-twitter" title="<?php p($_['twitterMessage']); ?>" data-status="<?php p($_['twitterVerification']) ?>" src=" + <?php + switch($_['twitterVerification']) { + case \OC\Accounts\AccountManager::VERIFICATION_IN_PROGRESS: + p(image_path('core', 'actions/verifying.svg')); + break; + case \OC\Accounts\AccountManager::VERIFIED: + p(image_path('core', 'actions/verified.svg')); + break; + default: + p(image_path('core', 'actions/verify.svg')); + } + ?>" + <?php if($_['twitterVerification'] === \OC\Accounts\AccountManager::VERIFICATION_IN_PROGRESS || $_['twitterVerification'] === \OC\Accounts\AccountManager::NOT_VERIFIED) print_unescaped(' class="verify-action"') ?> + > + <div class="verification-dialog popovermenu bubble menu"> + <div class="verification-dialog-content"> + <p class="explainVerification"></p> + <p class="verificationCode"></p> + <p><?php p($l->t('It can take up to 24 hours before the account is displayed as verified.'));?></p> + </div> + </div> + </div> + <?php } ?> + <input type="text" name="twitter" id="twitter" value="<?php p($_['twitter']); ?>" + placeholder="<?php p($l->t('Twitter handle @…')); ?>" + autocomplete="on" autocapitalize="none" autocorrect="off" + <?php if(!$_['lookupServerUploadEnabled']) print_unescaped('disabled="1"'); ?> + /> + <span class="icon-checkmark hidden"></span> + <?php if($_['lookupServerUploadEnabled']) { ?> + <input type="hidden" id="twitterscope" value="<?php p($_['twitterScope']) ?>"> + <?php } ?> + </form> + </div> + <?php } ?> + </div> + + <div class="profile-settings-container"> + <div class="personal-settings-setting-box personal-settings-language-box"> + <?php if (isset($_['activelanguage'])) { ?> + <form id="language" class="section"> + <h3> + <label for="languageinput"><?php p($l->t('Language'));?></label> + </h3> + <select id="languageinput" name="lang" data-placeholder="<?php p($l->t('Language'));?>"> + <option value="<?php p($_['activelanguage']['code']);?>"> + <?php p($_['activelanguage']['name']);?> + </option> + <?php foreach($_['commonlanguages'] as $language):?> + <option value="<?php p($language['code']);?>"> + <?php p($language['name']);?> + </option> + <?php endforeach;?> + <optgroup label="––––––––––"></optgroup> + <?php foreach($_['languages'] as $language):?> + <option value="<?php p($language['code']);?>"> + <?php p($language['name']);?> + </option> + <?php endforeach;?> + </select> + <a href="https://www.transifex.com/nextcloud/nextcloud/" + target="_blank" rel="noreferrer noopener"> + <em><?php p($l->t('Help translate'));?></em> + </a> + </form> + <?php } ?> + </div> + <div class="personal-settings-setting-box personal-settings-locale-box"> + <?php if (isset($_['activelocale'])) { ?> + <form id="locale" class="section"> + <h3> + <label for="localeinput"><?php p($l->t('Locale'));?></label> + </h3> + <select id="localeinput" name="lang" data-placeholder="<?php p($l->t('Locale'));?>"> + <option value="<?php p($_['activelocale']['code']);?>"> + <?php p($l->t($_['activelocale']['name']));?> + </option> + <optgroup label="––––––––––"></optgroup> + <?php foreach($_['localesForLanguage'] as $locale):?> + <option value="<?php p($locale['code']);?>"> + <?php p($l->t($locale['name']));?> + </option> + <?php endforeach;?> + <optgroup label="––––––––––"></optgroup> + <option value="<?php p($_['activelocale']['code']);?>"> + <?php p($l->t($_['activelocale']['name']));?> + </option> + <?php foreach($_['locales'] as $locale):?> + <option value="<?php p($locale['code']);?>"> + <?php p($l->t($locale['name']));?> + </option> + <?php endforeach;?> + </select> + <div id="localeexample" class="personal-info icon-timezone"> + <p> + <span id="localeexample-date"></span> <span id="localeexample-time"></span> + </p> + <p id="localeexample-fdow"></p> + </div> + </form> + <?php } ?> + </div> + <span class="msg"></span> + </div> + + <div id="personal-settings-group-container"> + + </div> + +</div> diff --git a/apps/settings/templates/settings/personal/security.php b/apps/settings/templates/settings/personal/security.php new file mode 100644 index 00000000000..e72b443f59b --- /dev/null +++ b/apps/settings/templates/settings/personal/security.php @@ -0,0 +1,106 @@ +<?php +/** + * @copyright Copyright (c) 2017 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/>. + * + */ + +script('settings', [ + 'settings', + 'templates', + 'vue-settings-personal-security', +]); + +if($_['passwordChangeSupported']) { + script('settings', 'security_password'); +} + +?> +<?php if($_['passwordChangeSupported']) { ?> +<div id="security-password" class="section"> + <h2 class="inlineblock"><?php p($l->t('Password'));?></h2> + <span id="password-error-msg" class="msg success hidden">Saved</span> + <div class="personal-settings-setting-box personal-settings-password-box"> + <form id="passwordform"> + <label for="pass1" class="hidden-visually"><?php p($l->t('Current password')); ?>: </label> + <input type="password" id="pass1" name="oldpassword" + placeholder="<?php p($l->t('Current password'));?>" + autocomplete="off" autocapitalize="none" autocorrect="off" /> + + <div class="personal-show-container"> + <label for="pass2" class="hidden-visually"><?php p($l->t('New password'));?>: </label> + <input type="password" id="pass2" name="newpassword" + placeholder="<?php p($l->t('New password')); ?>" + data-typetoggle="#personal-show" + autocomplete="off" autocapitalize="none" autocorrect="off" /> + <input type="checkbox" id="personal-show" class="hidden-visually" name="show" /><label for="personal-show" class="personal-show-label"></label> + </div> + + <input id="passwordbutton" type="submit" value="<?php p($l->t('Change password')); ?>" /> + + </form> + </div> + <span class="msg"></span> +</div> +<?php } ?> + +<div id="two-factor-auth" class="section"> + <h2><?php p($l->t('Two-Factor Authentication'));?></h2> + <a target="_blank" rel="noreferrer noopener" class="icon-info" + title="<?php p($l->t('Open documentation'));?>" + href="<?php p(link_to_docs('user-2fa')); ?>"></a> + <p class="settings-hint"><?php p($l->t('Use a second factor besides your password to increase security for your account.'));?></p> + <ul> + <?php foreach ($_['twoFactorProviderData']['providers'] as $data) { ?> + <li> + <?php + + /** @var \OCP\Authentication\TwoFactorAuth\IProvidesPersonalSettings $provider */ + $provider = $data['provider']; + //Handle 2FA provider icons and theme + if ($provider instanceof \OCP\Authentication\TwoFactorAuth\IProvidesIcons) { + if ($_['themedark']) { + $icon = $provider->getLightIcon(); + } + else { + $icon = $provider->getDarkIcon(); + } + //fallback icon if the 2factor provider doesn't provide an icon. + } else { + if ($_['themedark']) { + $icon = image_path('core', 'actions/password-white.svg'); + } + else { + $icon = image_path('core', 'actions/password.svg'); + } + + } + /** @var \OCP\Authentication\TwoFactorAuth\IPersonalProviderSettings $settings */ + $settings = $data['settings']; + ?> + <h3> + <img class="two-factor-provider-settings-icon" src="<?php p($icon) ?>" alt=""> + <?php p($provider->getDisplayName()) ?> + </h3> + <?php print_unescaped($settings->getBody()->fetchPage()) ?> + </li> + <?php } ?> + </ul> +</div> + diff --git a/apps/settings/templates/settings/personal/security/authtokens.php b/apps/settings/templates/settings/personal/security/authtokens.php new file mode 100644 index 00000000000..1db0d91fe69 --- /dev/null +++ b/apps/settings/templates/settings/personal/security/authtokens.php @@ -0,0 +1,31 @@ +<?php +declare(strict_types=1); +/** + * @copyright Copyright (c) 2019, Roeland Jago Douma <roeland@famdouma.nl> + * + * @author Roeland Jago Douma <roeland@famdouma.nl> + * + * @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/>. + * + */ + +script('settings', [ + 'vue-settings-personal-security', +]); + +?> + +<div id="security-authtokens" class="section"></div> |