mirror of
https://github.com/flarum/framework.git
synced 2024-12-18 19:15:56 +08:00
1242fa79af
If the version in the settings table mismatches the code version, then we return a 503 error for all requests coming through index.php and api.php, while admin.php serves up a form prompting for the database password which will run outstanding migrations.
46 lines
1.2 KiB
PHP
46 lines
1.2 KiB
PHP
<h2>Update Flarum</h2>
|
|
|
|
<p>Enter your database password to update Flarum. Before you proceed, you should <strong>back up your database</strong>. If you have any trouble, get help on the <a href="http://flarum.org/docs/updating" target="_blank">Flarum website</a>.</p>
|
|
|
|
<form method="post">
|
|
<div id="error" style="display:none"></div>
|
|
|
|
<div class="FormGroup">
|
|
<div class="FormField">
|
|
<label>Database Password</label>
|
|
<input type="password" name="databasePassword">
|
|
</div>
|
|
</div>
|
|
|
|
<div class="FormButtons">
|
|
<button type="submit">Update Flarum</button>
|
|
</div>
|
|
</form>
|
|
|
|
<script src="https://code.jquery.com/jquery-2.1.4.min.js"></script>
|
|
<script>
|
|
$(function() {
|
|
$('form :input:first').select();
|
|
|
|
$('form').on('submit', function(e) {
|
|
e.preventDefault();
|
|
|
|
var $button = $(this).find('button')
|
|
.text('Please Wait...')
|
|
.prop('disabled', true);
|
|
|
|
$.post('', $(this).serialize())
|
|
.done(function() {
|
|
window.location.reload();
|
|
})
|
|
.fail(function(data) {
|
|
$('#error').show().text('Something went wrong:\n\n' + data.responseText);
|
|
|
|
$button.prop('disabled', false).text('Update Flarum');
|
|
});
|
|
|
|
return false;
|
|
});
|
|
});
|
|
</script>
|