aboutsummaryrefslogtreecommitdiffstats
path: root/core/templates
diff options
context:
space:
mode:
Diffstat (limited to 'core/templates')
-rw-r--r--core/templates/403.php35
-rw-r--r--core/templates/404.php35
-rw-r--r--core/templates/429.php10
-rw-r--r--core/templates/altmail.php13
-rw-r--r--core/templates/confirmation.php19
-rw-r--r--core/templates/error.php24
-rw-r--r--core/templates/exception.php54
-rw-r--r--core/templates/filepicker.html10
-rw-r--r--core/templates/filetemplates/template.html9
-rw-r--r--core/templates/filetemplates/template.odpbin12910 -> 0 bytes
-rw-r--r--core/templates/filetemplates/template.odsbin7130 -> 0 bytes
-rw-r--r--core/templates/filetemplates/template.odtbin8449 -> 0 bytes
-rw-r--r--core/templates/installation.php173
-rw-r--r--core/templates/installation_forbidden.php12
-rw-r--r--core/templates/installation_incomplete.php12
-rw-r--r--core/templates/internalaltmail.php13
-rw-r--r--core/templates/internalmail.php39
-rw-r--r--core/templates/layout.base.php46
-rw-r--r--core/templates/layout.guest.php88
-rw-r--r--core/templates/layout.initial-state.php11
-rw-r--r--core/templates/layout.noscript.warning.php15
-rw-r--r--core/templates/layout.public.php114
-rw-r--r--core/templates/layout.user.php203
-rw-r--r--core/templates/legacy/fileexists.html35
-rw-r--r--core/templates/login.php104
-rw-r--r--core/templates/loginflow/authpicker.php59
-rw-r--r--core/templates/loginflow/grant.php47
-rw-r--r--core/templates/loginflowv2/authpicker.php56
-rw-r--r--core/templates/loginflowv2/done.php21
-rw-r--r--core/templates/loginflowv2/grant.php44
-rw-r--r--core/templates/lostpassword/email.php21
-rw-r--r--core/templates/lostpassword/resetpassword.php40
-rw-r--r--core/templates/mail.php39
-rw-r--r--core/templates/message.html3
-rw-r--r--core/templates/print_exception.php23
-rw-r--r--core/templates/print_xml_exception.php18
-rw-r--r--core/templates/publicshareauth.php87
-rw-r--r--core/templates/recommendedapps.php12
-rw-r--r--core/templates/singleuser.user.php10
-rw-r--r--core/templates/success.php17
-rw-r--r--core/templates/tags.html4
-rw-r--r--core/templates/twofactorselectchallenge.php82
-rw-r--r--core/templates/twofactorsetupchallenge.php20
-rw-r--r--core/templates/twofactorsetupselection.php41
-rw-r--r--core/templates/twofactorshowchallenge.php44
-rw-r--r--core/templates/unsupportedbrowser.php7
-rw-r--r--core/templates/untrustedDomain.php35
-rw-r--r--core/templates/update.admin.php37
-rw-r--r--core/templates/update.use-cli.php32
-rw-r--r--core/templates/update.user.php21
-rw-r--r--core/templates/xml_exception.php39
51 files changed, 1197 insertions, 736 deletions
diff --git a/core/templates/403.php b/core/templates/403.php
index a19009c3546..dc34c8d854f 100644
--- a/core/templates/403.php
+++ b/core/templates/403.php
@@ -1,15 +1,30 @@
<?php
-if(!isset($_)) {//also provide standalone error page
+/**
+ * SPDX-FileCopyrightText: 2016-2024 Nextcloud GmbH and Nextcloud contributors
+ * SPDX-FileCopyrightText: 2011-2016 ownCloud, Inc.
+ * SPDX-License-Identifier: AGPL-3.0-only
+ */
+// @codeCoverageIgnoreStart
+if (!isset($_)) {//standalone page is not supported anymore - redirect to /
require_once '../../lib/base.php';
-
- $tmpl = new OC_Template( '', '403', 'guest' );
- $tmpl->printPage();
+
+ $urlGenerator = \OCP\Server::get(\OCP\IURLGenerator::class);
+ header('Location: ' . $urlGenerator->getAbsoluteURL('/'));
exit;
}
+// @codeCoverageIgnoreEnd
?>
-<ul>
- <li class='error'>
- <?php p($l->t( 'Access forbidden' )); ?><br>
- <p class='hint'><?php if(isset($_['file'])) p($_['file'])?></p>
- </li>
-</ul>
+<div class="body-login-container update">
+ <div class="icon-big icon-password"></div>
+ <h2><?php p($l->t('Access forbidden')); ?></h2>
+ <p class="hint">
+ <?php if (isset($_['message'])): ?>
+ <?php p($_['message']); ?>
+ <?php else: ?>
+ <?php p($l->t('You are not allowed to access this page.')); ?>
+ <?php endif; ?>
+ </p>
+ <p><a class="button primary" href="<?php p(\OCP\Server::get(\OCP\IURLGenerator::class)->linkTo('', 'index.php')) ?>">
+ <?php p($l->t('Back to %s', [$theme->getName()])); ?>
+ </a></p>
+</div>
diff --git a/core/templates/404.php b/core/templates/404.php
index 2b12b12cff7..3dcce4d26d3 100644
--- a/core/templates/404.php
+++ b/core/templates/404.php
@@ -1,22 +1,31 @@
<?php
-/** @var $_ array */
-/** @var $l OC_L10N */
-if(!isset($_)) {//also provide standalone error page
+/**
+ * SPDX-FileCopyrightText: 2016-2024 Nextcloud GmbH and Nextcloud contributors
+ * SPDX-FileCopyrightText: 2011-2016 ownCloud, Inc.
+ * SPDX-License-Identifier: AGPL-3.0-only
+ */
+/** @var array $_ */
+/** @var \OCP\IL10N $l */
+/** @var \OCP\Defaults $theme */
+// @codeCoverageIgnoreStart
+if (!isset($_)) {//standalone page is not supported anymore - redirect to /
require_once '../../lib/base.php';
-
- $tmpl = new OC_Template( '', '404', 'guest' );
- $tmpl->printPage();
+
+ $urlGenerator = \OCP\Server::get(\OCP\IURLGenerator::class);
+ header('Location: ' . $urlGenerator->getAbsoluteURL('/'));
exit;
}
+// @codeCoverageIgnoreEnd
?>
<?php if (isset($_['content'])): ?>
<?php print_unescaped($_['content']) ?>
<?php else: ?>
- <ul>
- <li class="error">
- <?php p($l->t('File not found')); ?><br>
- <p class="hint"><?php p($l->t('The specified document has not been found on the server.')); ?></p>
- <p class="hint"><a href="<?php p(\OC::$server->getURLGenerator()->linkTo('', 'index.php')) ?>"><?php p($l->t('You can click here to return to %s.', array($theme->getName()))); ?></a></p>
- </li>
- </ul>
+ <div class="body-login-container update">
+ <div class="icon-big icon-search"></div>
+ <h2><?php p($l->t('Page not found')); ?></h2>
+ <p class="infogroup"><?php p($l->t('The page could not be found on the server or you may not be allowed to view it.')); ?></p>
+ <p><a class="button primary" href="<?php p(\OCP\Server::get(\OCP\IURLGenerator::class)->linkTo('', 'index.php')) ?>">
+ <?php p($l->t('Back to %s', [$theme->getName()])); ?>
+ </a></p>
+ </div>
<?php endif; ?>
diff --git a/core/templates/429.php b/core/templates/429.php
new file mode 100644
index 00000000000..0cfe1eb75ff
--- /dev/null
+++ b/core/templates/429.php
@@ -0,0 +1,10 @@
+<?php
+/**
+ * SPDX-FileCopyrightText: 2020 Nextcloud GmbH and Nextcloud contributors
+ * SPDX-License-Identifier: AGPL-3.0-or-later
+ */
+?>
+<div class="body-login-container update">
+ <h2><?php p($l->t('Too many requests')); ?></h2>
+ <p class="infogroup"><?php p($l->t('There were too many requests from your network. Retry later or contact your administrator if this is an error.')); ?></p>
+</div>
diff --git a/core/templates/altmail.php b/core/templates/altmail.php
deleted file mode 100644
index 38531d109b7..00000000000
--- a/core/templates/altmail.php
+++ /dev/null
@@ -1,13 +0,0 @@
-<?php
-print_unescaped($l->t("Hey there,\n\njust letting you know that %s shared %s with you.\nView it: %s\n\n", array($_['user_displayname'], $_['filename'], $_['link'])));
-if ( isset($_['expiration']) ) {
- print_unescaped($l->t("The share will expire on %s.", array($_['expiration'])));
- print_unescaped("\n\n");
-}
-// TRANSLATORS term at the end of a mail
-p($l->t("Cheers!"));
-?>
-
---
-<?php p($theme->getName() . ' - ' . $theme->getSlogan()); ?>
-<?php print_unescaped("\n".$theme->getBaseUrl());
diff --git a/core/templates/confirmation.php b/core/templates/confirmation.php
new file mode 100644
index 00000000000..0a73699fd68
--- /dev/null
+++ b/core/templates/confirmation.php
@@ -0,0 +1,19 @@
+<?php
+/**
+ * SPDX-FileCopyrightText: 2021 Nextcloud GmbH and Nextcloud contributors
+ * SPDX-License-Identifier: AGPL-3.0-or-later
+ */
+/** @var array $_ */
+/** @var \OCP\IL10N $l */
+/** @var \OCP\Defaults $theme */
+?>
+<div class="guest-box">
+ <form method="POST">
+ <h2><?php p($_['title']) ?></h2>
+ <p><?php p($_['message']) ?></p>
+ <div class="buttons">
+ <input type="submit" class="primary" value="<?php p($_['action']); ?>">
+ </div>
+ <input type="hidden" name="requesttoken" value="<?php p($_['requesttoken']) ?>">
+ </form>
+</div>
diff --git a/core/templates/error.php b/core/templates/error.php
index 6e044b72414..ac9bd34d558 100644
--- a/core/templates/error.php
+++ b/core/templates/error.php
@@ -1,10 +1,20 @@
-<ul class="error-wide">
- <?php foreach($_["errors"] as $error):?>
- <li class='error'>
- <?php p($error['error']) ?><br>
- <?php if(isset($error['hint']) && $error['hint']): ?>
- <p class='hint'><?php print_unescaped($error['hint']) ?></p>
+<?php
+/**
+ * SPDX-FileCopyrightText: 2017-2024 Nextcloud GmbH and Nextcloud contributors
+ * SPDX-FileCopyrightText: 2011-2015 ownCloud, Inc.
+ * SPDX-License-Identifier: AGPL-3.0-only
+ */
+?>
+<div class="guest-box">
+ <h2><?php p($l->t('Error')) ?></h2>
+ <ul>
+ <?php foreach ($_['errors'] as $error):?>
+ <li>
+ <p><?php p($error['error']) ?></p>
+ <?php if (isset($error['hint']) && $error['hint']): ?>
+ <p class='hint'><?php p($error['hint']) ?></p>
<?php endif;?>
</li>
<?php endforeach ?>
-</ul>
+ </ul>
+</div>
diff --git a/core/templates/exception.php b/core/templates/exception.php
index 899ea29456c..44f9908c57c 100644
--- a/core/templates/exception.php
+++ b/core/templates/exception.php
@@ -1,32 +1,42 @@
<?php
- /** @var array $_ */
- /** @var OC_L10N $l */
+/**
+ * SPDX-FileCopyrightText: 2016-2024 Nextcloud GmbH and Nextcloud contributors
+ * SPDX-FileCopyrightText: 2012-2015 ownCloud, Inc.
+ * SPDX-License-Identifier: AGPL-3.0-only
+ */
+/** @var array $_ */
+/** @var \OCP\IL10N $l */
+
+style('core', ['styles', 'header', 'exception']);
+
+require_once __DIR__ . '/print_exception.php';
-style('core', ['styles', 'header']);
?>
-<span class="error error-wide">
- <h2><strong><?php p($l->t('Internal Server Error')) ?></strong></h2>
- <p><?php p($l->t('The server encountered an internal error and was unable to complete your request.')) ?></p>
- <p><?php p($l->t('Please contact the server administrator if this error reappears multiple times, please include the technical details below in your report.')) ?></p>
- <p><?php p($l->t('More details can be found in the server log.')) ?></p>
- <br>
+<div class="guest-box wide">
+ <h2><?php p($l->t('Internal Server Error')) ?></h2>
+ <p><?php p($l->t('The server was unable to complete your request.')) ?></p>
+ <p><?php p($l->t('If this happens again, please send the technical details below to the server administrator.')) ?></p>
+ <p><?php p($l->t('More details can be found in the server log.')) ?></p>
+ <?php if (isset($_['serverLogsDocumentation']) && $_['serverLogsDocumentation'] !== ''): ?>
+ <p><a href="<?php print_unescaped($_['serverLogsDocumentation']) ?>" target="_blank" rel="noopener"><?php p($l->t('For more details see the documentation ↗.')) ?></a></p>
+ <?php endif; ?>
- <h2><strong><?php p($l->t('Technical details')) ?></strong></h2>
+ <h3><?php p($l->t('Technical details')) ?></h3>
<ul>
- <li><?php p($l->t('Remote Address: %s', $_['remoteAddr'])) ?></li>
- <li><?php p($l->t('Request ID: %s', $_['requestID'])) ?></li>
- <?php if($_['debugMode']): ?>
- <li><?php p($l->t('Type: %s', $_['errorClass'])) ?></li>
- <li><?php p($l->t('Code: %s', $_['errorCode'])) ?></li>
- <li><?php p($l->t('Message: %s', $_['errorMsg'])) ?></li>
- <li><?php p($l->t('File: %s', $_['file'])) ?></li>
- <li><?php p($l->t('Line: %s', $_['line'])) ?></li>
+ <li><?php p($l->t('Remote Address: %s', [$_['remoteAddr']])) ?></li>
+ <li><?php p($l->t('Request ID: %s', [$_['requestID']])) ?></li>
+ <?php if (isset($_['debugMode']) && $_['debugMode'] === true): ?>
+ <li><?php p($l->t('Type: %s', [$_['errorClass']])) ?></li>
+ <li><?php p($l->t('Code: %s', [$_['errorCode']])) ?></li>
+ <li><?php p($l->t('Message: %s', [$_['errorMsg']])) ?></li>
+ <li><?php p($l->t('File: %s', [$_['file']])) ?></li>
+ <li><?php p($l->t('Line: %s', [$_['line']])) ?></li>
<?php endif; ?>
</ul>
- <?php if($_['debugMode']): ?>
+ <?php if (isset($_['debugMode']) && $_['debugMode'] === true): ?>
<br />
- <h2><strong><?php p($l->t('Trace')) ?></strong></h2>
- <pre><?php p($_['trace']) ?></pre>
+ <h3><?php p($l->t('Trace')) ?></h3>
+ <?php print_exception($_['exception'], $l); ?>
<?php endif; ?>
-</span>
+</div>
diff --git a/core/templates/filepicker.html b/core/templates/filepicker.html
deleted file mode 100644
index e761fbdb567..00000000000
--- a/core/templates/filepicker.html
+++ /dev/null
@@ -1,10 +0,0 @@
-<div id="{dialog_name}" title="{title}">
- <span class="dirtree"></span>
- <ul class="filelist">
- <li data-entryname="{filename}" data-type="{type}">
- <img />
- <span class="filename">{filename}</span>
- <span class="date">{date}</span>
- </li>
- </ul>
-</div>
diff --git a/core/templates/filetemplates/template.html b/core/templates/filetemplates/template.html
deleted file mode 100644
index f16e80cb7ef..00000000000
--- a/core/templates/filetemplates/template.html
+++ /dev/null
@@ -1,9 +0,0 @@
-<!DOCTYPE html>
-<html>
- <head>
-
- </head>
- <body>
-
- </body>
-</html>
diff --git a/core/templates/filetemplates/template.odp b/core/templates/filetemplates/template.odp
deleted file mode 100644
index f6371165b82..00000000000
--- a/core/templates/filetemplates/template.odp
+++ /dev/null
Binary files differ
diff --git a/core/templates/filetemplates/template.ods b/core/templates/filetemplates/template.ods
deleted file mode 100644
index e5e8b0bed8b..00000000000
--- a/core/templates/filetemplates/template.ods
+++ /dev/null
Binary files differ
diff --git a/core/templates/filetemplates/template.odt b/core/templates/filetemplates/template.odt
deleted file mode 100644
index cbb49a1cf3e..00000000000
--- a/core/templates/filetemplates/template.odt
+++ /dev/null
Binary files differ
diff --git a/core/templates/installation.php b/core/templates/installation.php
index 7f179bfa5d6..b002ee400cc 100644
--- a/core/templates/installation.php
+++ b/core/templates/installation.php
@@ -1,169 +1,8 @@
<?php
-script('core', [
- 'jquery-showpassword',
- 'installation'
-]);
+/**
+ * SPDX-FileCopyrightText: 2016-2024 Nextcloud GmbH and Nextcloud contributors
+ * SPDX-FileCopyrightText: 2011-2016 ownCloud, Inc.
+ * SPDX-License-Identifier: AGPL-3.0-only
+ */
?>
-<input type='hidden' id='hasMySQL' value='<?php p($_['hasMySQL']) ?>'>
-<input type='hidden' id='hasSQLite' value='<?php p($_['hasSQLite']) ?>'>
-<input type='hidden' id='hasPostgreSQL' value='<?php p($_['hasPostgreSQL']) ?>'>
-<input type='hidden' id='hasOracle' value='<?php p($_['hasOracle']) ?>'>
-<form action="index.php" method="post">
-<input type="hidden" name="install" value="true">
- <?php if(count($_['errors']) > 0): ?>
- <fieldset class="warning">
- <legend><strong><?php p($l->t('Error'));?></strong></legend>
- <?php foreach($_['errors'] as $err): ?>
- <p>
- <?php if(is_array($err)):?>
- <?php print_unescaped($err['error']); ?>
- <span class='hint'><?php print_unescaped($err['hint']); ?></span>
- <?php else: ?>
- <?php print_unescaped($err); ?>
- <?php endif; ?>
- </p>
- <?php endforeach; ?>
- </fieldset>
- <?php endif; ?>
- <?php if(!$_['htaccessWorking']): ?>
- <fieldset class="warning">
- <legend><strong><?php p($l->t('Security warning'));?></strong></legend>
- <p><?php p($l->t('Your data directory and files are probably accessible from the internet because the .htaccess file does not work.'));?><br>
- <?php print_unescaped($l->t(
- 'For information how to properly configure your server, please see the <a href="%s" target="_blank" rel="noreferrer">documentation</a>.',
- link_to_docs('admin-install')
- )); ?></p>
- </fieldset>
- <?php endif; ?>
- <fieldset id="adminaccount">
- <legend><?php print_unescaped($l->t( 'Create an <strong>admin account</strong>' )); ?></legend>
- <p class="grouptop">
- <input type="text" name="adminlogin" id="adminlogin"
- placeholder="<?php p($l->t( 'Username' )); ?>"
- value="<?php p($_['adminlogin']); ?>"
- autocomplete="off" autocapitalize="off" autocorrect="off" autofocus required>
- <label for="adminlogin" class="infield"><?php p($l->t( 'Username' )); ?></label>
- </p>
- <p class="groupbottom">
- <input type="password" name="adminpass" data-typetoggle="#show" id="adminpass"
- placeholder="<?php p($l->t( 'Password' )); ?>"
- value="<?php p($_['adminpass']); ?>"
- autocomplete="off" autocapitalize="off" autocorrect="off" required>
- <label for="adminpass" class="infield"><?php p($l->t( 'Password' )); ?></label>
- <input type="checkbox" id="show" name="show">
- <label for="show" class="svg"></label>
- <div class="strengthify-wrapper"></div>
- </p>
- </fieldset>
-
- <?php if(!$_['directoryIsSet'] OR !$_['dbIsSet'] OR count($_['errors']) > 0): ?>
- <fieldset id="advancedHeader">
- <legend><a id="showAdvanced"><?php p($l->t( 'Storage & database' )); ?> <img class="svg" src="<?php print_unescaped(image_path('', 'actions/caret.svg')); ?>" /></a></legend>
- </fieldset>
- <?php endif; ?>
-
- <?php if(!$_['directoryIsSet'] OR count($_['errors']) > 0): ?>
- <fieldset id="datadirField">
- <div id="datadirContent">
- <label for="directory"><?php p($l->t( 'Data folder' )); ?></label>
- <input type="text" name="directory" id="directory"
- placeholder="<?php p(OC::$SERVERROOT.'/data'); ?>"
- value="<?php p($_['directory']); ?>"
- autocomplete="off" autocapitalize="off" autocorrect="off">
- </div>
- </fieldset>
- <?php endif; ?>
-
- <?php if(!$_['dbIsSet'] OR count($_['errors']) > 0): ?>
- <fieldset id='databaseBackend'>
- <?php if($_['hasMySQL'] or $_['hasPostgreSQL'] or $_['hasOracle'])
- $hasOtherDB = true; else $hasOtherDB =false; //other than SQLite ?>
- <legend><?php p($l->t( 'Configure the database' )); ?></legend>
- <div id="selectDbType">
- <?php foreach($_['databases'] as $type => $label): ?>
- <?php if(count($_['databases']) === 1): ?>
- <p class="info">
- <?php p($l->t( 'Only %s is available.', array($label) )); ?>
- <?php p($l->t( 'Install and activate additional PHP modules to choose other database types.' )); ?><br>
- <a href="<?php print_unescaped(link_to_docs('admin-source_install')); ?>" target="_blank" rel="noreferrer">
- <?php p($l->t( 'For more details check out the documentation.' )); ?> ↗</a>
- </p>
- <input type="hidden" id="dbtype" name="dbtype" value="<?php p($type) ?>">
- <?php else: ?>
- <input type="radio" name="dbtype" value="<?php p($type) ?>" id="<?php p($type) ?>"
- <?php print_unescaped($_['dbtype'] === $type ? 'checked="checked" ' : '') ?>/>
- <label class="<?php p($type) ?>" for="<?php p($type) ?>"><?php p($label) ?></label>
- <?php endif; ?>
- <?php endforeach; ?>
- </div>
- </fieldset>
-
- <?php if($hasOtherDB): ?>
- <fieldset id='databaseField'>
- <div id="use_other_db">
- <p class="grouptop">
- <label for="dbuser" class="infield"><?php p($l->t( 'Database user' )); ?></label>
- <input type="text" name="dbuser" id="dbuser"
- placeholder="<?php p($l->t( 'Database user' )); ?>"
- value="<?php p($_['dbuser']); ?>"
- autocomplete="off" autocapitalize="off" autocorrect="off">
- </p>
- <p class="groupmiddle">
- <input type="password" name="dbpass" id="dbpass" data-typetoggle="#dbpassword"
- placeholder="<?php p($l->t( 'Database password' )); ?>"
- value="<?php p($_['dbpass']); ?>"
- autocomplete="off" autocapitalize="off" autocorrect="off">
- <label for="dbpass" class="infield"><?php p($l->t( 'Database password' )); ?></label>
- <input type="checkbox" id="dbpassword" name="dbpassword">
- <label for="dbpassword"></label>
- </p>
- <p class="groupmiddle">
- <label for="dbname" class="infield"><?php p($l->t( 'Database name' )); ?></label>
- <input type="text" name="dbname" id="dbname"
- placeholder="<?php p($l->t( 'Database name' )); ?>"
- value="<?php p($_['dbname']); ?>"
- autocomplete="off" autocapitalize="off" autocorrect="off"
- pattern="[0-9a-zA-Z$_-]+">
- </p>
- <?php if($_['hasOracle']): ?>
- <div id="use_oracle_db">
- <p class="groupmiddle">
- <label for="dbtablespace" class="infield"><?php p($l->t( 'Database tablespace' )); ?></label>
- <input type="text" name="dbtablespace" id="dbtablespace"
- placeholder="<?php p($l->t( 'Database tablespace' )); ?>"
- value="<?php p($_['dbtablespace']); ?>"
- autocomplete="off" autocapitalize="off" autocorrect="off">
- </p>
- </div>
- <?php endif; ?>
- <p class="groupbottom">
- <label for="dbhost" class="infield"><?php p($l->t( 'Database host' )); ?></label>
- <input type="text" name="dbhost" id="dbhost"
- placeholder="<?php p($l->t( 'Database host' )); ?>"
- value="<?php p($_['dbhost']); ?>"
- autocomplete="off" autocapitalize="off" autocorrect="off">
- </p>
- </div>
- </fieldset>
- <?php endif; ?>
- <?php endif; ?>
-
- <div class="icon-loading-dark float-spinner">&nbsp;</div>
-
- <?php if(!$_['dbIsSet'] OR count($_['errors']) > 0): ?>
- <fieldset id="sqliteInformation" class="warning">
- <legend><?php p($l->t('Performance warning'));?></legend>
- <p><?php p($l->t('SQLite will be used as database.'));?></p>
- <p><?php p($l->t('For larger installations we recommend to choose a different database backend.'));?></p>
- <p><?php p($l->t('Especially when using the desktop client for file syncing the use of SQLite is discouraged.')); ?></p>
- </fieldset>
- <?php endif ?>
-
- <div class="buttons"><input type="submit" class="primary" value="<?php p($l->t( 'Finish setup' )); ?>" data-finishing="<?php p($l->t( 'Finishing …' )); ?>"></div>
-
- <p class="info">
- <span class="icon-info-white svg"></span>
- <?php p($l->t('Need help?'));?>
- <a target="_blank" rel="noreferrer" href="<?php p(link_to_docs('admin-install')); ?>"><?php p($l->t('See the documentation'));?> ↗</a>
- </p>
-</form>
+<div id="content"></div>
diff --git a/core/templates/installation_forbidden.php b/core/templates/installation_forbidden.php
new file mode 100644
index 00000000000..56b4a9082f4
--- /dev/null
+++ b/core/templates/installation_forbidden.php
@@ -0,0 +1,12 @@
+<?php
+/**
+ * SPDX-FileCopyrightText: 2019 Nextcloud GmbH and Nextcloud contributors
+ * SPDX-License-Identifier: AGPL-3.0-or-later
+ */
+?>
+<div class="guest-box">
+ <h2><?php p($l->t('Error')) ?></h2>
+ <p class="text-left">
+ <?php p($l->t('It looks like you are trying to reinstall your Nextcloud. However the file CAN_INSTALL is missing from your config directory. Please create the file CAN_INSTALL in your config folder to continue.')) ?>
+ </p>
+</div>
diff --git a/core/templates/installation_incomplete.php b/core/templates/installation_incomplete.php
new file mode 100644
index 00000000000..b3a3cae5988
--- /dev/null
+++ b/core/templates/installation_incomplete.php
@@ -0,0 +1,12 @@
+<?php
+/**
+ * SPDX-FileCopyrightText: 2019 Nextcloud GmbH and Nextcloud contributors
+ * SPDX-License-Identifier: AGPL-3.0-or-later
+ */
+?>
+<div class="guest-box">
+ <h2><?php p($l->t('Error')) ?></h2>
+ <p class="text-left">
+ <?php p($l->t('Could not remove CAN_INSTALL from the config folder. Please remove this file manually.')) ?>
+ </p>
+</div>
diff --git a/core/templates/internalaltmail.php b/core/templates/internalaltmail.php
deleted file mode 100644
index 38531d109b7..00000000000
--- a/core/templates/internalaltmail.php
+++ /dev/null
@@ -1,13 +0,0 @@
-<?php
-print_unescaped($l->t("Hey there,\n\njust letting you know that %s shared %s with you.\nView it: %s\n\n", array($_['user_displayname'], $_['filename'], $_['link'])));
-if ( isset($_['expiration']) ) {
- print_unescaped($l->t("The share will expire on %s.", array($_['expiration'])));
- print_unescaped("\n\n");
-}
-// TRANSLATORS term at the end of a mail
-p($l->t("Cheers!"));
-?>
-
---
-<?php p($theme->getName() . ' - ' . $theme->getSlogan()); ?>
-<?php print_unescaped("\n".$theme->getBaseUrl());
diff --git a/core/templates/internalmail.php b/core/templates/internalmail.php
deleted file mode 100644
index c2d84184d38..00000000000
--- a/core/templates/internalmail.php
+++ /dev/null
@@ -1,39 +0,0 @@
-<table cellspacing="0" cellpadding="0" border="0" width="100%">
-<tr><td>
-<table cellspacing="0" cellpadding="0" border="0" width="600px">
-<tr>
-<td bgcolor="<?php p($theme->getMailHeaderColor());?>" width="20px">&nbsp;</td>
-<td bgcolor="<?php p($theme->getMailHeaderColor());?>">
-<img src="<?php p(\OC::$server->getURLGenerator()->getAbsoluteURL(image_path('', 'logo-mail.gif'))); ?>" alt="<?php p($theme->getName()); ?>"/>
-</td>
-</tr>
-<tr><td colspan="2">&nbsp;</td></tr>
-<tr>
-<td width="20px">&nbsp;</td>
-<td style="font-weight:normal; font-size:0.8em; line-height:1.2em; font-family:verdana,'arial',sans;">
-<?php
-print_unescaped($l->t('Hey there,<br><br>just letting you know that %s shared <strong>%s</strong> with you.<br><a href="%s">View it!</a><br><br>', array($_['user_displayname'], $_['filename'], $_['link'])));
-if ( isset($_['expiration']) ) {
- p($l->t("The share will expire on %s.", array($_['expiration'])));
- print_unescaped('<br><br>');
-}
-// TRANSLATORS term at the end of a mail
-p($l->t('Cheers!'));
-?>
-</td>
-</tr>
-<tr><td colspan="2">&nbsp;</td></tr>
-<tr>
-<td width="20px">&nbsp;</td>
-<td style="font-weight:normal; font-size:0.8em; line-height:1.2em; font-family:verdana,'arial',sans;">--<br>
-<?php p($theme->getName()); ?> -
-<?php p($theme->getSlogan()); ?>
-<br><a href="<?php p($theme->getBaseUrl()); ?>"><?php p($theme->getBaseUrl());?></a>
-</td>
-</tr>
-<tr>
-<td colspan="2">&nbsp;</td>
-</tr>
-</table>
-</td></tr>
-</table>
diff --git a/core/templates/layout.base.php b/core/templates/layout.base.php
index 29c2ca6696d..44731172760 100644
--- a/core/templates/layout.base.php
+++ b/core/templates/layout.base.php
@@ -1,32 +1,34 @@
+<?php
+/**
+ * SPDX-FileCopyrightText: 2016-2024 Nextcloud GmbH and Nextcloud contributors
+ * SPDX-FileCopyrightText: 2012-2016 ownCloud, Inc.
+ * SPDX-License-Identifier: AGPL-3.0-only
+ */
+?>
<!DOCTYPE html>
-<!--[if lte IE 8]><html class="ng-csp ie ie8 lte9 lte8" data-placeholder-focus="false" lang="<?php p($_['language']); ?>" ><![endif]-->
-<!--[if IE 9]><html class="ng-csp ie ie9 lte9" data-placeholder-focus="false" lang="<?php p($_['language']); ?>" ><![endif]-->
-<!--[if (gt IE 9)|!(IE)]><!--><html class="ng-csp" data-placeholder-focus="false" lang="<?php p($_['language']); ?>" ><!--<![endif]-->
+<html class="ng-csp" data-placeholder-focus="false" lang="<?php p($_['language']); ?>" data-locale="<?php p($_['locale']); ?>" translate="no" >
<head data-requesttoken="<?php p($_['requesttoken']); ?>">
<meta charset="utf-8">
<title>
<?php p($theme->getTitle()); ?>
</title>
- <meta http-equiv="X-UA-Compatible" content="IE=edge">
- <meta name="referrer" content="never">
- <meta name="viewport" content="width=device-width, minimum-scale=1.0, maximum-scale=1.0">
- <meta name="theme-color" content="<?php p($theme->getMailHeaderColor()); ?>">
- <link rel="icon" href="<?php print_unescaped(image_path('', 'favicon.ico')); /* IE11+ supports png */ ?>">
- <link rel="apple-touch-icon-precomposed" href="<?php print_unescaped(image_path('', 'favicon-touch.png')); ?>">
- <link rel="mask-icon" sizes="any" href="<?php print_unescaped(image_path('', 'favicon-mask.svg')); ?>" color="#1d2d44">
- <?php foreach ($_['cssfiles'] as $cssfile): ?>
- <link rel="stylesheet" href="<?php print_unescaped($cssfile); ?>">
- <?php endforeach; ?>
- <?php foreach($_['printcssfiles'] as $cssfile): ?>
- <link rel="stylesheet" href="<?php print_unescaped($cssfile); ?>" media="print">
- <?php endforeach; ?>
- <?php foreach ($_['jsfiles'] as $jsfile): ?>
- <script src="<?php print_unescaped($jsfile); ?>"></script>
- <?php endforeach; ?>
+ <meta name="viewport" content="width=device-width, initial-scale=1.0, minimum-scale=1.0<?php if (isset($_['viewport_maximum_scale'])) {
+ p(', maximum-scale=' . $_['viewport_maximum_scale']);
+ } ?>">
+ <meta name="theme-color" content="<?php p($theme->getColorPrimary()); ?>">
+ <meta name="csp-nonce" nonce="<?php p($_['cspNonce']); /* Do not pass into "content" to prevent exfiltration */ ?>">
+ <link rel="icon" href="<?php print_unescaped(image_path('core', 'favicon.ico')); /* IE11+ supports png */ ?>">
+ <link rel="apple-touch-icon" href="<?php print_unescaped(image_path('core', 'favicon-touch.png')); ?>">
+ <link rel="mask-icon" sizes="any" href="<?php print_unescaped(image_path('core', 'favicon-mask.svg')); ?>" color="<?php p($theme->getColorPrimary()); ?>">
+ <?php emit_css_loading_tags($_); ?>
+ <?php emit_script_loading_tags($_); ?>
<?php print_unescaped($_['headers']); ?>
</head>
- <body id="body-public">
- <?php include('layout.noscript.warning.php'); ?>
- <?php print_unescaped($_['content']); ?>
+ <body id="body-public" class="layout-base">
+ <?php include 'layout.noscript.warning.php'; ?>
+ <?php include 'layout.initial-state.php'; ?>
+ <div id="content" class="app-public" role="main">
+ <?php print_unescaped($_['content']); ?>
+ </div>
</body>
</html>
diff --git a/core/templates/layout.guest.php b/core/templates/layout.guest.php
index 3f9c47f9aa6..1b5b90c29fc 100644
--- a/core/templates/layout.guest.php
+++ b/core/templates/layout.guest.php
@@ -1,54 +1,70 @@
+<?php
+/**
+ * SPDX-FileCopyrightText: 2016-2024 Nextcloud GmbH and Nextcloud contributors
+ * SPDX-FileCopyrightText: 2011-2016 ownCloud, Inc.
+ * SPDX-License-Identifier: AGPL-3.0-only
+ */
+?>
<!DOCTYPE html>
-<!--[if lte IE 8]><html class="ng-csp ie ie8 lte9 lte8" data-placeholder-focus="false" lang="<?php p($_['language']); ?>" ><![endif]-->
-<!--[if IE 9]><html class="ng-csp ie ie9 lte9" data-placeholder-focus="false" lang="<?php p($_['language']); ?>" ><![endif]-->
-<!--[if (gt IE 9)|!(IE)]><!--><html class="ng-csp" data-placeholder-focus="false" lang="<?php p($_['language']); ?>" ><!--<![endif]-->
- <head data-requesttoken="<?php p($_['requesttoken']); ?>">
+<html class="ng-csp" data-placeholder-focus="false" lang="<?php p($_['language']); ?>" data-locale="<?php p($_['locale']); ?>" translate="no" >
+ <head
+<?php if ($_['user_uid']) { ?>
+ data-user="<?php p($_['user_uid']); ?>" data-user-displayname="<?php p($_['user_displayname']); ?>"
+<?php } ?>
+ data-requesttoken="<?php p($_['requesttoken']); ?>">
<meta charset="utf-8">
<title>
- <?php p($theme->getTitle()); ?>
+ <?php
+ p(!empty($_['pageTitle']) ? $_['pageTitle'] . ' – ' : '');
+p($theme->getTitle());
+?>
</title>
- <meta http-equiv="X-UA-Compatible" content="IE=edge">
- <meta name="referrer" content="never">
- <meta name="viewport" content="width=device-width, minimum-scale=1.0, maximum-scale=1.0">
+ <meta name="csp-nonce" nonce="<?php p($_['cspNonce']); /* Do not pass into "content" to prevent exfiltration */ ?>">
+ <meta name="viewport" content="width=device-width, initial-scale=1.0, minimum-scale=1.0<?php if (isset($_['viewport_maximum_scale'])) {
+ p(', maximum-scale=' . $_['viewport_maximum_scale']);
+ } ?>">
+ <?php if ($theme->getiTunesAppId() !== '') { ?>
<meta name="apple-itunes-app" content="app-id=<?php p($theme->getiTunesAppId()); ?>">
- <meta name="theme-color" content="<?php p($theme->getMailHeaderColor()); ?>">
- <link rel="icon" href="<?php print_unescaped(image_path('', 'favicon.ico')); /* IE11+ supports png */ ?>">
- <link rel="apple-touch-icon-precomposed" href="<?php print_unescaped(image_path('', 'favicon-touch.png')); ?>">
- <link rel="mask-icon" sizes="any" href="<?php print_unescaped(image_path('', 'favicon-mask.svg')); ?>" color="#1d2d44">
- <?php foreach($_['cssfiles'] as $cssfile): ?>
- <link rel="stylesheet" href="<?php print_unescaped($cssfile); ?>">
- <?php endforeach; ?>
- <?php foreach($_['printcssfiles'] as $cssfile): ?>
- <link rel="stylesheet" href="<?php print_unescaped($cssfile); ?>" media="print">
- <?php endforeach; ?>
- <?php foreach($_['jsfiles'] as $jsfile): ?>
- <script src="<?php print_unescaped($jsfile); ?>"></script>
- <?php endforeach; ?>
+ <?php } ?>
+ <meta name="theme-color" content="<?php p($theme->getColorPrimary()); ?>">
+ <link rel="icon" href="<?php print_unescaped(image_path('core', 'favicon.ico')); /* IE11+ supports png */ ?>">
+ <link rel="apple-touch-icon" href="<?php print_unescaped(image_path('core', 'favicon-touch.png')); ?>">
+ <link rel="mask-icon" sizes="any" href="<?php print_unescaped(image_path('core', 'favicon-mask.svg')); ?>" color="<?php p($theme->getColorPrimary()); ?>">
+ <link rel="manifest" href="<?php print_unescaped(image_path('core', 'manifest.json')); ?>" crossorigin="use-credentials">
+ <?php emit_css_loading_tags($_); ?>
+ <?php emit_script_loading_tags($_); ?>
<?php print_unescaped($_['headers']); ?>
</head>
- <body id="<?php p($_['bodyid']);?>">
- <?php include('layout.noscript.warning.php'); ?>
+ <body id="<?php p($_['bodyid']);?>" <?php foreach ($_['enabledThemes'] as $themeId) {
+ p("data-theme-$themeId ");
+ }?> data-themes="<?php p(join(',', $_['enabledThemes'])) ?>">
+ <?php include 'layout.noscript.warning.php'; ?>
+ <?php include 'layout.initial-state.php'; ?>
<div class="wrapper">
<div class="v-align">
- <?php if ($_['bodyid'] === 'body-login' ): ?>
- <header role="banner">
- <div id="header">
- <div class="logo svg">
- <h1 class="hidden-visually">
- <?php p($theme->getName()); ?>
- </h1>
- </div>
- <div id="logo-claim" style="display:none;"><?php p($theme->getLogoClaim()); ?></div>
+ <?php if ($_['bodyid'] === 'body-login'): ?>
+ <header>
+ <div id="header" class="header-guest">
+ <div class="logo"></div>
</div>
</header>
<?php endif; ?>
- <?php print_unescaped($_['content']); ?>
- <div class="push"></div><!-- for sticky footer -->
+ <div>
+ <h1 class="hidden-visually">
+ <?php p($theme->getName()); ?>
+ </h1>
+ <?php print_unescaped($_['content']); ?>
+ </div>
</div>
</div>
- <footer role="contentinfo">
+ <?php
+ $longFooter = $theme->getLongFooter();
+?>
+ <footer class="guest-box <?php if ($longFooter === '') {
+ p('hidden');
+ } ?>">
<p class="info">
- <?php print_unescaped($theme->getLongFooter()); ?>
+ <?php print_unescaped($longFooter); ?>
</p>
</footer>
</body>
diff --git a/core/templates/layout.initial-state.php b/core/templates/layout.initial-state.php
new file mode 100644
index 00000000000..f2387990b12
--- /dev/null
+++ b/core/templates/layout.initial-state.php
@@ -0,0 +1,11 @@
+<?php
+/**
+ * SPDX-FileCopyrightText: 2024 Nextcloud GmbH and Nextcloud contributors
+ * SPDX-License-Identifier: AGPL-3.0-or-later
+ */
+?>
+<div id="initial-state-container" style="display: none;">
+ <?php foreach ($_['initialStates'] as $app => $initialState) { ?>
+ <input type="hidden" id="initial-state-<?php p($app); ?>" value="<?php p(base64_encode($initialState)); ?>">
+ <?php }?>
+</div>
diff --git a/core/templates/layout.noscript.warning.php b/core/templates/layout.noscript.warning.php
index ba781f5502e..103af843477 100644
--- a/core/templates/layout.noscript.warning.php
+++ b/core/templates/layout.noscript.warning.php
@@ -1,11 +1,18 @@
+<?php
+/**
+ * SPDX-FileCopyrightText: 2017-2024 Nextcloud GmbH and Nextcloud contributors
+ * SPDX-FileCopyrightText: 2015 ownCloud, Inc.
+ * SPDX-License-Identifier: AGPL-3.0-only
+ */
+?>
<noscript>
<div id="nojavascript">
<div>
<?php print_unescaped(str_replace(
- ['{linkstart}', '{linkend}'],
- ['<a href="http://enable-javascript.com/" target="_blank" rel="noreferrer">', '</a>'],
- $l->t('This application requires JavaScript for correct operation. Please {linkstart}enable JavaScript{linkend} and reload the page.')
- )); ?>
+ ['{linkstart}', '{linkend}'],
+ ['<a href="https://www.enable-javascript.com/" target="_blank" rel="noreferrer noopener">', '</a>'],
+ $l->t('This application requires JavaScript for correct operation. Please {linkstart}enable JavaScript{linkend} and reload the page.')
+ )); ?>
</div>
</div>
</noscript>
diff --git a/core/templates/layout.public.php b/core/templates/layout.public.php
new file mode 100644
index 00000000000..60460d60c83
--- /dev/null
+++ b/core/templates/layout.public.php
@@ -0,0 +1,114 @@
+<?php
+/**
+ * SPDX-FileCopyrightText: 2018-2024 Nextcloud GmbH and Nextcloud contributors
+ * SPDX-License-Identifier: AGPL-3.0-or-later
+ */
+?>
+<!DOCTYPE html>
+<html class="ng-csp" data-placeholder-focus="false" lang="<?php p($_['language']); ?>" data-locale="<?php p($_['locale']); ?>" translate="no" >
+<head data-requesttoken="<?php p($_['requesttoken']); ?>">
+ <meta charset="utf-8">
+ <title>
+ <?php
+ p(!empty($_['pageTitle']) && (empty($_['application']) || $_['pageTitle'] !== $_['application']) ? $_['pageTitle'] . ' - ' : '');
+p(!empty($_['application']) ? $_['application'] . ' - ' : '');
+p($theme->getTitle());
+?>
+ </title>
+ <meta name="csp-nonce" nonce="<?php p($_['cspNonce']); /* Do not pass into "content" to prevent exfiltration */ ?>">
+ <meta name="viewport" content="width=device-width, initial-scale=1.0, minimum-scale=1.0<?php if (isset($_['viewport_maximum_scale'])) {
+ p(', maximum-scale=' . $_['viewport_maximum_scale']);
+ } ?>">
+ <?php if ($theme->getiTunesAppId() !== '') { ?>
+ <meta name="apple-itunes-app" content="app-id=<?php p($theme->getiTunesAppId()); ?>">
+ <?php } ?>
+ <meta name="apple-mobile-web-app-capable" content="yes">
+ <meta name="apple-mobile-web-app-status-bar-style" content="black">
+ <meta name="apple-mobile-web-app-title" content="<?php p((!empty($_['application']) && $_['appid'] !== 'files')? $_['application']:$theme->getTitle()); ?>">
+ <meta name="mobile-web-app-capable" content="yes">
+ <meta name="theme-color" content="<?php p($theme->getColorPrimary()); ?>">
+ <link rel="icon" href="<?php print_unescaped(image_path($_['appid'], 'favicon.ico')); /* IE11+ supports png */ ?>">
+ <link rel="apple-touch-icon" href="<?php print_unescaped(image_path($_['appid'], 'favicon-touch.png')); ?>">
+ <link rel="apple-touch-icon-precomposed" href="<?php print_unescaped(image_path($_['appid'], 'favicon-touch.png')); ?>">
+ <link rel="mask-icon" sizes="any" href="<?php print_unescaped(image_path($_['appid'], 'favicon-mask.svg')); ?>" color="<?php p($theme->getColorPrimary()); ?>">
+ <link rel="manifest" href="<?php print_unescaped(image_path($_['appid'], 'manifest.json')); ?>" crossorigin="use-credentials">
+ <?php emit_css_loading_tags($_); ?>
+ <?php emit_script_loading_tags($_); ?>
+ <?php print_unescaped($_['headers']); ?>
+</head>
+<body id="<?php p($_['bodyid']);?>" <?php foreach ($_['enabledThemes'] as $themeId) {
+ p("data-theme-$themeId ");
+}?> data-themes="<?php p(join(',', $_['enabledThemes'])) ?>">
+ <?php include('layout.noscript.warning.php'); ?>
+ <?php include('layout.initial-state.php'); ?>
+ <div id="skip-actions">
+ <?php if ($_['id-app-content'] !== null) { ?><a href="<?php p($_['id-app-content']); ?>" class="button primary skip-navigation skip-content"><?php p($l->t('Skip to main content')); ?></a><?php } ?>
+ <?php if ($_['id-app-navigation'] !== null) { ?><a href="<?php p($_['id-app-navigation']); ?>" class="button primary skip-navigation"><?php p($l->t('Skip to navigation of app')); ?></a><?php } ?>
+ </div>
+
+ <header id="header">
+ <div class="header-start">
+ <div id="nextcloud" class="header-appname">
+ <?php if ($_['logoUrl']): ?>
+ <a href="<?php print_unescaped($_['logoUrl']); ?>"
+ aria-label="<?php p($l->t('Go to %s', [$_['logoUrl']])); ?>">
+ <div class="logo logo-icon"></div>
+ </a>
+ <?php else: ?>
+ <div class="logo logo-icon"></div>
+ <?php endif; ?>
+
+ <div class="header-info">
+ <span class="header-title">
+ <?php if (isset($template) && $template->getHeaderTitle() !== '') { ?>
+ <?php p($template->getHeaderTitle()); ?>
+ <?php } else { ?>
+ <?php p($theme->getName()); ?>
+ <?php } ?>
+ </span>
+ <?php if (isset($template) && $template->getHeaderDetails() !== '') { ?>
+ <span class="header-shared-by">
+ <?php p($template->getHeaderDetails()); ?>
+ </span>
+ <?php } ?>
+ </div>
+ </div>
+ </div>
+
+ <div class="header-end">
+ <div id="public-page-menu"></div>
+ <div id="public-page-user-menu"></div>
+ </div>
+ </header>
+
+ <div id="content" class="app-<?php p($_['appid']) ?>">
+ <h1 class="hidden-visually">
+ <?php
+ if (isset($template) && $template->getHeaderTitle() !== '') {
+ p($template->getHeaderTitle());
+ } else {
+ p($theme->getName());
+ } ?>
+ </h1>
+ <?php print_unescaped($_['content']); ?>
+ </div>
+
+ <?php if (isset($template) && $template->getFooterVisible() && ($theme->getLongFooter() !== '' || $_['showSimpleSignUpLink'])) { ?>
+ <footer>
+ <p><?php print_unescaped($theme->getLongFooter()); ?></p>
+ <?php
+if ($_['showSimpleSignUpLink']) {
+ ?>
+ <p class="footer__simple-sign-up">
+ <a href="<?php p($_['signUpLink']); ?>" target="_blank" rel="noreferrer noopener">
+ <?php p($l->t('Get your own free account')); ?>
+ </a>
+ </p>
+ <?php
+}
+ ?>
+ </footer>
+ <?php } ?>
+
+</body>
+</html>
diff --git a/core/templates/layout.user.php b/core/templates/layout.user.php
index 601af6077f4..47cced308bc 100644
--- a/core/templates/layout.user.php
+++ b/core/templates/layout.user.php
@@ -1,152 +1,95 @@
-<!DOCTYPE html>
-<!--[if lte IE 8]><html class="ng-csp ie ie8 lte9 lte8" data-placeholder-focus="false" lang="<?php p($_['language']); ?>" ><![endif]-->
-<!--[if IE 9]><html class="ng-csp ie ie9 lte9" data-placeholder-focus="false" lang="<?php p($_['language']); ?>" ><![endif]-->
-<!--[if (gt IE 9)|!(IE)]><!--><html class="ng-csp" data-placeholder-focus="false" lang="<?php p($_['language']); ?>" ><!--<![endif]-->
+<?php
+/**
+ * SPDX-FileCopyrightText: 2016-2024 Nextcloud GmbH and Nextcloud contributors
+ * SPDX-FileCopyrightText: 2011-2016 ownCloud, Inc.
+ * SPDX-License-Identifier: AGPL-3.0-only
+ */
+
+/**
+ * @var \OC_Defaults $theme
+ * @var array $_
+ */
+
+$getUserAvatar = static function (int $size) use ($_): string {
+ return \OCP\Server::get(\OCP\IURLGenerator::class)->linkToRoute('core.avatar.getAvatar', [
+ 'userId' => $_['user_uid'],
+ 'size' => $size,
+ 'v' => $_['userAvatarVersion']
+ ]);
+}
+
+?><!DOCTYPE html>
+<html class="ng-csp" data-placeholder-focus="false" lang="<?php p($_['language']); ?>" data-locale="<?php p($_['locale']); ?>" translate="no" >
<head data-user="<?php p($_['user_uid']); ?>" data-user-displayname="<?php p($_['user_displayname']); ?>" data-requesttoken="<?php p($_['requesttoken']); ?>">
<meta charset="utf-8">
<title>
<?php
- p(!empty($_['application'])?$_['application'].' - ':'');
- p($theme->getTitle());
- ?>
+ p(!empty($_['pageTitle']) && (empty($_['application']) || $_['pageTitle'] !== $_['application']) ? $_['pageTitle'] . ' - ' : '');
+p(!empty($_['application']) ? $_['application'] . ' - ' : '');
+p($theme->getTitle());
+?>
</title>
- <meta http-equiv="X-UA-Compatible" content="IE=edge">
- <meta name="referrer" content="never">
- <meta name="viewport" content="width=device-width, initial-scale=1.0, minimum-scale=1.0, maximum-scale=1.0">
+ <meta name="csp-nonce" nonce="<?php p($_['cspNonce']); /* Do not pass into "content" to prevent exfiltration */ ?>">
+ <meta name="viewport" content="width=device-width, initial-scale=1.0, minimum-scale=1.0<?php if (isset($_['viewport_maximum_scale'])) {
+ p(', maximum-scale=' . $_['viewport_maximum_scale']);
+ } ?>">
+
+ <?php if ($theme->getiTunesAppId() !== '') { ?>
<meta name="apple-itunes-app" content="app-id=<?php p($theme->getiTunesAppId()); ?>">
+ <?php } ?>
<meta name="apple-mobile-web-app-capable" content="yes">
<meta name="apple-mobile-web-app-status-bar-style" content="black">
- <meta name="apple-mobile-web-app-title" content="<?php p((!empty($_['application']) && $_['appid']!='files')? $_['application']:'ownCloud'); ?>">
+ <meta name="apple-mobile-web-app-title" content="<?php p((!empty($_['application']) && $_['appid'] != 'files')? $_['application']:$theme->getTitle()); ?>">
<meta name="mobile-web-app-capable" content="yes">
- <meta name="theme-color" content="<?php p($theme->getMailHeaderColor()); ?>">
+ <meta name="theme-color" content="<?php p($theme->getColorPrimary()); ?>">
<link rel="icon" href="<?php print_unescaped(image_path($_['appid'], 'favicon.ico')); /* IE11+ supports png */ ?>">
+ <link rel="apple-touch-icon" href="<?php print_unescaped(image_path($_['appid'], 'favicon-touch.png')); ?>">
<link rel="apple-touch-icon-precomposed" href="<?php print_unescaped(image_path($_['appid'], 'favicon-touch.png')); ?>">
- <link rel="mask-icon" sizes="any" href="<?php print_unescaped(image_path($_['appid'], 'favicon-mask.svg')); ?>" color="#1d2d44">
- <?php foreach($_['cssfiles'] as $cssfile): ?>
- <link rel="stylesheet" href="<?php print_unescaped($cssfile); ?>">
- <?php endforeach; ?>
- <?php foreach($_['printcssfiles'] as $cssfile): ?>
- <link rel="stylesheet" href="<?php print_unescaped($cssfile); ?>" media="print">
- <?php endforeach; ?>
- <?php foreach($_['jsfiles'] as $jsfile): ?>
- <script src="<?php print_unescaped($jsfile); ?>"></script>
- <?php endforeach; ?>
+ <link rel="mask-icon" sizes="any" href="<?php print_unescaped(image_path($_['appid'], 'favicon-mask.svg')); ?>" color="<?php p($theme->getColorPrimary()); ?>">
+ <link rel="manifest" href="<?php print_unescaped(image_path($_['appid'], 'manifest.json')); ?>" crossorigin="use-credentials">
+ <?php emit_css_loading_tags($_); ?>
+ <?php emit_script_loading_tags($_); ?>
<?php print_unescaped($_['headers']); ?>
</head>
- <body id="<?php p($_['bodyid']);?>">
- <?php include('layout.noscript.warning.php'); ?>
- <div id="notification-container">
- <div id="notification"></div>
- </div>
- <header role="banner"><div id="header">
- <a href="<?php print_unescaped(link_to('', 'index.php')); ?>"
- id="owncloud" tabindex="1">
- <div class="logo-icon svg">
- <h1 class="hidden-visually">
- <?php p($theme->getName()); ?>
- </h1>
- </div>
- </a>
-
- <a href="#" class="header-appname-container menutoggle" tabindex="2">
- <h1 class="header-appname">
- <?php
- if(OC_Util::getEditionString() === '') {
- p(!empty($_['application'])?$_['application']: $l->t('Apps'));
- } else {
- print_unescaped($theme->getHTMLName());
- }
- ?>
- </h1>
- <div class="icon-caret svg"></div>
- </a>
+ <body dir="<?php p($_['direction']); ?>" id="<?php p($_['bodyid']);?>" <?php foreach ($_['enabledThemes'] as $themeId) {
+ p("data-theme-$themeId ");
+ }?> data-themes=<?php p(join(',', $_['enabledThemes'])) ?>>
+ <?php include 'layout.noscript.warning.php'; ?>
+ <?php include 'layout.initial-state.php'; ?>
- <div id="logo-claim" style="display:none;"><?php p($theme->getLogoClaim()); ?></div>
- <div id="settings" class="svg">
- <div id="expand" tabindex="6" role="link" class="menutoggle">
- <?php if ($_['enableAvatars']): ?>
- <div class="avatardiv<?php if ($_['userAvatarSet']) { print_unescaped(' avatardiv-shown'); } else { print_unescaped('" style="display: none'); } ?>">
- <?php if ($_['userAvatarSet']): ?>
- <img alt="" width="32" height="32"
- src="<?php p(\OC::$server->getURLGenerator()->linkToRoute('core.avatar.getAvatar', ['userId' => $_['user_uid'], 'size' => 32]));?>"
- srcset="<?php p(\OC::$server->getURLGenerator()->linkToRoute('core.avatar.getAvatar', ['userId' => $_['user_uid'], 'size' => 64]));?> 2x, <?php p(\OC::$server->getURLGenerator()->linkToRoute('core.avatar.getAvatar', ['userId' => $_['user_uid'], 'size' => 128]));?> 4x"
- >
- <?php endif; ?>
- </div>
- <?php endif; ?>
- <span id="expandDisplayName"><?php p(trim($_['user_displayname']) != '' ? $_['user_displayname'] : $_['user_uid']) ?></span>
- <img class="svg" alt="" src="<?php print_unescaped(image_path('', 'actions/caret.svg')); ?>">
- </div>
- <div id="expanddiv">
- <ul>
- <?php foreach($_['settingsnavigation'] as $entry):?>
- <li>
- <a href="<?php print_unescaped($entry['href']); ?>"
- <?php if( $entry["active"] ): ?> class="active"<?php endif; ?>>
- <img class="svg" alt="" src="<?php print_unescaped($entry['icon']); ?>">
- <?php p($entry['name']) ?>
- </a>
- </li>
- <?php endforeach; ?>
- <li>
- <a id="logout" <?php print_unescaped(OC_User::getLogoutAttribute()); ?>>
- <img class="svg" alt="" src="<?php print_unescaped(image_path('', 'actions/logout.svg')); ?>">
- <?php p($l->t('Log out'));?>
- </a>
- </li>
- </ul>
- </div>
- </div>
-
- <form class="searchbox" action="#" method="post" role="search" novalidate>
- <label for="searchbox" class="hidden-visually">
- <?php p($l->t('Search'));?>
- </label>
- <input id="searchbox" class="svg" type="search" name="query"
- value="" required
- autocomplete="off" tabindex="5">
- </form>
- </div></header>
+ <div id="skip-actions">
+ <?php if ($_['id-app-content'] !== null) { ?><a href="<?php p($_['id-app-content']); ?>" class="button primary skip-navigation skip-content"><?php p($l->t('Skip to main content')); ?></a><?php } ?>
+ <?php if ($_['id-app-navigation'] !== null) { ?><a href="<?php p($_['id-app-navigation']); ?>" class="button primary skip-navigation"><?php p($l->t('Skip to navigation of app')); ?></a><?php } ?>
+ </div>
- <nav role="navigation"><div id="navigation">
- <div id="apps" class="svg">
- <ul>
- <?php foreach($_['navigation'] as $entry): ?>
- <li data-id="<?php p($entry['id']); ?>">
- <a href="<?php print_unescaped($entry['href']); ?>" tabindex="3"
- <?php if( $entry['active'] ): ?> class="active"<?php endif; ?>>
- <img class="app-icon svg" alt="" src="<?php print_unescaped($entry['icon']); ?>">
- <div class="icon-loading-dark" style="display:none;"></div>
- <span>
- <?php p($entry['name']); ?>
- </span>
- </a>
- </li>
- <?php endforeach; ?>
- <?php
- /* show "More apps" link to app administration directly in app navigation, as last entry */
- if(OC_User::isAdminUser(OC_User::getUser())):
- ?>
- <li id="apps-management">
- <a href="<?php print_unescaped(\OC::$server->getURLGenerator()->linkToRoute('settings.AppSettings.viewApps')); ?>" tabindex="4"
- <?php if( $_['appsmanagement_active'] ): ?> class="active"<?php endif; ?>>
- <img class="app-icon svg" alt="" src="<?php print_unescaped(image_path('settings', 'apps.svg')); ?>">
- <div class="icon-loading-dark" style="display:none;"></div>
- <span>
- <?php p($l->t('Apps')); ?>
- </span>
- </a>
- </li>
- <?php endif; ?>
+ <header id="header">
+ <div class="header-start">
+ <a href="<?php print_unescaped($_['logoUrl'] ?: link_to('', 'index.php')); ?>"
+ aria-label="<?php p($l->t('Go to %s', [$_['logoUrl'] ?: $_['defaultAppName']])); ?>"
+ id="nextcloud">
+ <div class="logo logo-icon"></div>
+ </a>
- </ul>
+ <nav id="header-start__appmenu"></nav>
</div>
- </div></nav>
- <div id="content-wrapper">
- <div id="content" class="app-<?php p($_['appid']) ?>" role="main">
- <?php print_unescaped($_['content']); ?>
+ <div class="header-end">
+ <div id="unified-search"></div>
+ <div id="notifications"></div>
+ <div id="contactsmenu"></div>
+ <div id="user-menu"></div>
</div>
+ </header>
+
+ <div id="content" class="app-<?php p($_['appid']) ?>">
+ <h1 class="hidden-visually" id="page-heading-level-1">
+ <?php p((!empty($_['application']) && !empty($_['pageTitle']) && $_['application'] != $_['pageTitle'])
+ ? $_['application'] . ': ' . $_['pageTitle']
+ : (!empty($_['pageTitle']) ? $_['pageTitle'] : $theme->getName())
+ ); ?>
+ </h1>
+ <?php print_unescaped($_['content']); ?>
</div>
+ <div id="profiler-toolbar"></div>
</body>
</html>
diff --git a/core/templates/legacy/fileexists.html b/core/templates/legacy/fileexists.html
new file mode 100644
index 00000000000..de213803e0e
--- /dev/null
+++ b/core/templates/legacy/fileexists.html
@@ -0,0 +1,35 @@
+<!--
+ - SPDX-FileCopyrightText: 2019 Nextcloud GmbH and Nextcloud contributors
+ - SPDX-License-Identifier: AGPL-3.0-only
+ -->
+<div id="{dialog_name}" title="{title}" class="fileexists">
+ <span class="why">{why}<!-- Which files do you want to keep --></span><br/>
+ <span class="what">{what}<!-- If you select both versions, the copied file will have a number added to its name. --></span><br/>
+ <br/>
+ <table>
+ <th><input id="checkbox-allnewfiles" class="allnewfiles checkbox" type="checkbox" /><label for="checkbox-allnewfiles">{allnewfiles}<span class="count"></span></label></th>
+ <th><input id="checkbox-allexistingfiles" class="allexistingfiles checkbox" type="checkbox" /><label for="checkbox-allexistingfiles">{allexistingfiles}<span class="count"></span></label></th>
+ </table>
+ <div class="conflicts">
+ <div class="template">
+ <div class="filename"></div>
+ <div class="replacement">
+ <input type="checkbox" class="checkbox u-left"/>
+ <label>
+ <span class="svg icon"></span>
+ <div class="mtime"></div>
+ <div class="size"></div>
+ </label>
+ </div>
+ <div class="original">
+ <input type="checkbox" class="checkbox u-left" />
+ <label>
+ <span class="svg icon"></span>
+ <div class="mtime"></div>
+ <div class="size"></div>
+ <div class="message"></div>
+ </label>
+ </div>
+ </div>
+ </div>
+</div>
diff --git a/core/templates/login.php b/core/templates/login.php
index a12008295c4..251e4cd288e 100644
--- a/core/templates/login.php
+++ b/core/templates/login.php
@@ -1,94 +1,14 @@
-<?php /** @var $l OC_L10N */ ?>
<?php
-vendor_script('jsTimezoneDetect/jstz');
-script('core', [
- 'visitortimezone',
- 'lostpassword',
- 'login'
-]);
-?>
-
-<!--[if IE 8]><style>input[type="checkbox"]{padding:0;}</style><![endif]-->
-<form method="post" name="login">
- <fieldset>
- <?php if (!empty($_['redirect_url'])) {
- print_unescaped('<input type="hidden" name="redirect_url" value="' . \OCP\Util::sanitizeHTML($_['redirect_url']) . '">');
- } ?>
- <?php if (isset($_['apacheauthfailed']) && ($_['apacheauthfailed'])): ?>
- <div class="warning">
- <?php p($l->t('Server side authentication failed!')); ?><br>
- <small><?php p($l->t('Please contact your administrator.')); ?></small>
- </div>
- <?php endif; ?>
- <?php foreach($_['messages'] as $message): ?>
- <div class="warning">
- <?php p($message); ?><br>
- </div>
- <?php endforeach; ?>
- <?php if (isset($_['internalexception']) && ($_['internalexception'])): ?>
- <div class="warning">
- <?php p($l->t('An internal error occured.')); ?><br>
- <small><?php p($l->t('Please try again or contact your administrator.')); ?></small>
- </div>
- <?php endif; ?>
- <div id="message" class="hidden">
- <img class="float-spinner" alt=""
- src="<?php p(\OCP\Util::imagePath('core', 'loading-dark.gif'));?>">
- <span id="messageText"></span>
- <!-- the following div ensures that the spinner is always inside the #message div -->
- <div style="clear: both;"></div>
- </div>
- <p class="grouptop">
- <input type="text" name="user" id="user"
- placeholder="<?php p($l->t('Username')); ?>"
- value="<?php p($_['username']); ?>"
- <?php p($_['user_autofocus'] ? 'autofocus' : ''); ?>
- autocomplete="on" autocapitalize="off" autocorrect="off" required>
- <label for="user" class="infield"><?php p($l->t('Username')); ?></label>
- </p>
- <p class="groupbottom">
- <input type="password" name="password" id="password" value=""
- placeholder="<?php p($l->t('Password')); ?>"
- <?php p($_['user_autofocus'] ? '' : 'autofocus'); ?>
- autocomplete="on" autocapitalize="off" autocorrect="off" required>
- <label for="password" class="infield"><?php p($l->t('Password')); ?></label>
- <input type="submit" id="submit" class="login primary icon-confirm svg" title="<?php p($l->t('Log in')); ?>" value="" disabled="disabled"/>
- </p>
-
- <?php if (!empty($_['invalidpassword']) && !empty($_['canResetPassword'])) { ?>
- <a id="lost-password" class="warning" href="">
- <?php p($l->t('Wrong password. Reset it?')); ?>
- </a>
- <?php } else if (!empty($_['invalidpassword'])) { ?>
- <p class="warning">
- <?php p($l->t('Wrong password.')); ?>
- </p>
- <?php } ?>
- <?php if ($_['rememberLoginAllowed'] === true) : ?>
- <div class="remember-login-container">
- <?php if ($_['rememberLoginState'] === 0) { ?>
- <input type="checkbox" name="remember_login" value="1" id="remember_login" class="checkbox checkbox--white">
- <?php } else { ?>
- <input type="checkbox" name="remember_login" value="1" id="remember_login" class="checkbox checkbox--white" checked="checked">
- <?php } ?>
- <label for="remember_login"><?php p($l->t('Stay logged in')); ?></label>
- </div>
- <?php endif; ?>
- <input type="hidden" name="timezone-offset" id="timezone-offset"/>
- <input type="hidden" name="timezone" id="timezone"/>
- <input type="hidden" name="requesttoken" value="<?php p($_['requesttoken']) ?>">
- </fieldset>
-</form>
-<?php if (!empty($_['alt_login'])) { ?>
-<form id="alternative-logins">
- <fieldset>
- <legend><?php p($l->t('Alternative Logins')) ?></legend>
- <ul>
- <?php foreach($_['alt_login'] as $login): ?>
- <li><a class="button" href="<?php print_unescaped($login['href']); ?>" ><?php p($login['name']); ?></a></li>
- <?php endforeach; ?>
- </ul>
- </fieldset>
-</form>
-<?php }
+/**
+ * SPDX-FileCopyrightText: 2016-2024 Nextcloud GmbH and Nextcloud contributors
+ * SPDX-FileCopyrightText: 2011-2016 ownCloud, Inc.
+ * SPDX-License-Identifier: AGPL-3.0-only
+ *
+ * @var \OCP\IL10N $l
+ */
+\OCP\Util::addScript('core', 'login', 'core');
+?>
+<div>
+ <div id="login"></div>
+</div>
diff --git a/core/templates/loginflow/authpicker.php b/core/templates/loginflow/authpicker.php
new file mode 100644
index 00000000000..265cb04a20f
--- /dev/null
+++ b/core/templates/loginflow/authpicker.php
@@ -0,0 +1,59 @@
+<?php
+/**
+ * SPDX-FileCopyrightText: 2017 Nextcloud GmbH and Nextcloud contributors
+ * SPDX-License-Identifier: AGPL-3.0-or-later
+ */
+
+\OCP\Util::addScript('core', 'login/authpicker', 'core');
+style('core', 'login/authpicker');
+
+/** @var array $_ */
+/** @var \OCP\IURLGenerator $urlGenerator */
+$urlGenerator = $_['urlGenerator'];
+?>
+
+<div class="picker-window">
+ <h2><?php p($l->t('Connect to your account')) ?></h2>
+ <p class="info">
+ <?php print_unescaped($l->t('Please log in before granting %1$s access to your %2$s account.', [
+ '<strong>' . \OCP\Util::sanitizeHTML($_['client']) . '</strong>',
+ \OCP\Util::sanitizeHTML($_['instanceName'])
+ ])) ?>
+ </p>
+
+ <div class="notecard warning">
+ <h3><?php p($l->t('Security warning')) ?></h3>
+ <p>
+ <?php p($l->t('If you are not trying to set up a new device or app, someone is trying to trick you into granting them access to your data. In this case do not proceed and instead contact your system administrator.')) ?>
+ </p>
+ </div>
+
+ <br/>
+
+ <p id="redirect-link">
+ <form id="login-form" action="<?php p($urlGenerator->linkToRoute('core.ClientFlowLogin.grantPage', ['stateToken' => $_['stateToken'], 'clientIdentifier' => $_['clientIdentifier'], 'oauthState' => $_['oauthState'], 'user' => $_['user'], 'direct' => $_['direct'], 'providedRedirectUri' => $_['providedRedirectUri']])) ?>" method="get">
+ <input type="submit" class="login primary icon-confirm-white" value="<?php p($l->t('Log in')) ?>" disabled>
+ </form>
+ </p>
+
+ <form action="<?php p($urlGenerator->linkToRouteAbsolute('core.ClientFlowLogin.apptokenRedirect')); ?>" method="post" id="app-token-login-field" class="hidden">
+ <p class="grouptop">
+ <input type="text" name="user" id="user" placeholder="<?php p($l->t('Login')) ?>">
+ <label for="user" class="infield"><?php p($l->t('Login')) ?></label>
+ </p>
+ <p class="groupbottom">
+ <input type="password" name="password" id="password" placeholder="<?php p($l->t('App password')) ?>">
+ <label for="password" class="infield"><?php p($l->t('Password')) ?></label>
+ </p>
+ <input type="hidden" name="stateToken" value="<?php p($_['stateToken']) ?>" />
+ <input type="hidden" name="requesttoken" value="<?php p($_['requesttoken']) ?>">
+ <?php if ($_['direct'] !== 0) { ?>
+ <input type="hidden" name="direct" value="<?php p($_['direct']) ?>">
+ <?php } ?>
+ <input id="submit-app-token-login" type="submit" class="login primary icon-confirm-white" value="<?php p($l->t('Grant access')) ?>">
+ </form>
+
+ <?php if (empty($_['oauthState'])): ?>
+ <a id="app-token-login" class="apptoken-link" href="#"><?php p($l->t('Alternative log in using app password')) ?></a>
+ <?php endif; ?>
+</div>
diff --git a/core/templates/loginflow/grant.php b/core/templates/loginflow/grant.php
new file mode 100644
index 00000000000..8d092f8e005
--- /dev/null
+++ b/core/templates/loginflow/grant.php
@@ -0,0 +1,47 @@
+<?php
+/**
+ * SPDX-FileCopyrightText: 2017 Nextcloud GmbH and Nextcloud contributors
+ * SPDX-License-Identifier: AGPL-3.0-or-later
+ */
+
+\OCP\Util::addScript('core', 'login/grant', 'core');
+style('core', 'login/authpicker');
+
+/** @var array $_ */
+/** @var \OCP\IURLGenerator $urlGenerator */
+$urlGenerator = $_['urlGenerator'];
+?>
+
+<div class="picker-window small">
+ <h2><?php p($l->t('Account access')) ?></h2>
+ <p class="info">
+ <?php p($l->t('Currently logged in as %1$s (%2$s).', [
+ $_['userDisplayName'],
+ $_['userId'],
+ ])) ?>
+ </p>
+ <p class="info">
+ <?php print_unescaped($l->t('You are about to grant %1$s access to your %2$s account.', [
+ '<strong>' . \OCP\Util::sanitizeHTML($_['client']) . '</strong>',
+ \OCP\Util::sanitizeHTML($_['instanceName'])
+ ])) ?>
+ </p>
+
+ <br/>
+
+ <p id="redirect-link">
+ <form method="POST" action="<?php p($urlGenerator->linkToRouteAbsolute('core.ClientFlowLogin.generateAppPassword')) ?>">
+ <input type="hidden" name="clientIdentifier" value="<?php p($_['clientIdentifier']) ?>" />
+ <input type="hidden" name="requesttoken" value="<?php p($_['requesttoken']) ?>" />
+ <input type="hidden" name="stateToken" value="<?php p($_['stateToken']) ?>" />
+ <input type="hidden" name="oauthState" value="<?php p($_['oauthState']) ?>" />
+ <input type="hidden" name="providedRedirectUri" value="<?php p($_['providedRedirectUri']) ?>">
+ <?php if ($_['direct']) { ?>
+ <input type="hidden" name="direct" value="1" />
+ <?php } ?>
+ <div id="submit-wrapper">
+ <input type="submit" class="login primary icon-confirm-white" title="" value="<?php p($l->t('Grant access')); ?>" />
+ </div>
+ </form>
+ </p>
+</div>
diff --git a/core/templates/loginflowv2/authpicker.php b/core/templates/loginflowv2/authpicker.php
new file mode 100644
index 00000000000..c60aa81d3ea
--- /dev/null
+++ b/core/templates/loginflowv2/authpicker.php
@@ -0,0 +1,56 @@
+<?php
+/**
+ * SPDX-FileCopyrightText: 2017 Nextcloud GmbH and Nextcloud contributors
+ * SPDX-License-Identifier: AGPL-3.0-or-later
+ */
+
+style('core', 'login/authpicker');
+\OCP\Util::addScript('core', 'login/authpicker', 'core');
+
+/** @var array $_ */
+/** @var \OCP\IURLGenerator $urlGenerator */
+$urlGenerator = $_['urlGenerator'];
+?>
+
+<div class="picker-window">
+ <h2><?php p($l->t('Connect to your account')) ?></h2>
+ <p class="info">
+ <?php print_unescaped($l->t('Please log in before granting %1$s access to your %2$s account.', [
+ '<strong>' . \OCP\Util::sanitizeHTML($_['client']) . '</strong>',
+ \OCP\Util::sanitizeHTML($_['instanceName'])
+ ])) ?>
+ </p>
+
+ <div class="notecard warning">
+ <h3><?php p($l->t('Security warning')) ?></h3>
+ <p>
+ <?php p($l->t('If you are not trying to set up a new device or app, someone is trying to trick you into granting them access to your data. In this case do not proceed and instead contact your system administrator.')) ?>
+ </p>
+ </div>
+
+ <br/>
+
+ <p id="redirect-link">
+ <form id="login-form" action="<?php p($urlGenerator->linkToRouteAbsolute('core.ClientFlowLoginV2.grantPage', ['stateToken' => $_['stateToken'], 'user' => $_['user'], 'direct' => $_['direct'] ?? 0])) ?>" method="get">
+ <input type="submit" class="login primary icon-confirm-white" value="<?php p($l->t('Log in')) ?>" disabled>
+ </form>
+ </p>
+
+ <form action="<?php p($urlGenerator->linkToRouteAbsolute('core.ClientFlowLoginV2.apptokenRedirect')); ?>" method="post" id="app-token-login-field" class="hidden">
+ <p class="grouptop">
+ <input type="text" name="user" id="user" placeholder="<?php p($l->t('Login')) ?>">
+ <label for="user" class="infield"><?php p($l->t('Login')) ?></label>
+ </p>
+ <p class="groupbottom">
+ <input type="password" name="password" id="password" placeholder="<?php p($l->t('App password')) ?>">
+ <label for="password" class="infield"><?php p($l->t('Password')) ?></label>
+ </p>
+ <input type="hidden" name="stateToken" value="<?php p($_['stateToken']) ?>" />
+ <input type="hidden" name="requesttoken" value="<?php p($_['requesttoken']) ?>">
+ <input id="submit-app-token-login" type="submit" class="login primary icon-confirm-white" value="<?php p($l->t('Grant access')) ?>">
+ </form>
+
+ <?php if (empty($_['oauthState'])): ?>
+ <a id="app-token-login" class="apptoken-link" href="#"><?php p($l->t('Alternative log in using app password')) ?></a>
+ <?php endif; ?>
+</div>
diff --git a/core/templates/loginflowv2/done.php b/core/templates/loginflowv2/done.php
new file mode 100644
index 00000000000..b0369a0a637
--- /dev/null
+++ b/core/templates/loginflowv2/done.php
@@ -0,0 +1,21 @@
+<?php
+declare(strict_types=1);
+/**
+ * SPDX-FileCopyrightText: 2019 Nextcloud GmbH and Nextcloud contributors
+ * SPDX-License-Identifier: AGPL-3.0-or-later
+ */
+
+style('core', 'login/authpicker');
+
+/** @var array $_ */
+?>
+
+<div class="picker-window">
+ <h2><?php p($l->t('Account connected')) ?></h2>
+ <p class="info">
+ <?php p($l->t('Your client should now be connected!')) ?><br/>
+ <?php p($l->t('You can close this window.')) ?>
+ </p>
+
+ <br/>
+</div>
diff --git a/core/templates/loginflowv2/grant.php b/core/templates/loginflowv2/grant.php
new file mode 100644
index 00000000000..dea4ed27d6c
--- /dev/null
+++ b/core/templates/loginflowv2/grant.php
@@ -0,0 +1,44 @@
+<?php
+/**
+ * SPDX-FileCopyrightText: 2017 Nextcloud GmbH and Nextcloud contributors
+ * SPDX-License-Identifier: AGPL-3.0-or-later
+ */
+
+\OCP\Util::addScript('core', 'login/grant', 'core');
+style('core', 'login/authpicker');
+
+/** @var array $_ */
+/** @var \OCP\IURLGenerator $urlGenerator */
+$urlGenerator = $_['urlGenerator'];
+?>
+
+<div class="picker-window small">
+ <h2><?php p($l->t('Account access')) ?></h2>
+ <p class="info">
+ <?php p($l->t('Currently logged in as %1$s (%2$s).', [
+ $_['userDisplayName'],
+ $_['userId'],
+ ])) ?>
+ </p>
+ <p class="info">
+ <?php print_unescaped($l->t('You are about to grant %1$s access to your %2$s account.', [
+ '<strong>' . \OCP\Util::sanitizeHTML($_['client']) . '</strong>',
+ \OCP\Util::sanitizeHTML($_['instanceName'])
+ ])) ?>
+ </p>
+
+ <br/>
+
+ <p id="redirect-link">
+ <form method="POST" action="<?php p($urlGenerator->linkToRouteAbsolute('core.ClientFlowLoginV2.generateAppPassword')) ?>">
+ <input type="hidden" name="requesttoken" value="<?php p($_['requesttoken']) ?>" />
+ <input type="hidden" name="stateToken" value="<?php p($_['stateToken']) ?>" />
+ <?php if ($_['direct']) { ?>
+ <input type="hidden" name="direct" value="1" />
+ <?php } ?>
+ <div id="submit-wrapper">
+ <input type="submit" class="login primary icon-confirm-white" title="" value="<?php p($l->t('Grant access')); ?>" />
+ </div>
+ </form>
+ </p>
+</div>
diff --git a/core/templates/lostpassword/email.php b/core/templates/lostpassword/email.php
deleted file mode 100644
index 3ca424d5294..00000000000
--- a/core/templates/lostpassword/email.php
+++ /dev/null
@@ -1,21 +0,0 @@
-<?php
-/**
- * @author Christopher Schäpers <kondou@ts.unde.re>
- *
- * @copyright Copyright (c) 2016, ownCloud, Inc.
- * @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/>
- *
- */
-echo str_replace('{link}', $_['link'], $l->t('Use the following link to reset your password: {link}'));
diff --git a/core/templates/lostpassword/resetpassword.php b/core/templates/lostpassword/resetpassword.php
deleted file mode 100644
index 49ced424648..00000000000
--- a/core/templates/lostpassword/resetpassword.php
+++ /dev/null
@@ -1,40 +0,0 @@
-<?php
-/**
- * @author Jan-Christoph Borchardt <hey@jancborchardt.net>
- * @author Lukas Reschke <lukas@owncloud.com>
- * @author Michael Gapczynski <GapczynskiM@gmail.com>
- * @author Morris Jobke <hey@morrisjobke.de>
- * @author Victor Dubiniuk <dubiniuk@owncloud.com>
- *
- * @copyright Copyright (c) 2016, ownCloud, Inc.
- * @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/>
- *
- */
-style('core', 'lostpassword/resetpassword');
-script('core', 'lostpassword');
-?>
-
-<form action="<?php print_unescaped($_['link']) ?>" id="reset-password" method="post">
- <fieldset>
- <p>
- <label for="password" class="infield"><?php p($l->t('New password')); ?></label>
- <input type="password" name="password" id="password" value="" placeholder="<?php p($l->t('New Password')); ?>" required />
- </p>
- <input type="submit" id="submit" value="<?php p($l->t('Reset password')); ?>" />
- <p class="text-center">
- <img class="hidden" id="float-spinner" src="<?php p(\OCP\Util::imagePath('core', 'loading-dark.gif'));?>"/>
- </p>
- </fieldset>
-</form>
diff --git a/core/templates/mail.php b/core/templates/mail.php
deleted file mode 100644
index c2d84184d38..00000000000
--- a/core/templates/mail.php
+++ /dev/null
@@ -1,39 +0,0 @@
-<table cellspacing="0" cellpadding="0" border="0" width="100%">
-<tr><td>
-<table cellspacing="0" cellpadding="0" border="0" width="600px">
-<tr>
-<td bgcolor="<?php p($theme->getMailHeaderColor());?>" width="20px">&nbsp;</td>
-<td bgcolor="<?php p($theme->getMailHeaderColor());?>">
-<img src="<?php p(\OC::$server->getURLGenerator()->getAbsoluteURL(image_path('', 'logo-mail.gif'))); ?>" alt="<?php p($theme->getName()); ?>"/>
-</td>
-</tr>
-<tr><td colspan="2">&nbsp;</td></tr>
-<tr>
-<td width="20px">&nbsp;</td>
-<td style="font-weight:normal; font-size:0.8em; line-height:1.2em; font-family:verdana,'arial',sans;">
-<?php
-print_unescaped($l->t('Hey there,<br><br>just letting you know that %s shared <strong>%s</strong> with you.<br><a href="%s">View it!</a><br><br>', array($_['user_displayname'], $_['filename'], $_['link'])));
-if ( isset($_['expiration']) ) {
- p($l->t("The share will expire on %s.", array($_['expiration'])));
- print_unescaped('<br><br>');
-}
-// TRANSLATORS term at the end of a mail
-p($l->t('Cheers!'));
-?>
-</td>
-</tr>
-<tr><td colspan="2">&nbsp;</td></tr>
-<tr>
-<td width="20px">&nbsp;</td>
-<td style="font-weight:normal; font-size:0.8em; line-height:1.2em; font-family:verdana,'arial',sans;">--<br>
-<?php p($theme->getName()); ?> -
-<?php p($theme->getSlogan()); ?>
-<br><a href="<?php p($theme->getBaseUrl()); ?>"><?php p($theme->getBaseUrl());?></a>
-</td>
-</tr>
-<tr>
-<td colspan="2">&nbsp;</td>
-</tr>
-</table>
-</td></tr>
-</table>
diff --git a/core/templates/message.html b/core/templates/message.html
deleted file mode 100644
index a98fd31a7fe..00000000000
--- a/core/templates/message.html
+++ /dev/null
@@ -1,3 +0,0 @@
-<div id="{dialog_name}" title="{title} "><?php /* the ' ' after {title} fixes ie8, see http://stackoverflow.com/a/5313137/828717 */ ?>
- <p><span class="ui-icon ui-icon-{type}"></span>{message}</p>
-</div>
diff --git a/core/templates/print_exception.php b/core/templates/print_exception.php
new file mode 100644
index 00000000000..bb66d5abce3
--- /dev/null
+++ b/core/templates/print_exception.php
@@ -0,0 +1,23 @@
+<?php
+
+use OCP\IL10N;
+
+/**
+ * SPDX-FileCopyrightText: 2016-2024 Nextcloud GmbH and Nextcloud contributors
+ * SPDX-FileCopyrightText: 2012-2015 ownCloud, Inc.
+ * SPDX-License-Identifier: AGPL-3.0-only
+ */
+function print_exception(Throwable $e, IL10N $l): void {
+ print_unescaped('<pre>');
+ p($e->getTraceAsString());
+ print_unescaped('</pre>');
+
+ if ($e->getPrevious() !== null) {
+ print_unescaped('<br />');
+ print_unescaped('<h4>');
+ p($l->t('Previous'));
+ print_unescaped('</h4>');
+
+ print_exception($e->getPrevious(), $l);
+ }
+}
diff --git a/core/templates/print_xml_exception.php b/core/templates/print_xml_exception.php
new file mode 100644
index 00000000000..f103e13545f
--- /dev/null
+++ b/core/templates/print_xml_exception.php
@@ -0,0 +1,18 @@
+<?php
+
+use OCP\IL10N;
+
+/**
+ * SPDX-FileCopyrightText: 2016-2024 Nextcloud GmbH and Nextcloud contributors
+ * SPDX-FileCopyrightText: 2012-2015 ownCloud, Inc.
+ * SPDX-License-Identifier: AGPL-3.0-only
+ */
+function print_exception(Throwable $e, IL10N $l): void {
+ p($e->getTraceAsString());
+
+ if ($e->getPrevious() !== null) {
+ print_unescaped('<s:previous-exception>');
+ print_exception($e->getPrevious(), $l);
+ print_unescaped('</s:previous-exception>');
+ }
+}
diff --git a/core/templates/publicshareauth.php b/core/templates/publicshareauth.php
new file mode 100644
index 00000000000..f8e102076bb
--- /dev/null
+++ b/core/templates/publicshareauth.php
@@ -0,0 +1,87 @@
+<?php
+/**
+ * SPDX-FileCopyrightText: 2018 Nextcloud GmbH and Nextcloud contributors
+ * SPDX-License-Identifier: AGPL-3.0-or-later
+ */
+
+/** @var array $_ */
+/** @var \OCP\IL10N $l */
+\OCP\Util::addStyle('core', 'guest');
+\OCP\Util::addStyle('core', 'publicshareauth');
+\OCP\Util::addScript('core', 'publicshareauth');
+?>
+
+<div class="guest-box">
+ <!-- password prompt form. It should be hidden when we show the email prompt form -->
+ <?php if (!isset($_['identityOk'])): ?>
+ <form method="post" id="password-input-form">
+ <?php else: ?>
+ <form method="post" id="password-input-form" style="display:none;">
+ <?php endif; ?>
+ <fieldset class="warning">
+ <?php if (!isset($_['wrongpw'])): ?>
+ <div class="warning-info"><?php p($l->t('This share is password-protected')); ?></div>
+ <?php endif; ?>
+ <?php if (isset($_['wrongpw'])): ?>
+ <div class="warning wrongPasswordMsg"><?php p($l->t('The password is wrong or expired. Please try again or request a new one.')); ?></div>
+ <?php endif; ?>
+ <p>
+ <label for="password" class="infield"><?php p($l->t('Password')); ?></label>
+ <input type="hidden" id="requesttoken" name="requesttoken" value="<?php p($_['requesttoken']) ?>" />
+ <input type="password" name="password" id="password"
+ placeholder="<?php p($l->t('Password')); ?>" value=""
+ autocomplete="new-password" autocapitalize="off" spellcheck="false"
+ autofocus />
+ <input type="hidden" name="sharingToken" value="<?php p($_['share']->getToken()) ?>" id="sharingToken">
+ <input type="hidden" name="sharingType" value="<?php p($_['share']->getShareType()) ?>" id="sharingType">
+ <input type="submit" id="password-submit"
+ class="svg icon-confirm input-button-inline" value="" disabled="disabled" />
+ </p>
+ </fieldset>
+ </form>
+
+ <!-- email prompt form. It should initially be hidden -->
+ <?php if (isset($_['identityOk'])): ?>
+ <form method="post" id="email-input-form">
+ <?php else: ?>
+ <form method="post" id="email-input-form" style="display:none;">
+ <?php endif; ?>
+ <fieldset class="warning">
+ <div class="warning-info" id="email-prompt"><?php p($l->t('Please type in your email address to request a temporary password')); ?></div>
+ <p>
+ <input type="email" id="email" name="identityToken" placeholder="<?php p($l->t('Email address')); ?>" />
+ <input type="submit" id="password-request" name="passwordRequest" class="svg icon-confirm input-button-inline" value="" disabled="disabled"/>
+ <input type="hidden" id="requesttoken" name="requesttoken" value="<?php p($_['requesttoken']) ?>" />
+ <input type="hidden" name="sharingToken" value="<?php p($_['share']->getToken()) ?>" id="sharingToken">
+ <input type="hidden" name="sharingType" value="<?php p($_['share']->getShareType()) ?>" id="sharingType">
+ </p>
+ <?php if (isset($_['identityOk'])): ?>
+ <?php if ($_['identityOk']): ?>
+ <div class="warning-info" id="identification-success"><?php p($l->t('Password sent!')); ?></div>
+ <?php else: ?>
+ <div class="warning" id="identification-failure"><?php p($l->t('You are not authorized to request a password for this share')); ?></div>
+ <?php endif; ?>
+ <?php endif; ?>
+ </fieldset>
+ </form>
+
+ <!-- request password button -->
+ <?php if (!isset($_['identityOk']) && $_['share']->getShareType() === $_['share']::TYPE_EMAIL && !$_['share']->getSendPasswordByTalk()): ?>
+ <a id="request-password-button-not-talk"><?php p($l->t('Forgot password?')); ?></a>
+ <?php endif; ?>
+
+ <!-- back to showShare button -->
+ <form method="get">
+ <fieldset>
+ <a
+ href=""
+ id="request-password-back-button"
+ <?php if (isset($_['identityOk'])): ?>
+ style="display:block;">
+ <?php else: ?>
+ style="display:none;">
+ <?php endif; ?>
+ <?php p($l->t('Back')); ?></a>
+ </fieldset>
+ </form>
+</div>
diff --git a/core/templates/recommendedapps.php b/core/templates/recommendedapps.php
new file mode 100644
index 00000000000..dc92694f1b0
--- /dev/null
+++ b/core/templates/recommendedapps.php
@@ -0,0 +1,12 @@
+<?php declare(strict_types=1);
+
+/**
+ * SPDX-FileCopyrightText: 2019 Nextcloud GmbH and Nextcloud contributors
+ * SPDX-License-Identifier: AGPL-3.0-or-later
+ */
+
+\OCP\Util::addScript('core', 'recommendedapps', 'core');
+
+?>
+
+<div id="recommended-apps"></div>
diff --git a/core/templates/singleuser.user.php b/core/templates/singleuser.user.php
deleted file mode 100644
index bf076eb8d61..00000000000
--- a/core/templates/singleuser.user.php
+++ /dev/null
@@ -1,10 +0,0 @@
-<ul>
- <li class='update'>
- <?php p($l->t('This ownCloud instance is currently in single user mode.')) ?><br><br>
- <?php p($l->t('This means only administrators can use the instance.')) ?><br><br>
- <?php p($l->t('Contact your system administrator if this message persists or appeared unexpectedly.')) ?>
- <br><br>
- <?php p($l->t('Thank you for your patience.')); ?><br><br>
- <a class="button" <?php print_unescaped(OC_User::getLogoutAttribute()); ?>><?php p($l->t('Log out')); ?></a>
- </li>
-</ul>
diff --git a/core/templates/success.php b/core/templates/success.php
new file mode 100644
index 00000000000..700a1611a67
--- /dev/null
+++ b/core/templates/success.php
@@ -0,0 +1,17 @@
+<?php
+/**
+ * SPDX-FileCopyrightText: 2021 Nextcloud GmbH and Nextcloud contributors
+ * SPDX-License-Identifier: AGPL-3.0-or-later
+ */
+/** @var array $_ */
+/** @var \OCP\IL10N $l */
+/** @var \OCP\Defaults $theme */
+?>
+
+<div class="guest-box">
+ <h2><?php p($_['title']) ?></h2>
+ <p><?php p($_['message']) ?></p>
+ <p><a class="button primary" href="<?php p(\OCP\Server::get(\OCP\IURLGenerator::class)->linkTo('', 'index.php')) ?>">
+ <?php p($l->t('Go to %s', [$theme->getName()])); ?>
+ </a></p>
+</div>
diff --git a/core/templates/tags.html b/core/templates/tags.html
index a7125027a26..83c8b644b22 100644
--- a/core/templates/tags.html
+++ b/core/templates/tags.html
@@ -1,3 +1,7 @@
+<!--
+ - SPDX-FileCopyrightText: 2013-2015 ownCloud, Inc.
+ - SPDX-License-Identifier: AGPL-3.0-only
+ -->
<div id="tagsdialog">
<div class="content">
<div class="scrollarea">
diff --git a/core/templates/twofactorselectchallenge.php b/core/templates/twofactorselectchallenge.php
new file mode 100644
index 00000000000..e979cfd58ab
--- /dev/null
+++ b/core/templates/twofactorselectchallenge.php
@@ -0,0 +1,82 @@
+<?php
+/**
+ * SPDX-FileCopyrightText: 2016-2024 Nextcloud GmbH and Nextcloud contributors
+ * SPDX-FileCopyrightText: 2016 ownCloud, Inc.
+ * SPDX-License-Identifier: AGPL-3.0-only
+ */
+$noProviders = empty($_['providers']);
+?>
+<div class="body-login-container update two-factor">
+ <h2 class="two-factor-header"><?php p($l->t('Two-factor authentication')) ?></h2>
+ <?php if (!$noProviders): ?>
+ <p><?php p($l->t('Enhanced security is enabled for your account. Choose a second factor for authentication:')) ?></p>
+ <?php endif ?>
+ <?php if ($_['providerMissing']): ?>
+ <p>
+ <strong><?php p($l->t('Could not load at least one of your enabled two-factor auth methods. Please contact your admin.')) ?></strong>
+ </p>
+ <?php endif; ?>
+ <?php if ($noProviders): ?>
+ <img class="two-factor-icon" src="<?php p(image_path('core', 'actions/password-white.svg')) ?>" alt="" />
+ <p>
+ <?php if (is_null($_['backupProvider'])): ?>
+ <?php if (!$_['hasSetupProviders']) { ?>
+ <strong><?php p($l->t('Two-factor authentication is enforced but has not been configured on your account. Contact your admin for assistance.')) ?></strong>
+ <?php } else { ?>
+ <strong><?php p($l->t('Two-factor authentication is enforced but has not been configured on your account. Please continue to setup two-factor authentication.')) ?></strong>
+ <a class="button primary two-factor-primary" href="<?php p(\OCP\Server::get(\OCP\IURLGenerator::class)->linkToRoute('core.TwoFactorChallenge.setupProviders',
+ [
+ 'redirect_url' => $_['redirect_url'],
+ ]
+ )) ?>">
+ <?php p($l->t('Set up two-factor authentication')) ?>
+ </a>
+ <?php } ?>
+ <?php else: ?>
+ <strong><?php p($l->t('Two-factor authentication is enforced but has not been configured on your account. Use one of your backup codes to log in or contact your admin for assistance.')) ?></strong>
+ <?php endif; ?>
+ </p>
+ <?php else: ?>
+ <ul>
+ <?php foreach ($_['providers'] as $provider): ?>
+ <li>
+ <a class="two-factor-provider"
+ href="<?php p(\OCP\Server::get(\OCP\IURLGenerator::class)->linkToRoute('core.TwoFactorChallenge.showChallenge',
+ [
+ 'challengeProviderId' => $provider->getId(),
+ 'redirect_url' => $_['redirect_url'],
+ ]
+ )) ?>">
+ <?php
+ if ($provider instanceof \OCP\Authentication\TwoFactorAuth\IProvidesIcons) {
+ $icon = $provider->getLightIcon();
+ } else {
+ $icon = image_path('core', 'actions/password-white.svg');
+ }
+ ?>
+ <img src="<?php p($icon) ?>" alt="" />
+ <div>
+ <h3><?php p($provider->getDisplayName()) ?></h3>
+ <p><?php p($provider->getDescription()) ?></p>
+ </div>
+ </a>
+ </li>
+ <?php endforeach; ?>
+ </ul>
+ <?php endif ?>
+ <?php if (!is_null($_['backupProvider'])): ?>
+ <p>
+ <a class="<?php if ($noProviders): ?>button primary two-factor-primary<?php else: ?>two-factor-secondary<?php endif ?>" href="<?php p(\OCP\Server::get(\OCP\IURLGenerator::class)->linkToRoute('core.TwoFactorChallenge.showChallenge',
+ [
+ 'challengeProviderId' => $_['backupProvider']->getId(),
+ 'redirect_url' => $_['redirect_url'],
+ ]
+ )) ?>">
+ <?php p($l->t('Use backup code')) ?>
+ </a>
+ </p>
+ <?php endif; ?>
+ <p><a id="cancel-login" class="two-factor-secondary" href="<?php print_unescaped($_['logout_url']); ?>">
+ <?php p($l->t('Cancel login')) ?>
+ </a></p>
+</div>
diff --git a/core/templates/twofactorsetupchallenge.php b/core/templates/twofactorsetupchallenge.php
new file mode 100644
index 00000000000..c575ca21343
--- /dev/null
+++ b/core/templates/twofactorsetupchallenge.php
@@ -0,0 +1,20 @@
+<?php
+/**
+ * SPDX-FileCopyrightText: 2019 Nextcloud GmbH and Nextcloud contributors
+ * SPDX-License-Identifier: AGPL-3.0-or-later
+ */
+/** @var \OCP\IL10N $l */
+/** @var array $_ */
+/** @var \OCP\Authentication\TwoFactorAuth\IProvider $provider */
+$provider = $_['provider'];
+/* @var string $template */
+$template = $_['template'];
+?>
+
+<div class="body-login-container update">
+ <h2 class="two-factor-header"><?php p($provider->getDisplayName()); ?></h2>
+ <?php print_unescaped($template); ?>
+ <p><a id="cancel-login" class="two-factor-secondary" href="<?php print_unescaped($_['logout_url']); ?>">
+ <?php p($l->t('Cancel login')) ?>
+ </a></p>
+</div>
diff --git a/core/templates/twofactorsetupselection.php b/core/templates/twofactorsetupselection.php
new file mode 100644
index 00000000000..77139ab0e2a
--- /dev/null
+++ b/core/templates/twofactorsetupselection.php
@@ -0,0 +1,41 @@
+<?php
+declare(strict_types=1);
+/**
+ * SPDX-FileCopyrightText: 2019 Nextcloud GmbH and Nextcloud contributors
+ * SPDX-License-Identifier: AGPL-3.0-or-later
+ */
+
+?>
+<div class="body-login-container update">
+ <h2 class="two-factor-header"><?php p($l->t('Set up two-factor authentication')) ?></h2>
+ <?php p($l->t('Enhanced security is enforced for your account. Choose which provider to set up:')) ?>
+ <ul>
+ <?php foreach ($_['providers'] as $provider): ?>
+ <li>
+ <a class="two-factor-provider"
+ href="<?php p(\OCP\Server::get(\OCP\IURLGenerator::class)->linkToRoute('core.TwoFactorChallenge.setupProvider',
+ [
+ 'providerId' => $provider->getId(),
+ 'redirect_url' => $_['redirect_url'],
+ ]
+ )) ?>">
+ <?php
+ if ($provider instanceof \OCP\Authentication\TwoFactorAuth\IProvidesIcons) {
+ $icon = $provider->getLightIcon();
+ } else {
+ $icon = image_path('core', 'actions/password-white.svg');
+ }
+ ?>
+ <img src="<?php p($icon) ?>" alt="" />
+ <div>
+ <h3><?php p($provider->getDisplayName()) ?></h3>
+ <p><?php p($provider->getDescription()) ?></p>
+ </div>
+ </a>
+ </li>
+ <?php endforeach; ?>
+ </ul>
+ <p><a id="cancel-login" class="two-factor-secondary" href="<?php print_unescaped($_['logout_url']); ?>">
+ <?php p($l->t('Cancel login')) ?>
+ </a></p>
+</div>
diff --git a/core/templates/twofactorshowchallenge.php b/core/templates/twofactorshowchallenge.php
new file mode 100644
index 00000000000..6bc367d4025
--- /dev/null
+++ b/core/templates/twofactorshowchallenge.php
@@ -0,0 +1,44 @@
+<?php
+/**
+ * SPDX-FileCopyrightText: 2016-2024 Nextcloud GmbH and Nextcloud contributors
+ * SPDX-FileCopyrightText: 2016 ownCloud, Inc.
+ * SPDX-License-Identifier: AGPL-3.0-or-later
+ */
+/** @var \OCP\IL10N $l */
+/** @var array $_ */
+/** @var boolean $error */
+$error = $_['error'];
+/* @var $error_message string */
+$error_message = $_['error_message'];
+/* @var $provider OCP\Authentication\TwoFactorAuth\IProvider */
+$provider = $_['provider'];
+/* @var $template string */
+$template = $_['template'];
+?>
+
+<div class="body-login-container update two-factor">
+ <h2 class="two-factor-header"><?php p($provider->getDisplayName()); ?></h2>
+ <?php if ($error): ?>
+ <?php if ($error_message): ?>
+ <p><strong><?php p($error_message); ?></strong></p>
+ <?php else: ?>
+ <p><strong><?php p($l->t('Error while validating your second factor')); ?></strong></p>
+ <?php endif; ?>
+ <?php endif; ?>
+ <?php print_unescaped($template); ?>
+ <?php if (!is_null($_['backupProvider'])): ?>
+ <p>
+ <a class="two-factor-secondary" href="<?php p(\OCP\Server::get(\OCP\IURLGenerator::class)->linkToRoute('core.TwoFactorChallenge.showChallenge',
+ [
+ 'challengeProviderId' => $_['backupProvider']->getId(),
+ 'redirect_url' => $_['redirect_url'],
+ ]
+ )) ?>">
+ <?php p($l->t('Use backup code')) ?>
+ </a>
+ </p>
+ <?php endif; ?>
+ <p><a id="cancel-login" class="two-factor-secondary" href="<?php print_unescaped($_['logout_url']); ?>">
+ <?php p($l->t('Cancel login')) ?>
+ </a></p>
+</div>
diff --git a/core/templates/unsupportedbrowser.php b/core/templates/unsupportedbrowser.php
new file mode 100644
index 00000000000..519f0bc9f5c
--- /dev/null
+++ b/core/templates/unsupportedbrowser.php
@@ -0,0 +1,7 @@
+<?php
+/**
+ * SPDX-FileCopyrightText: 2021 Nextcloud GmbH and Nextcloud contributors
+ * SPDX-License-Identifier: AGPL-3.0-or-later
+ */
+?>
+<div id="unsupported-browser"></div>
diff --git a/core/templates/untrustedDomain.php b/core/templates/untrustedDomain.php
index 46bad216822..874fd7aa8d5 100644
--- a/core/templates/untrustedDomain.php
+++ b/core/templates/untrustedDomain.php
@@ -1,19 +1,20 @@
-<?php /** @var $_ array */ ?>
+<?php
+/**
+ * SPDX-FileCopyrightText: 2016-2024 Nextcloud GmbH and Nextcloud contributors
+ * SPDX-FileCopyrightText: 2014-2015 ownCloud, Inc.
+ * SPDX-License-Identifier: AGPL-3.0-only
+ */
+/** @var array $_ */
+?>
-<ul class="error-wide">
- <li class='error'>
- <?php p($l->t('You are accessing the server from an untrusted domain.')); ?><br>
+<div class="guest-box">
+ <h2><?php p($l->t('Access through untrusted domain')); ?></h2>
- <p class='hint'>
- <?php p($l->t('Please contact your administrator. If you are an administrator of this instance, configure the "trusted_domains" setting in config/config.php. An example configuration is provided in config/config.sample.php.')); ?>
- <br>
- <?php p($l->t('Depending on your configuration, as an administrator you might also be able to use the button below to trust this domain.')); ?>
- <br><br>
- <p style="text-align:center;">
- <a href="<?php print_unescaped(\OC::$server->getURLGenerator()->getAbsoluteURL(\OCP\Util::linkToRoute('settings_admin'))); ?>?trustDomain=<?php p($_['domain']); ?>" class="button">
- <?php p($l->t('Add "%s" as trusted domain', array($_['domain']))); ?>
- </a>
- </p>
- </p>
- </li>
-</ul>
+ <p>
+ <?php p($l->t('Please contact your administrator. If you are an administrator, edit the "trusted_domains" setting in config/config.php like the example in config.sample.php.')); ?>
+ </p>
+ <br />
+ <p>
+ <?php print_unescaped($l->t('Further information how to configure this can be found in the %1$sdocumentation%2$s.', ['<a href="' . $_['docUrl'] . '" target="blank">', '</a>'])); ?>
+ </p>
+</div>
diff --git a/core/templates/update.admin.php b/core/templates/update.admin.php
index 75815de84bc..504071451a9 100644
--- a/core/templates/update.admin.php
+++ b/core/templates/update.admin.php
@@ -1,14 +1,21 @@
-<div class="update" data-productname="<?php p($_['productName']) ?>" data-version="<?php p($_['version']) ?>">
+<?php
+/**
+ * SPDX-FileCopyrightText: 2016-2024 Nextcloud GmbH and Nextcloud contributors
+ * SPDX-FileCopyrightText: 2013-2015 ownCloud, Inc.
+ * SPDX-License-Identifier: AGPL-3.0-only
+ */
+?>
+<div class="guest-box update" data-productname="<?php p($_['productName']) ?>" data-version="<?php p($_['version']) ?>">
<div class="updateOverview">
<?php if ($_['isAppsOnlyUpgrade']) { ?>
<h2 class="title"><?php p($l->t('App update required')); ?></h2>
<?php } else { ?>
- <h2 class="title"><?php p($l->t('%s will be updated to version %s',
- array($_['productName'], $_['version']))); ?></h2>
+ <h2 class="title"><?php p($l->t('%1$s will be updated to version %2$s',
+ [$_['productName'], $_['version']])); ?></h2>
<?php } ?>
<?php if (!empty($_['appsToUpgrade'])) { ?>
- <div class="infogroup">
- <span><?php p($l->t('These apps will be updated:')); ?></span>
+ <div class="text-left">
+ <span><?php p($l->t('The following apps will be updated:')); ?></span>
<ul class="content appList">
<?php foreach ($_['appsToUpgrade'] as $appInfo) { ?>
<li><?php p($appInfo['name']) ?> (<?php p($appInfo['id']) ?>)</li>
@@ -17,7 +24,7 @@
</div>
<?php } ?>
<?php if (!empty($_['incompatibleAppsList'])) { ?>
- <div class="infogroup">
+ <div class="text-left">
<span><?php p($l->t('These incompatible apps will be disabled:')) ?></span>
<ul class="content appList">
<?php foreach ($_['incompatibleAppsList'] as $appInfo) { ?>
@@ -28,18 +35,26 @@
<?php } ?>
<?php if (!empty($_['oldTheme'])) { ?>
<div class="infogroup">
- <?php p($l->t('The theme %s has been disabled.', array($_['oldTheme']))) ?>
+ <?php p($l->t('The theme %s has been disabled.', [$_['oldTheme']])) ?>
</div>
<?php } ?>
- <div class="infogroup bold">
+ <div class="text-left margin-top bold">
<?php p($l->t('Please make sure that the database, the config folder and the data folder have been backed up before proceeding.')) ?>
</div>
- <input class="updateButton" type="button" value="<?php p($l->t('Start update')) ?>">
- <div class="infogroup">
+ <input class="updateButton primary margin-top" type="button" value="<?php p($l->t('Start update')) ?>">
+ <div class="notecard warning">
<?php p($l->t('To avoid timeouts with larger installations, you can instead run the following command from your installation directory:')) ?>
<pre>./occ upgrade</pre>
</div>
</div>
- <div class="updateProgress hidden"></div>
+ <div class="update-progress hidden">
+ <h2 id="update-progress-title"></h2>
+ <div id="update-progress-icon" class="icon-loading-dark"></div>
+ <p id="update-progress-message-error" class="hidden"></p>
+ <ul id="update-progress-message-warnings" class="hidden"></ul>
+ <p id="update-progress-message"></p>
+ <a class="update-show-detailed"><?php p($l->t('Detailed logs')); ?> <span class="icon-caret-white"></span></a>
+ <div id="update-progress-detailed" class="hidden"></div>
+ </div>
</div>
diff --git a/core/templates/update.use-cli.php b/core/templates/update.use-cli.php
new file mode 100644
index 00000000000..a13dd2f51f1
--- /dev/null
+++ b/core/templates/update.use-cli.php
@@ -0,0 +1,32 @@
+<?php
+/**
+ * SPDX-FileCopyrightText: 2017-2024 Nextcloud GmbH and Nextcloud contributors
+ * SPDX-FileCopyrightText: 2016 ownCloud, Inc.
+ * SPDX-License-Identifier: AGPL-3.0-only
+ */
+?>
+<div class="guest-box update" data-productname="<?php p($_['productName']) ?>" data-version="<?php p($_['version']) ?>">
+ <div class="updateOverview">
+ <h2 class="title"><?php p($l->t('Update needed')) ?></h2>
+ <div class="text-left">
+ <?php if ($_['tooBig']) {
+ p($l->t('Please use the command line updater because you have a big instance with more than 50 accounts.'));
+ } else {
+ p($l->t('Please use the command line updater because updating via browser is disabled in your config.php.'));
+ } ?><br><br>
+ <?php if (is_string($_['cliUpgradeLink']) && $_['cliUpgradeLink'] !== '') {
+ $cliUpgradeLink = $_['cliUpgradeLink'];
+ } else {
+ $cliUpgradeLink = link_to_docs('admin-cli-upgrade');
+ }
+print_unescaped($l->t('For help, see the <a target="_blank" rel="noreferrer noopener" href="%s">documentation</a>.', [$cliUpgradeLink])); ?>
+ </div>
+ </div>
+
+ <?php if ($_['tooBig']) { ?>
+ <div class="notecard warning">
+ <p><?php p($l->t('I know that if I continue doing the update via web UI has the risk, that the request runs into a timeout and could cause data loss, but I have a backup and know how to restore my instance in case of a failure.')); ?></p>
+ <a class="button error margin-top" href="?IKnowThatThisIsABigInstanceAndTheUpdateRequestCouldRunIntoATimeoutAndHowToRestoreABackup=IAmSuperSureToDoThis"><?php p($l->t('Upgrade via web on my own risk')); ?></a>
+ </div>
+ <?php } ?>
+</div>
diff --git a/core/templates/update.user.php b/core/templates/update.user.php
index bc6936188ea..0b702c0d246 100644
--- a/core/templates/update.user.php
+++ b/core/templates/update.user.php
@@ -1,8 +1,13 @@
-<ul>
- <li class='update'>
- <?php p($l->t('This %s instance is currently in maintenance mode, which may take a while.', array($theme->getName()))) ?><br><br>
- <?php p($l->t('This page will refresh itself when the %s instance is available again.', array($theme->getName()))) ?><br><br>
- <?php p($l->t('Contact your system administrator if this message persists or appeared unexpectedly.')) ?><br><br>
- <?php p($l->t('Thank you for your patience.')); ?><br><br>
- </li>
-</ul>
+<?php
+/**
+ * SPDX-FileCopyrightText: 2018-2024 Nextcloud GmbH and Nextcloud contributors
+ * SPDX-FileCopyrightText: 2013-2015 ownCloud, Inc.
+ * SPDX-License-Identifier: AGPL-3.0-only
+ */
+?>
+<div class="guest-box">
+ <div class="icon-big icon-error"></div>
+ <h2><?php p($l->t('Maintenance mode', [$theme->getName()])) ?></h2>
+ <p><?php p($l->t('This %s instance is currently in maintenance mode, which may take a while.', [$theme->getName()])) ?> <?php p($l->t('This page will refresh itself when the instance is available again.')) ?></p>
+ <p><?php p($l->t('Contact your system administrator if this message persists or appeared unexpectedly.')) ?></p>
+</div>
diff --git a/core/templates/xml_exception.php b/core/templates/xml_exception.php
new file mode 100644
index 00000000000..ba808c88595
--- /dev/null
+++ b/core/templates/xml_exception.php
@@ -0,0 +1,39 @@
+<?php
+/**
+ * SPDX-FileCopyrightText: 2016-2024 Nextcloud GmbH and Nextcloud contributors
+ * SPDX-FileCopyrightText: 2012-2015 ownCloud, Inc.
+ * SPDX-License-Identifier: AGPL-3.0-only
+ */
+
+require_once __DIR__ . '/print_xml_exception.php';
+
+print_unescaped('<?xml version="1.0" encoding="utf-8"?>' . "\n");
+?>
+<d:error xmlns:d="DAV:" xmlns:s="http://sabredav.org/ns">
+ <s:exception><?php p($l->t('Internal Server Error')) ?></s:exception>
+ <s:message>
+ <?php p($l->t('The server was unable to complete your request.')) ?>
+ <?php p($l->t('If this happens again, please send the technical details below to the server administrator.')) ?>
+ <?php p($l->t('More details can be found in the server log.')) ?>
+ <?php if (isset($_['serverLogsDocumentation']) && $_['serverLogsDocumentation'] !== ''): ?>
+ <?php p($l->t('For more details see the documentation ↗.'))?>: <?php print_unescaped($_['serverLogsDocumentation']) ?>
+ <?php endif; ?>
+ </s:message>
+
+ <s:technical-details>
+ <s:remote-address><?php p($_['remoteAddr']) ?></s:remote-address>
+ <s:request-id><?php p($_['requestID']) ?></s:request-id>
+
+ <?php if (isset($_['debugMode']) && $_['debugMode'] === true): ?>
+ <s:type><?php p($_['errorClass']) ?></s:type>
+ <s:code><?php p($_['errorCode']) ?></s:code>
+ <s:message><?php p($_['errorMsg']) ?></s:message>
+ <s:file><?php p($_['file']) ?></s:file>
+ <s:line><?php p($_['line']) ?></s:line>
+
+ <s:stacktrace>
+ <?php print_exception($_['exception'], $l); ?>
+ </s:stacktrace>
+ <?php endif; ?>
+ </s:technical-details>
+</d:error>