Show an error message when the sqlite database is readonly (#427)
This commit is contained in:
parent
40bae4f5b2
commit
0ad7691634
@ -129,6 +129,16 @@ if ($entriesAmount < (int)$serendipity['dashboardEntriesLimit']) {
|
||||
}
|
||||
}
|
||||
|
||||
$dbHealth = true;
|
||||
if ($serendipity['dbType'] == 'sqlite' || $serendipity['dbType'] == 'sqlite3' || $serendipity['dbType'] == 'pdo-sqlite') {
|
||||
// we check that the database is writeable, because that's otherwise hard to detect for users
|
||||
$dbFile = $serendipity['serendipityPath'] . $serendipity['dbName'] . '.db';
|
||||
$dbHealth = is_writable($dbFile);
|
||||
|
||||
}
|
||||
|
||||
$data['db_health'] = $dbHealth;
|
||||
|
||||
$data['entries'] = $entries;
|
||||
|
||||
$data['urltoken'] = serendipity_setFormToken('url');
|
||||
|
@ -2,6 +2,10 @@
|
||||
<h2>{$CONST.WELCOME_BACK} {$username|escape}</h2>
|
||||
<a href="#s9y_links" class="button_link toggle_links"><span class="icon-info-circled" aria-hidden="true"></span><span class="visuallyhidden"> {$CONST.FURTHER_LINKS}</span></a>
|
||||
</div>
|
||||
{if NOT $db_health}
|
||||
<span class="msg_error"><span class="icon-attention-circled" aria-hidden="true"></span> Error, database not writeable</span>
|
||||
<hr class="separator">
|
||||
{/if}
|
||||
{$backend_frontpage_display}
|
||||
<div id="dashboard">
|
||||
{if $published}
|
||||
|
Loading…
x
Reference in New Issue
Block a user