1
0
mirror of https://git.tt-rss.org/git/tt-rss.git synced 2026-01-03 08:09:13 +00:00

prevent default admin user from being removed; properly fail on startup if single user mode is enabled but default admin user is missing from the database

This commit is contained in:
Andrew Dolgov
2010-06-10 14:29:55 +04:00
parent 76e3b28010
commit 50e7dd7d01
3 changed files with 14 additions and 2 deletions

View File

@@ -66,6 +66,18 @@
$err_msg = "config: DATABASE_BACKED_SESSIONS are currently broken with MySQL";
}
if (SINGLE_USER_MODE) {
$link = db_connect(DB_HOST, DB_USER, DB_PASS, DB_NAME);
if ($link) {
$result = db_query($link, "SELECT id FROM ttrss_users WHERE id = 1");
if (db_num_rows($result) != 1) {
$err_msg = "config: SINGLE_USER_MODE is enabled but default admin account (UID=1) is not found.";
}
}
}
if (defined('MAIL_FROM')) {
$err_msg = "config: MAIL_FROM has been split into DIGEST_FROM_NAME and DIGEST_FROM_ADDRESS";
}