aboutsummaryrefslogtreecommitdiffstats
path: root/core/templates
diff options
context:
space:
mode:
Diffstat (limited to 'core/templates')
-rw-r--r--core/templates/403.php25
-rw-r--r--core/templates/404-profile.php27
-rw-r--r--core/templates/404.php9
-rw-r--r--core/templates/429.php6
-rw-r--r--core/templates/confirmation.php13
-rw-r--r--core/templates/error.php9
-rw-r--r--core/templates/exception.php23
-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.php170
-rw-r--r--core/templates/installation_forbidden.php6
-rw-r--r--core/templates/installation_incomplete.php6
-rw-r--r--core/templates/layout.base.php16
-rw-r--r--core/templates/layout.guest.php26
-rw-r--r--core/templates/layout.initial-state.php11
-rw-r--r--core/templates/layout.noscript.warning.php7
-rw-r--r--core/templates/layout.public.php80
-rw-r--r--core/templates/layout.user.php38
-rw-r--r--core/templates/legacy/fileexists.html35
-rw-r--r--core/templates/login.php12
-rw-r--r--core/templates/loginflow/authpicker.php23
-rw-r--r--core/templates/loginflow/grant.php22
-rw-r--r--core/templates/loginflowv2/authpicker.php23
-rw-r--r--core/templates/loginflowv2/done.php21
-rw-r--r--core/templates/loginflowv2/grant.php24
-rw-r--r--core/templates/print_exception.php23
-rw-r--r--core/templates/print_xml_exception.php18
-rw-r--r--core/templates/profile.php1
-rw-r--r--core/templates/publicshareauth.php5
-rw-r--r--core/templates/recommendedapps.php22
-rw-r--r--core/templates/success.php8
-rw-r--r--core/templates/tags.html4
-rw-r--r--core/templates/twofactorselectchallenge.php13
-rw-r--r--core/templates/twofactorsetupchallenge.php6
-rw-r--r--core/templates/twofactorsetupselection.php25
-rw-r--r--core/templates/twofactorshowchallenge.php11
-rw-r--r--core/templates/unsupportedbrowser.php6
-rw-r--r--core/templates/untrustedDomain.php9
-rw-r--r--core/templates/update.admin.php7
-rw-r--r--core/templates/update.use-cli.php7
-rw-r--r--core/templates/update.user.php7
-rw-r--r--core/templates/xml_exception.php39
43 files changed, 399 insertions, 444 deletions
diff --git a/core/templates/403.php b/core/templates/403.php
index bdb5737f23d..dc34c8d854f 100644
--- a/core/templates/403.php
+++ b/core/templates/403.php
@@ -1,17 +1,30 @@
<?php
+/**
+ * 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';
- $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 30d03507654..00000000000
--- a/core/templates/404-profile.php
+++ /dev/null
@@ -1,27 +0,0 @@
-<?php
-
-/** @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 4cce2434d64..3dcce4d26d3 100644
--- a/core/templates/404.php
+++ b/core/templates/404.php
@@ -1,4 +1,9 @@
<?php
+/**
+ * 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 */
@@ -6,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;
}
@@ -19,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/429.php b/core/templates/429.php
index caf8a3675e2..0cfe1eb75ff 100644
--- a/core/templates/429.php
+++ b/core/templates/429.php
@@ -1,3 +1,9 @@
+<?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>
diff --git a/core/templates/confirmation.php b/core/templates/confirmation.php
index 26014cd1e79..0a73699fd68 100644
--- a/core/templates/confirmation.php
+++ b/core/templates/confirmation.php
@@ -1,20 +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="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 2e5488ae8db..ac9bd34d558 100644
--- a/core/templates/error.php
+++ b/core/templates/error.php
@@ -1,7 +1,14 @@
+<?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):?>
+ <?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 ee35510b26f..44f9908c57c 100644
--- a/core/templates/exception.php
+++ b/core/templates/exception.php
@@ -1,23 +1,15 @@
<?php
+/**
+ * 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']);
-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">
@@ -25,6 +17,9 @@ function print_exception(Throwable $e, \OCP\IL10N $l): void {
<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; ?>
<h3><?php p($l->t('Technical details')) ?></h3>
<ul>
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 9a927373a56..b002ee400cc 100644
--- a/core/templates/installation.php
+++ b/core/templates/installation.php
@@ -1,166 +1,8 @@
<?php
-script('core', 'install');
+/**
+ * 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 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/installation_forbidden.php b/core/templates/installation_forbidden.php
index 4cb4d9c057c..56b4a9082f4 100644
--- a/core/templates/installation_forbidden.php
+++ b/core/templates/installation_forbidden.php
@@ -1,3 +1,9 @@
+<?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">
diff --git a/core/templates/installation_incomplete.php b/core/templates/installation_incomplete.php
index fbceb10780c..b3a3cae5988 100644
--- a/core/templates/installation_incomplete.php
+++ b/core/templates/installation_incomplete.php
@@ -1,3 +1,9 @@
+<?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">
diff --git a/core/templates/layout.base.php b/core/templates/layout.base.php
index b4cc9acd194..44731172760 100644
--- a/core/templates/layout.base.php
+++ b/core/templates/layout.base.php
@@ -1,3 +1,10 @@
+<?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>
<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']); ?>">
@@ -5,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()); ?>">
@@ -16,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 5ebada92934..1b5b90c29fc 100644
--- a/core/templates/layout.guest.php
+++ b/core/templates/layout.guest.php
@@ -1,3 +1,10 @@
+<?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>
<html class="ng-csp" data-placeholder-focus="false" lang="<?php p($_['language']); ?>" data-locale="<?php p($_['locale']); ?>" translate="no" >
<head
@@ -12,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 } ?>
@@ -25,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.noscript.warning.php b/core/templates/layout.noscript.warning.php
index 311394592d1..103af843477 100644
--- a/core/templates/layout.noscript.warning.php
+++ b/core/templates/layout.noscript.warning.php
@@ -1,3 +1,10 @@
+<?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>
diff --git a/core/templates/layout.public.php b/core/templates/layout.public.php
index 19ec4244b9f..60460d60c83 100644
--- a/core/templates/layout.public.php
+++ b/core/templates/layout.public.php
@@ -1,14 +1,24 @@
+<?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($_['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 } ?>
@@ -26,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']); ?>"
@@ -65,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 681b0547a7c..47cced308bc 100644
--- a/core/templates/layout.user.php
+++ b/core/templates/layout.user.php
@@ -1,11 +1,17 @@
<?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 \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']
@@ -18,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()); ?>">
@@ -42,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 } ?>
@@ -57,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>
@@ -75,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 58da839fbba..251e4cd288e 100644
--- a/core/templates/login.php
+++ b/core/templates/login.php
@@ -1,8 +1,14 @@
-<?php /** @var \OCP\IL10N $l */ ?>
<?php
-script('core', 'login');
-?>
+/**
+ * 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
index b0a2efe32bd..265cb04a20f 100644
--- a/core/templates/loginflow/authpicker.php
+++ b/core/templates/loginflow/authpicker.php
@@ -1,25 +1,10 @@
<?php
/**
- * @copyright Copyright (c) 2017 Lukas Reschke <lukas@statuscode.ch>
- *
- * @license GNU AGPL version 3 or any later version
- *
- * This program is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Affero General Public License as
- * published by the Free Software Foundation, either version 3 of the
- * License, or (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Affero General Public License for more details.
- *
- * You should have received a copy of the GNU Affero General Public License
- * along with this program. If not, see <http://www.gnu.org/licenses/>.
- *
+ * SPDX-FileCopyrightText: 2017 Nextcloud GmbH and Nextcloud contributors
+ * 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 $_ */
@@ -46,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 6e09be17eeb..8d092f8e005 100644
--- a/core/templates/loginflow/grant.php
+++ b/core/templates/loginflow/grant.php
@@ -1,25 +1,10 @@
<?php
/**
- * @copyright Copyright (c) 2017 Lukas Reschke <lukas@statuscode.ch>
- *
- * @license GNU AGPL version 3 or any later version
- *
- * This program is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Affero General Public License as
- * published by the Free Software Foundation, either version 3 of the
- * License, or (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Affero General Public License for more details.
- *
- * You should have received a copy of the GNU Affero General Public License
- * along with this program. If not, see <http://www.gnu.org/licenses/>.
- *
+ * SPDX-FileCopyrightText: 2017 Nextcloud GmbH and Nextcloud contributors
+ * 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 $_ */
@@ -50,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 5d30f482df3..c60aa81d3ea 100644
--- a/core/templates/loginflowv2/authpicker.php
+++ b/core/templates/loginflowv2/authpicker.php
@@ -1,26 +1,11 @@
<?php
/**
- * @copyright Copyright (c) 2017 Lukas Reschke <lukas@statuscode.ch>
- *
- * @license GNU AGPL version 3 or any later version
- *
- * This program is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Affero General Public License as
- * published by the Free Software Foundation, either version 3 of the
- * License, or (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Affero General Public License for more details.
- *
- * You should have received a copy of the GNU Affero General Public License
- * along with this program. If not, see <http://www.gnu.org/licenses/>.
- *
+ * SPDX-FileCopyrightText: 2017 Nextcloud GmbH and Nextcloud contributors
+ * SPDX-License-Identifier: AGPL-3.0-or-later
*/
style('core', 'login/authpicker');
-script('core', 'login/authpicker');
+\OCP\Util::addScript('core', 'login/authpicker', 'core');
/** @var array $_ */
/** @var \OCP\IURLGenerator $urlGenerator */
@@ -46,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/done.php b/core/templates/loginflowv2/done.php
index 8b9dc3649e1..b0369a0a637 100644
--- a/core/templates/loginflowv2/done.php
+++ b/core/templates/loginflowv2/done.php
@@ -1,25 +1,8 @@
<?php
declare(strict_types=1);
/**
- * @copyright Copyright (c) 2019, Roeland Jago Douma <roeland@famdouma.nl>
- *
- * @author Roeland Jago Douma <roeland@famdouma.nl>
- *
- * @license GNU AGPL version 3 or any later version
- *
- * This program is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Affero General Public License as
- * published by the Free Software Foundation, either version 3 of the
- * License, or (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Affero General Public License for more details.
- *
- * You should have received a copy of the GNU Affero General Public License
- * along with this program. If not, see <http://www.gnu.org/licenses/>.
- *
+ * SPDX-FileCopyrightText: 2019 Nextcloud GmbH and Nextcloud contributors
+ * SPDX-License-Identifier: AGPL-3.0-or-later
*/
style('core', 'login/authpicker');
diff --git a/core/templates/loginflowv2/grant.php b/core/templates/loginflowv2/grant.php
index 567c3b4e776..dea4ed27d6c 100644
--- a/core/templates/loginflowv2/grant.php
+++ b/core/templates/loginflowv2/grant.php
@@ -1,25 +1,10 @@
<?php
/**
- * @copyright Copyright (c) 2017 Lukas Reschke <lukas@statuscode.ch>
- *
- * @license GNU AGPL version 3 or any later version
- *
- * This program is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Affero General Public License as
- * published by the Free Software Foundation, either version 3 of the
- * License, or (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Affero General Public License for more details.
- *
- * You should have received a copy of the GNU Affero General Public License
- * along with this program. If not, see <http://www.gnu.org/licenses/>.
- *
+ * SPDX-FileCopyrightText: 2017 Nextcloud GmbH and Nextcloud contributors
+ * 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 $_ */
@@ -48,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 33cfaeb52c6..00000000000
--- a/core/templates/profile.php
+++ /dev/null
@@ -1 +0,0 @@
-<div id="content"></div>
diff --git a/core/templates/publicshareauth.php b/core/templates/publicshareauth.php
index 3b7393e0c07..f8e102076bb 100644
--- a/core/templates/publicshareauth.php
+++ b/core/templates/publicshareauth.php
@@ -1,4 +1,9 @@
<?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');
diff --git a/core/templates/recommendedapps.php b/core/templates/recommendedapps.php
index e51189ec137..dc92694f1b0 100644
--- a/core/templates/recommendedapps.php
+++ b/core/templates/recommendedapps.php
@@ -1,27 +1,11 @@
<?php declare(strict_types=1);
/**
- * @copyright 2019 Christoph Wurst <christoph@winzerhof-wurst.at>
- *
- * @author 2019 Christoph Wurst <christoph@winzerhof-wurst.at>
- *
- * @license GNU AGPL version 3 or any later version
- *
- * This program is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Affero General Public License as
- * published by the Free Software Foundation, either version 3 of the
- * License, or (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Affero General Public License for more details.
- *
- * You should have received a copy of the GNU Affero General Public License
- * along with this program. If not, see <http://www.gnu.org/licenses/>.
+ * SPDX-FileCopyrightText: 2019 Nextcloud GmbH and Nextcloud contributors
+ * 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 5ce8ff4f045..700a1611a67 100644
--- a/core/templates/success.php
+++ b/core/templates/success.php
@@ -1,13 +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="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/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
index d81ce7c4a67..e979cfd58ab 100644
--- a/core/templates/twofactorselectchallenge.php
+++ b/core/templates/twofactorselectchallenge.php
@@ -1,4 +1,9 @@
<?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">
@@ -19,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'],
]
@@ -36,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'],
@@ -61,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'],
@@ -71,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 ea6a1e62f6e..c575ca21343 100644
--- a/core/templates/twofactorsetupchallenge.php
+++ b/core/templates/twofactorsetupchallenge.php
@@ -1,4 +1,8 @@
<?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 */
@@ -10,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 fb8db49cf17..77139ab0e2a 100644
--- a/core/templates/twofactorsetupselection.php
+++ b/core/templates/twofactorsetupselection.php
@@ -1,25 +1,8 @@
<?php
declare(strict_types=1);
/**
- * @copyright Copyright (c) 2019, Roeland Jago Douma <roeland@famdouma.nl>
- *
- * @author Roeland Jago Douma <roeland@famdouma.nl>
- *
- * @license GNU AGPL version 3 or any later version
- *
- * This program is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Affero General Public License as
- * published by the Free Software Foundation, either version 3 of the
- * License, or (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Affero General Public License for more details.
- *
- * You should have received a copy of the GNU Affero General Public License
- * along with this program. If not, see <http://www.gnu.org/licenses/>.
- *
+ * SPDX-FileCopyrightText: 2019 Nextcloud GmbH and Nextcloud contributors
+ * SPDX-License-Identifier: AGPL-3.0-or-later
*/
?>
@@ -30,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'],
@@ -52,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 9be36fe13a2..6bc367d4025 100644
--- a/core/templates/twofactorshowchallenge.php
+++ b/core/templates/twofactorshowchallenge.php
@@ -1,6 +1,11 @@
<?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 array $_ */
/** @var boolean $error */
$error = $_['error'];
/* @var $error_message string */
@@ -23,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'],
@@ -33,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/unsupportedbrowser.php b/core/templates/unsupportedbrowser.php
index 54547e204f3..519f0bc9f5c 100644
--- a/core/templates/unsupportedbrowser.php
+++ b/core/templates/unsupportedbrowser.php
@@ -1 +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 1ae8b73d9b8..874fd7aa8d5 100644
--- a/core/templates/untrustedDomain.php
+++ b/core/templates/untrustedDomain.php
@@ -1,4 +1,11 @@
-<?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 $_ */
+?>
<div class="guest-box">
<h2><?php p($l->t('Access through untrusted domain')); ?></h2>
diff --git a/core/templates/update.admin.php b/core/templates/update.admin.php
index daa6229c4c7..504071451a9 100644
--- a/core/templates/update.admin.php
+++ b/core/templates/update.admin.php
@@ -1,3 +1,10 @@
+<?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']) { ?>
diff --git a/core/templates/update.use-cli.php b/core/templates/update.use-cli.php
index 9d1febe614a..a13dd2f51f1 100644
--- a/core/templates/update.use-cli.php
+++ b/core/templates/update.use-cli.php
@@ -1,3 +1,10 @@
+<?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>
diff --git a/core/templates/update.user.php b/core/templates/update.user.php
index 1cb527bb9c8..0b702c0d246 100644
--- a/core/templates/update.user.php
+++ b/core/templates/update.user.php
@@ -1,3 +1,10 @@
+<?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>
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>