aboutsummaryrefslogtreecommitdiffstats
path: root/core/templates
diff options
context:
space:
mode:
Diffstat (limited to 'core/templates')
-rw-r--r--core/templates/403.php20
-rw-r--r--core/templates/404-profile.php30
-rw-r--r--core/templates/404.php4
-rw-r--r--core/templates/confirmation.php7
-rw-r--r--core/templates/error.php2
-rw-r--r--core/templates/exception.php15
-rw-r--r--core/templates/filetemplates/template.odpbin13090 -> 0 bytes
-rw-r--r--core/templates/filetemplates/template.odsbin7134 -> 0 bytes
-rw-r--r--core/templates/filetemplates/template.odtbin7938 -> 0 bytes
-rw-r--r--core/templates/installation.php165
-rw-r--r--core/templates/layout.base.php9
-rw-r--r--core/templates/layout.guest.php19
-rw-r--r--core/templates/layout.initial-state.php11
-rw-r--r--core/templates/layout.public.php74
-rw-r--r--core/templates/layout.user.php32
-rw-r--r--core/templates/legacy/fileexists.html35
-rw-r--r--core/templates/login.php2
-rw-r--r--core/templates/loginflow/authpicker.php4
-rw-r--r--core/templates/loginflow/grant.php3
-rw-r--r--core/templates/loginflowv2/authpicker.php4
-rw-r--r--core/templates/loginflowv2/grant.php5
-rw-r--r--core/templates/print_exception.php23
-rw-r--r--core/templates/print_xml_exception.php18
-rw-r--r--core/templates/profile.php7
-rw-r--r--core/templates/recommendedapps.php2
-rw-r--r--core/templates/success.php4
-rw-r--r--core/templates/twofactorselectchallenge.php8
-rw-r--r--core/templates/twofactorsetupchallenge.php2
-rw-r--r--core/templates/twofactorsetupselection.php4
-rw-r--r--core/templates/twofactorshowchallenge.php6
-rw-r--r--core/templates/xml_exception.php39
31 files changed, 230 insertions, 324 deletions
diff --git a/core/templates/403.php b/core/templates/403.php
index 091db720b16..dc34c8d854f 100644
--- a/core/templates/403.php
+++ b/core/templates/403.php
@@ -8,15 +8,23 @@
if (!isset($_)) {//standalone page is not supported anymore - redirect to /
require_once '../../lib/base.php';
- $urlGenerator = \OC::$server->getURLGenerator();
+ $urlGenerator = \OCP\Server::get(\OCP\IURLGenerator::class);
header('Location: ' . $urlGenerator->getAbsoluteURL('/'));
exit;
}
// @codeCoverageIgnoreEnd
?>
-<div class="guest-box">
+<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'])) {
- p($_['message']);
- }?></p>
-</ul>
+ <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-profile.php b/core/templates/404-profile.php
deleted file mode 100644
index 3f2d8731347..00000000000
--- a/core/templates/404-profile.php
+++ /dev/null
@@ -1,30 +0,0 @@
-<?php
-/**
- * SPDX-FileCopyrightText: 2021-2024 Nextcloud GmbH and Nextcloud contributors
- * SPDX-License-Identifier: AGPL-3.0-or-later
- */
-/** @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';
-
- $urlGenerator = \OC::$server->getURLGenerator();
- header('Location: ' . $urlGenerator->getAbsoluteURL('/'));
- exit;
-}
-// @codeCoverageIgnoreEnd
-?>
-<?php if (isset($_['content'])) : ?>
- <?php print_unescaped($_['content']) ?>
-<?php else : ?>
- <div class="body-login-container update">
- <div class="icon-big icon-error"></div>
- <h2><?php p($l->t('Profile not found')); ?></h2>
- <p class="infogroup"><?php p($l->t('The profile does not exist.')); ?></p>
- <p><a class="button primary" href="<?php p(\OC::$server->getURLGenerator()->linkTo('', 'index.php')) ?>">
- <?php p($l->t('Back to %s', [$theme->getName()])); ?>
- </a></p>
- </div>
-<?php endif; ?>
diff --git a/core/templates/404.php b/core/templates/404.php
index d2dc10f9aa8..3dcce4d26d3 100644
--- a/core/templates/404.php
+++ b/core/templates/404.php
@@ -11,7 +11,7 @@
if (!isset($_)) {//standalone page is not supported anymore - redirect to /
require_once '../../lib/base.php';
- $urlGenerator = \OC::$server->getURLGenerator();
+ $urlGenerator = \OCP\Server::get(\OCP\IURLGenerator::class);
header('Location: ' . $urlGenerator->getAbsoluteURL('/'));
exit;
}
@@ -24,7 +24,7 @@ if (!isset($_)) {//standalone page is not supported anymore - redirect to /
<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(\OC::$server->getURLGenerator()->linkTo('', 'index.php')) ?>">
+ <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/confirmation.php b/core/templates/confirmation.php
index cc062d1ef4c..0a73699fd68 100644
--- a/core/templates/confirmation.php
+++ b/core/templates/confirmation.php
@@ -7,16 +7,13 @@
/** @var \OCP\IL10N $l */
/** @var \OCP\Defaults $theme */
?>
-<div class="update">
- <form method="POST" action="<?php print_unescaped($_['targetUrl']);?>">
+<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>
- <?php foreach ($_['parameters'] as $name => $value) {?>
- <input type="hidden" name="<?php p($name); ?>" value="<?php p($value); ?>">
- <?php } ?>
<input type="hidden" name="requesttoken" value="<?php p($_['requesttoken']) ?>">
</form>
</div>
diff --git a/core/templates/error.php b/core/templates/error.php
index 82acb08f9ed..ac9bd34d558 100644
--- a/core/templates/error.php
+++ b/core/templates/error.php
@@ -8,7 +8,7 @@
<div class="guest-box">
<h2><?php p($l->t('Error')) ?></h2>
<ul>
- <?php foreach ($_["errors"] as $error):?>
+ <?php foreach ($_['errors'] as $error):?>
<li>
<p><?php p($error['error']) ?></p>
<?php if (isset($error['hint']) && $error['hint']): ?>
diff --git a/core/templates/exception.php b/core/templates/exception.php
index 5c907038ba2..44f9908c57c 100644
--- a/core/templates/exception.php
+++ b/core/templates/exception.php
@@ -9,20 +9,7 @@
style('core', ['styles', 'header', 'exception']);
-function print_exception(Throwable $e, \OCP\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);
- }
-}
+require_once __DIR__ . '/print_exception.php';
?>
<div class="guest-box wide">
diff --git a/core/templates/filetemplates/template.odp b/core/templates/filetemplates/template.odp
deleted file mode 100644
index 3800a491fa6..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 998ea21bd73..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 4717040fd89..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 5343464edbc..b002ee400cc 100644
--- a/core/templates/installation.php
+++ b/core/templates/installation.php
@@ -4,168 +4,5 @@
* SPDX-FileCopyrightText: 2011-2016 ownCloud, Inc.
* SPDX-License-Identifier: AGPL-3.0-only
*/
-script('core', 'install');
?>
-<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 method="post" class="guest-box install-form">
-<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 p($err['error']); ?>
- <span class='hint'><?php p($err['hint']); ?></span>
- <?php else: ?>
- <?php p($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 noopener">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>
- <label for="adminlogin"><?php p($l->t('Login')); ?></label>
- <input type="text" name="adminlogin" id="adminlogin"
- value="<?php p($_['adminlogin']); ?>"
- autocomplete="off" autocapitalize="none" spellcheck="false" autofocus required>
- </p>
- <p class="groupbottom">
- <label for="adminpass"><?php p($l->t('Password')); ?></label>
- <input type="password" name="adminpass" data-typetoggle="#show" id="adminpass"
- value="<?php p($_['adminpass']); ?>"
- autocomplete="off" autocapitalize="none" spellcheck="false" required>
- <button id="show" class="toggle-password" aria-label="<?php p($l->t('Show password')); ?>">
- <img src="<?php print_unescaped(image_path('', 'actions/toggle.svg')); ?>" alt="<?php p($l->t('Toggle password visibility')); ?>">
- </button>
- </p>
- </fieldset>
-
- <?php if (!$_['directoryIsSet'] or !$_['dbIsSet'] or count($_['errors']) > 0): ?>
- <fieldset id="advancedHeader">
- <legend><a id="showAdvanced" tabindex="0" href="#"><?php p($l->t('Storage & database')); ?><img src="<?php print_unescaped(image_path('core', '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="none" spellcheck="false">
- </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.', [$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 noopener">
- <?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"><?php p($l->t('Database account')); ?></label>
- <input type="text" name="dbuser" id="dbuser"
- value="<?php p($_['dbuser']); ?>"
- autocomplete="off" autocapitalize="none" spellcheck="false">
- </p>
- <p class="groupmiddle">
- <label for="dbpass"><?php p($l->t('Database password')); ?></label>
- <input type="password" name="dbpass" id="dbpass"
- value="<?php p($_['dbpass']); ?>"
- autocomplete="off" autocapitalize="none" spellcheck="false">
- <button id="show" class="toggle-password" aria-label="<?php p($l->t('Show password')); ?>">
- <img src="<?php print_unescaped(image_path('', 'actions/toggle.svg')); ?>" alt="<?php p($l->t('Toggle password visibility')); ?>">
- </button>
- </p>
- <p class="groupmiddle">
- <label for="dbname"><?php p($l->t('Database name')); ?></label>
- <input type="text" name="dbname" id="dbname"
- value="<?php p($_['dbname']); ?>"
- autocomplete="off" autocapitalize="none" spellcheck="false"
- 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"
- value="<?php p($_['dbtablespace']); ?>"
- autocomplete="off" autocapitalize="none" spellcheck="false">
- </p>
- </div>
- <?php endif; ?>
- <p class="groupbottom">
- <label for="dbhost"><?php p($l->t('Database host')); ?></label>
- <input type="text" name="dbhost" id="dbhost"
- value="<?php p($_['dbhost']); ?>"
- autocomplete="off" autocapitalize="none" spellcheck="false">
- </p>
- <p class="info">
- <?php p($l->t('Please specify the port number along with the host name (e.g., localhost:5432).')); ?>
- </p>
- </div>
- </fieldset>
- <?php endif; ?>
- <?php endif; ?>
-
- <?php if (!$_['dbIsSet'] or count($_['errors']) > 0): ?>
- <div id="sqliteInformation" class="notecard warning">
- <legend><?php p($l->t('Performance warning'));?></legend>
- <p><?php p($l->t('You chose SQLite as database.'));?></p>
- <p><?php p($l->t('SQLite should only be used for minimal and development instances. For production we recommend a different database backend.'));?></p>
- <p><?php p($l->t('If you use clients for file syncing, the use of SQLite is highly discouraged.')); ?></p>
- </div>
- <?php endif ?>
-
- <div class="icon-loading-dark float-spinner">&nbsp;</div>
-
- <div class="buttons"><input type="submit" class="primary" value="<?php p($l->t('Install')); ?>" data-finishing="<?php p($l->t('Installing …')); ?>"></div>
-
- <p class="info">
- <span class="icon-info-white"></span>
- <?php p($l->t('Need help?'));?>
- <a target="_blank" rel="noreferrer noopener" 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/layout.base.php b/core/templates/layout.base.php
index 9615e9c3cec..44731172760 100644
--- a/core/templates/layout.base.php
+++ b/core/templates/layout.base.php
@@ -12,8 +12,11 @@
<title>
<?php p($theme->getTitle()); ?>
</title>
- <meta name="viewport" content="width=device-width, initial-scale=1.0, minimum-scale=1.0">
+ <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()); ?>">
@@ -23,9 +26,7 @@
</head>
<body id="body-public" class="layout-base">
<?php include 'layout.noscript.warning.php'; ?>
- <?php foreach ($_['initialStates'] as $app => $initialState) { ?>
- <input type="hidden" id="initial-state-<?php p($app); ?>" value="<?php p(base64_encode($initialState)); ?>">
- <?php }?>
+ <?php include 'layout.initial-state.php'; ?>
<div id="content" class="app-public" role="main">
<?php print_unescaped($_['content']); ?>
</div>
diff --git a/core/templates/layout.guest.php b/core/templates/layout.guest.php
index 3fd11dcc2b9..1b5b90c29fc 100644
--- a/core/templates/layout.guest.php
+++ b/core/templates/layout.guest.php
@@ -19,7 +19,10 @@
p($theme->getTitle());
?>
</title>
- <meta name="viewport" content="width=device-width, initial-scale=1.0, minimum-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 } ?>
@@ -32,26 +35,26 @@ p($theme->getTitle());
<?php emit_script_loading_tags($_); ?>
<?php print_unescaped($_['headers']); ?>
</head>
- <body id="<?php p($_['bodyid']);?>">
+ <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 foreach ($_['initialStates'] as $app => $initialState) { ?>
- <input type="hidden" id="initial-state-<?php p($app); ?>" value="<?php p(base64_encode($initialState)); ?>">
- <?php }?>
+ <?php include 'layout.initial-state.php'; ?>
<div class="wrapper">
<div class="v-align">
<?php if ($_['bodyid'] === 'body-login'): ?>
<header>
- <div id="header">
+ <div id="header" class="header-guest">
<div class="logo"></div>
</div>
</header>
<?php endif; ?>
- <main>
+ <div>
<h1 class="hidden-visually">
<?php p($theme->getName()); ?>
</h1>
<?php print_unescaped($_['content']); ?>
- </main>
+ </div>
</div>
</div>
<?php
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.public.php b/core/templates/layout.public.php
index 3ce34ece9f5..60460d60c83 100644
--- a/core/templates/layout.public.php
+++ b/core/templates/layout.public.php
@@ -9,12 +9,16 @@
<head data-requesttoken="<?php p($_['requesttoken']); ?>">
<meta charset="utf-8">
<title>
- <?php
- p(!empty($_['application']) ? $_['application'].' - ' : '');
+ <?php
+ p(!empty($_['pageTitle']) && (empty($_['application']) || $_['pageTitle'] !== $_['application']) ? $_['pageTitle'] . ' - ' : '');
+p(!empty($_['application']) ? $_['application'] . ' - ' : '');
p($theme->getTitle());
?>
</title>
- <meta name="viewport" content="width=device-width, initial-scale=1.0, minimum-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 } ?>
@@ -32,18 +36,18 @@ p($theme->getTitle());
<?php emit_script_loading_tags($_); ?>
<?php print_unescaped($_['headers']); ?>
</head>
-<body id="<?php p($_['bodyid']);?>">
-<?php include('layout.noscript.warning.php'); ?>
-<?php foreach ($_['initialStates'] as $app => $initialState) { ?>
- <input type="hidden" id="initial-state-<?php p($app); ?>" value="<?php p(base64_encode($initialState)); ?>">
-<?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 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-left">
+ <div class="header-start">
<div id="nextcloud" class="header-appname">
<?php if ($_['logoUrl']): ?>
<a href="<?php print_unescaped($_['logoUrl']); ?>"
@@ -71,55 +75,31 @@ p($theme->getTitle());
</div>
</div>
- <div class="header-right">
- <?php
-/** @var \OCP\AppFramework\Http\Template\PublicTemplateResponse $template */
-if (isset($template) && $template->getActionCount() !== 0) {
- $primary = $template->getPrimaryAction();
- $others = $template->getOtherActions(); ?>
- <span id="header-primary-action" class="<?php if ($template->getActionCount() === 1) {
- p($primary->getIcon());
- } ?>">
- <a href="<?php p($primary->getLink()); ?>" class="primary button">
- <span><?php p($primary->getLabel()) ?></span>
- </a>
- </span>
- <?php if ($template->getActionCount() > 1) { ?>
- <div id="header-secondary-action">
- <button id="header-actions-toggle" class="menutoggle icon-more-white"></button>
- <div id="header-actions-menu" class="popovermenu menu">
- <ul>
- <?php
- /** @var \OCP\AppFramework\Http\Template\IMenuAction $action */
- foreach ($others as $action) {
- print_unescaped($action->render());
- }
- ?>
- </ul>
- </div>
- </div>
- <?php } ?>
- <?php
-} ?>
+ <div class="header-end">
+ <div id="public-page-menu"></div>
+ <div id="public-page-user-menu"></div>
</div>
</header>
- <main id="content" class="app-<?php p($_['appid']) ?>">
+
+ <div id="content" class="app-<?php p($_['appid']) ?>">
<h1 class="hidden-visually">
- <?php if (isset($template) && $template->getHeaderTitle() !== '') { ?>
- <?php p($template->getHeaderTitle()); ?>
- <?php } else { ?>
- <?php p($theme->getName()); ?>
- <?php } ?>
+ <?php
+ if (isset($template) && $template->getHeaderTitle() !== '') {
+ p($template->getHeaderTitle());
+ } else {
+ p($theme->getName());
+ } ?>
</h1>
<?php print_unescaped($_['content']); ?>
- </main>
+ </div>
+
<?php if (isset($template) && $template->getFooterVisible() && ($theme->getLongFooter() !== '' || $_['showSimpleSignUpLink'])) { ?>
<footer>
<p><?php print_unescaped($theme->getLongFooter()); ?></p>
<?php
if ($_['showSimpleSignUpLink']) {
?>
- <p>
+ <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>
diff --git a/core/templates/layout.user.php b/core/templates/layout.user.php
index f590918301b..47cced308bc 100644
--- a/core/templates/layout.user.php
+++ b/core/templates/layout.user.php
@@ -11,7 +11,7 @@
*/
$getUserAvatar = static function (int $size) use ($_): string {
- return \OC::$server->getURLGenerator()->linkToRoute('core.avatar.getAvatar', [
+ return \OCP\Server::get(\OCP\IURLGenerator::class)->linkToRoute('core.avatar.getAvatar', [
'userId' => $_['user_uid'],
'size' => $size,
'v' => $_['userAvatarVersion']
@@ -24,12 +24,15 @@ $getUserAvatar = static function (int $size) use ($_): string {
<meta charset="utf-8">
<title>
<?php
- p(!empty($_['pageTitle']) && $_['pageTitle'] !== $_['application'] ? $_['pageTitle'].' - ' : '');
-p(!empty($_['application']) ? $_['application'].' - ' : '');
+ p(!empty($_['pageTitle']) && (empty($_['application']) || $_['pageTitle'] !== $_['application']) ? $_['pageTitle'] . ' - ' : '');
+p(!empty($_['application']) ? $_['application'] . ' - ' : '');
p($theme->getTitle());
?>
</title>
- <meta name="viewport" content="width=device-width, initial-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()); ?>">
@@ -48,14 +51,11 @@ p($theme->getTitle());
<?php emit_script_loading_tags($_); ?>
<?php print_unescaped($_['headers']); ?>
</head>
- <body id="<?php p($_['bodyid']);?>" <?php foreach ($_['enabledThemes'] as $themeId) {
+ <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 foreach ($_['initialStates'] as $app => $initialState) { ?>
- <input type="hidden" id="initial-state-<?php p($app); ?>" value="<?php p(base64_encode($initialState)); ?>">
- <?php }?>
+ <?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 } ?>
@@ -63,17 +63,17 @@ p($theme->getTitle());
</div>
<header id="header">
- <div class="header-left">
+ <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>
- <nav id="header-left__appmenu"></nav>
+ <nav id="header-start__appmenu"></nav>
</div>
- <div class="header-right">
+ <div class="header-end">
<div id="unified-search"></div>
<div id="notifications"></div>
<div id="contactsmenu"></div>
@@ -81,15 +81,15 @@ p($theme->getTitle());
</div>
</header>
- <main id="content" class="app-<?php p($_['appid']) ?>">
+ <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']
+ ? $_['application'] . ': ' . $_['pageTitle']
: (!empty($_['pageTitle']) ? $_['pageTitle'] : $theme->getName())
); ?>
</h1>
<?php print_unescaped($_['content']); ?>
- </main>
+ </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 949916872de..251e4cd288e 100644
--- a/core/templates/login.php
+++ b/core/templates/login.php
@@ -7,7 +7,7 @@
*
* @var \OCP\IL10N $l
*/
-script('core', 'login');
+\OCP\Util::addScript('core', 'login', 'core');
?>
<div>
<div id="login"></div>
diff --git a/core/templates/loginflow/authpicker.php b/core/templates/loginflow/authpicker.php
index 94aace60cba..265cb04a20f 100644
--- a/core/templates/loginflow/authpicker.php
+++ b/core/templates/loginflow/authpicker.php
@@ -4,7 +4,7 @@
* SPDX-License-Identifier: AGPL-3.0-or-later
*/
-script('core', 'login/authpicker');
+\OCP\Util::addScript('core', 'login/authpicker', 'core');
style('core', 'login/authpicker');
/** @var array $_ */
@@ -31,7 +31,7 @@ $urlGenerator = $_['urlGenerator'];
<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']])) ?>" method="get">
+ <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>
diff --git a/core/templates/loginflow/grant.php b/core/templates/loginflow/grant.php
index dd2fb8d1a8e..8d092f8e005 100644
--- a/core/templates/loginflow/grant.php
+++ b/core/templates/loginflow/grant.php
@@ -4,7 +4,7 @@
* SPDX-License-Identifier: AGPL-3.0-or-later
*/
-script('core', 'login/grant');
+\OCP\Util::addScript('core', 'login/grant', 'core');
style('core', 'login/authpicker');
/** @var array $_ */
@@ -35,6 +35,7 @@ $urlGenerator = $_['urlGenerator'];
<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 } ?>
diff --git a/core/templates/loginflowv2/authpicker.php b/core/templates/loginflowv2/authpicker.php
index 14f5a6fe3d0..c60aa81d3ea 100644
--- a/core/templates/loginflowv2/authpicker.php
+++ b/core/templates/loginflowv2/authpicker.php
@@ -5,7 +5,7 @@
*/
style('core', 'login/authpicker');
-script('core', 'login/authpicker');
+\OCP\Util::addScript('core', 'login/authpicker', 'core');
/** @var array $_ */
/** @var \OCP\IURLGenerator $urlGenerator */
@@ -31,7 +31,7 @@ $urlGenerator = $_['urlGenerator'];
<br/>
<p id="redirect-link">
- <form id="login-form" action="<?php p($urlGenerator->linkToRouteAbsolute('core.ClientFlowLoginV2.grantPage', ['stateToken' => $_['stateToken'], 'user' => $_['user']])) ?>" method="get">
+ <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>
diff --git a/core/templates/loginflowv2/grant.php b/core/templates/loginflowv2/grant.php
index 69599810ce9..dea4ed27d6c 100644
--- a/core/templates/loginflowv2/grant.php
+++ b/core/templates/loginflowv2/grant.php
@@ -4,7 +4,7 @@
* SPDX-License-Identifier: AGPL-3.0-or-later
*/
-script('core', 'login/grant');
+\OCP\Util::addScript('core', 'login/grant', 'core');
style('core', 'login/authpicker');
/** @var array $_ */
@@ -33,6 +33,9 @@ $urlGenerator = $_['urlGenerator'];
<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>
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/profile.php b/core/templates/profile.php
deleted file mode 100644
index 460bfcc4221..00000000000
--- a/core/templates/profile.php
+++ /dev/null
@@ -1,7 +0,0 @@
-<?php
-/**
- * SPDX-FileCopyrightText: 2021 Nextcloud GmbH and Nextcloud contributors
- * SPDX-License-Identifier: AGPL-3.0-or-later
- */
-?>
-<div id="content"></div>
diff --git a/core/templates/recommendedapps.php b/core/templates/recommendedapps.php
index 3654acb317d..dc92694f1b0 100644
--- a/core/templates/recommendedapps.php
+++ b/core/templates/recommendedapps.php
@@ -5,7 +5,7 @@
* SPDX-License-Identifier: AGPL-3.0-or-later
*/
-script('core', 'recommendedapps');
+\OCP\Util::addScript('core', 'recommendedapps', 'core');
?>
diff --git a/core/templates/success.php b/core/templates/success.php
index 2493fe9a095..700a1611a67 100644
--- a/core/templates/success.php
+++ b/core/templates/success.php
@@ -8,10 +8,10 @@
/** @var \OCP\Defaults $theme */
?>
-<div class="update">
+<div class="guest-box">
<h2><?php p($_['title']) ?></h2>
<p><?php p($_['message']) ?></p>
- <p><a class="button primary" href="<?php p(\OC::$server->get(\OCP\IURLGenerator::class)->linkTo('', 'index.php')) ?>">
+ <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/twofactorselectchallenge.php b/core/templates/twofactorselectchallenge.php
index 582f45d70e8..e979cfd58ab 100644
--- a/core/templates/twofactorselectchallenge.php
+++ b/core/templates/twofactorselectchallenge.php
@@ -24,7 +24,7 @@ $noProviders = empty($_['providers']);
<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(\OC::$server->getURLGenerator()->linkToRoute('core.TwoFactorChallenge.setupProviders',
+ <a class="button primary two-factor-primary" href="<?php p(\OCP\Server::get(\OCP\IURLGenerator::class)->linkToRoute('core.TwoFactorChallenge.setupProviders',
[
'redirect_url' => $_['redirect_url'],
]
@@ -41,7 +41,7 @@ $noProviders = empty($_['providers']);
<?php foreach ($_['providers'] as $provider): ?>
<li>
<a class="two-factor-provider"
- href="<?php p(\OC::$server->getURLGenerator()->linkToRoute('core.TwoFactorChallenge.showChallenge',
+ href="<?php p(\OCP\Server::get(\OCP\IURLGenerator::class)->linkToRoute('core.TwoFactorChallenge.showChallenge',
[
'challengeProviderId' => $provider->getId(),
'redirect_url' => $_['redirect_url'],
@@ -66,7 +66,7 @@ $noProviders = empty($_['providers']);
<?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(\OC::$server->getURLGenerator()->linkToRoute('core.TwoFactorChallenge.showChallenge',
+ <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'],
@@ -76,7 +76,7 @@ $noProviders = empty($_['providers']);
</a>
</p>
<?php endif; ?>
- <p><a class="two-factor-secondary" href="<?php print_unescaped($_['logout_url']); ?>">
+ <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
index 09a143f1100..c575ca21343 100644
--- a/core/templates/twofactorsetupchallenge.php
+++ b/core/templates/twofactorsetupchallenge.php
@@ -14,7 +14,7 @@ $template = $_['template'];
<div class="body-login-container update">
<h2 class="two-factor-header"><?php p($provider->getDisplayName()); ?></h2>
<?php print_unescaped($template); ?>
- <p><a class="two-factor-secondary" href="<?php print_unescaped($_['logout_url']); ?>">
+ <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
index 9633e1faacb..77139ab0e2a 100644
--- a/core/templates/twofactorsetupselection.php
+++ b/core/templates/twofactorsetupselection.php
@@ -13,7 +13,7 @@ declare(strict_types=1);
<?php foreach ($_['providers'] as $provider): ?>
<li>
<a class="two-factor-provider"
- href="<?php p(\OC::$server->getURLGenerator()->linkToRoute('core.TwoFactorChallenge.setupProvider',
+ href="<?php p(\OCP\Server::get(\OCP\IURLGenerator::class)->linkToRoute('core.TwoFactorChallenge.setupProvider',
[
'providerId' => $provider->getId(),
'redirect_url' => $_['redirect_url'],
@@ -35,7 +35,7 @@ declare(strict_types=1);
</li>
<?php endforeach; ?>
</ul>
- <p><a class="two-factor-secondary" href="<?php print_unescaped($_['logout_url']); ?>">
+ <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
index 42cc14e5f22..6bc367d4025 100644
--- a/core/templates/twofactorshowchallenge.php
+++ b/core/templates/twofactorshowchallenge.php
@@ -5,7 +5,7 @@
* SPDX-License-Identifier: AGPL-3.0-or-later
*/
/** @var \OCP\IL10N $l */
-/** @var array $_*/
+/** @var array $_ */
/** @var boolean $error */
$error = $_['error'];
/* @var $error_message string */
@@ -28,7 +28,7 @@ $template = $_['template'];
<?php print_unescaped($template); ?>
<?php if (!is_null($_['backupProvider'])): ?>
<p>
- <a class="two-factor-secondary" href="<?php p(\OC::$server->getURLGenerator()->linkToRoute('core.TwoFactorChallenge.showChallenge',
+ <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'],
@@ -38,7 +38,7 @@ $template = $_['template'];
</a>
</p>
<?php endif; ?>
- <p><a class="two-factor-secondary" href="<?php print_unescaped($_['logout_url']); ?>">
+ <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/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>