From f240d26e46f028f0b80d8a19760533ce722c84c4 Mon Sep 17 00:00:00 2001 From: Andrew Dolgov Date: Thu, 4 Apr 2013 19:45:26 +0400 Subject: move db-updater functionality to public, remove db-updater.php --- classes/handler/public.php | 103 +++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 103 insertions(+) (limited to 'classes') diff --git a/classes/handler/public.php b/classes/handler/public.php index 3d3d6727d..e95f118bb 100644 --- a/classes/handler/public.php +++ b/classes/handler/public.php @@ -838,12 +838,115 @@ class Handler_Public extends Handler { } function dbupdate() { + if (!SINGLE_USER_MODE && $_SESSION["access_level"] < 10) { + $_SESSION["login_error_msg"] = __("Your access level is insufficient to run this script."); + render_login_form($link); + exit; + } + + ?> + + Database Updater + + + + + + + + + +

+ +
+ + link, DB_TYPE, SCHEMA_VERSION); + + if ($op == "performupdate") { + if ($updater->isUpdateRequired()) { + + print "

Performing updates

"; + + print "

Updating to schema version " . SCHEMA_VERSION . "

"; + + print ""; + + print_warning("One of the updates failed. Either retry the process or perform updates manually."); + print "

+ +
"; + + break; + } else { + print "OK!"; + } + } + + print ""; + print_notice("Your Tiny Tiny RSS database is now updated to the latest version."); + print "

+ +
"; + + } else { + print "

Your database is up to date.

"; + + print "

+ +
"; + } + } else { + if ($updater->isUpdateRequired()) { + + print "

Database update required

"; + print "

"; + printf("Your Tiny Tiny RSS database needs update to the latest version: %d to %d.", + $updater->getSchemaVersion(), SCHEMA_VERSION); + print "

"; + print_warning("Please backup your database before proceeding."); + print "
+ + +
"; + + } else { + + print "

" . "Tiny Tiny RSS database is up to date." . "

"; + + print "

+ +
"; + + } + } + ?> +
+ + +