]> source.dussan.org Git - nextcloud-server.git/commitdiff
Allow to enforce update via web UI 4805/head
authorMorris Jobke <hey@morrisjobke.de>
Thu, 11 May 2017 03:26:51 +0000 (22:26 -0500)
committerMorris Jobke <hey@morrisjobke.de>
Thu, 11 May 2017 15:22:44 +0000 (10:22 -0500)
* adds a disclaimer that an update via web UI is on own risk
* allows to skip the warning
* fixes #4353

Signed-off-by: Morris Jobke <hey@morrisjobke.de>
core/css/guest.css
core/templates/update.use-cli.php
lib/base.php

index 689eb45d65f36d2625692e21a6664a71c46bbf2e..cf9bec50dc34362f2a0f295691d9a74ca173fe12 100644 (file)
@@ -178,6 +178,17 @@ input.updateButton,
 input.update-continue {
        padding: 10px 20px; /* larger log in and installation buttons */
 }
+.updateAnyways a.updateAnywaysButton {
+       font-size: 14px;
+       padding: 10px 20px;
+       color: #666 !important;
+       display: inline-block;
+       border-radius: 3px;
+       margin: 15px 5px;
+}
+.updateAnyways a.updateAnywaysButton:hover {
+       color: #222 !important;
+}
 input.primary,
 button.primary {
        border: 1px solid #0082c9;
@@ -442,6 +453,9 @@ form #selectDbType label.ui-state-active {
        border-radius: 3px;
        cursor: default;
 }
+.warning.updateAnyways {
+       text-align: center;
+}
 .warning legend,
 .warning a,
 .error a {
index 9fbdbca8b21520cd67ce68498aa009db47935a7d..d30e15c8573e75e3d13d1d7b48ec16f60a072993 100644 (file)
                        print_unescaped($l->t('For help, see the  <a target="_blank" rel="noreferrer" href="%s">documentation</a>.', [link_to_docs('admin-cli-upgrade')])); ?><br><br>
                </div>
        </div>
+
+       <?php if ($_['tooBig']) { ?>
+               <div class="warning updateAnyways">
+                       <?php p($l->t('I know that if I continue doing the update via web UI has the risk, that the request runs into a timeout and could cause data loss, but I have a backup and know how to restore my instance in case of a failure.' )); ?>
+                       <a href="?IKnowThatThisIsABigInstanceAndTheUpdateRequestCouldRunIntoATimeoutAndHowToRestoreABackup=IAmSuperSureToDoThis" class="button updateAnywaysButton"><?php p($l->t('Upgrade via web on my own risk' )); ?></a>
+               </div>
+       <?php } ?>
+
+
 </div>
index 483cd6569166907c0990a7c3b42c0f5255170399..0a51d3af5fc13de85024baffb82ba4398a6c3d7c 100644 (file)
@@ -343,7 +343,10 @@ class OC {
                                $tooBig = ($totalUsers > 50);
                        }
                }
-               if ($disableWebUpdater || $tooBig) {
+               $ignoreTooBigWarning = isset($_GET['IKnowThatThisIsABigInstanceAndTheUpdateRequestCouldRunIntoATimeoutAndHowToRestoreABackup']) &&
+                       $_GET['IKnowThatThisIsABigInstanceAndTheUpdateRequestCouldRunIntoATimeoutAndHowToRestoreABackup'] === 'IAmSuperSureToDoThis';
+
+               if ($disableWebUpdater || ($tooBig && !$ignoreTooBigWarning)) {
                        // send http status 503
                        header('HTTP/1.1 503 Service Temporarily Unavailable');
                        header('Status: 503 Service Temporarily Unavailable');