From 2376ad492574e1ac422efc7e91930667872863d6 Mon Sep 17 00:00:00 2001 From: Andrew Dolgov Date: Wed, 20 Apr 2011 11:46:16 +0400 Subject: [PATCH 1/2] fix redirects after schema upgrade; fix logout requiring valid schema --- backend.php | 2 +- db-updater.php | 3 ++- register.php | 3 ++- 3 files changed, 5 insertions(+), 3 deletions(-) diff --git a/backend.php b/backend.php index c78284c6a..fdaf2c466 100644 --- a/backend.php +++ b/backend.php @@ -124,7 +124,7 @@ $error = sanity_check($link); - if ($error['code'] != 0) { + if ($error['code'] != 0 && $op != "logout") { print json_encode(array("error" => $error)); return; } diff --git a/db-updater.php b/db-updater.php index dca3a374d..8590ee82a 100644 --- a/db-updater.php +++ b/db-updater.php @@ -155,7 +155,8 @@ function confirmOP() { print "

".T_sprintf("Finished. Performed %d update(s) up to schema version %d.", $num_updates, $version)."

"; - print "
+ print " +
"; diff --git a/register.php b/register.php index 2b464dc8f..86a8824cf 100644 --- a/register.php +++ b/register.php @@ -148,7 +148,8 @@ if (!ENABLE_REGISTRATION) { print_error(__("New user registrations are administratively disabled.")); - print "

+ print "

+

"; return; From 0ae2bb2a69c3691c2301fc66b46624447d0c8d32 Mon Sep 17 00:00:00 2001 From: Andrew Dolgov Date: Wed, 20 Apr 2011 11:52:17 +0400 Subject: [PATCH 2/2] db-updater: properly handle situation of newer active schema; utility scripts: fix incorrect logo --- db-updater.php | 20 ++++++++++++++++---- opml.php | 2 +- register.php | 2 +- 3 files changed, 18 insertions(+), 6 deletions(-) diff --git a/db-updater.php b/db-updater.php index 8590ee82a..edee3bc83 100644 --- a/db-updater.php +++ b/db-updater.php @@ -36,7 +36,7 @@ function confirmOP() { } - +

@@ -92,10 +92,8 @@ function confirmOP() { "; } - return; - } + } else if ($version <= $latest_version && !$op) { - if (!$op) { print_warning(__("Please backup your database before proceeding.")); print "

" . T_sprintf("Your Tiny Tiny RSS database needs update to the latest version (%d to %d).", $version, $latest_version) . "

"; @@ -160,6 +158,20 @@ function confirmOP() { "; + } else if ($version >= $latest_version) { + + print_error(__("Your database schema is from a newer version of Tiny Tiny RSS.")); + + print "

" . T_sprintf("Found schema version: %d, required: %d.", $version, $latest_version) . "

"; + + print "

" . __("Schema upgrade impossible. Please update Tiny Tiny RSS files to the newer version and continue.") . "

"; + + print "
+ + +
"; + + } ?> diff --git a/opml.php b/opml.php index 40ea2637a..2e1eb84c6 100644 --- a/opml.php +++ b/opml.php @@ -158,7 +158,7 @@ -
+

".__('OPML Utility')."

"; db_query($link, "BEGIN"); diff --git a/register.php b/register.php index 86a8824cf..144189f74 100644 --- a/register.php +++ b/register.php @@ -140,7 +140,7 @@ - +