From f240d26e46f028f0b80d8a19760533ce722c84c4 Mon Sep 17 00:00:00 2001 From: Andrew Dolgov Date: Thu, 4 Apr 2013 19:45:26 +0400 Subject: [PATCH] move db-updater functionality to public, remove db-updater.php --- cache/.htaccess | 0 cache/images/.empty | 0 cache/js/.empty | 0 cache/simplepie/.empty | 0 classes/handler/public.php | 103 +++++++++++++++++++++++++++++++++++++ feed-icons/.empty | 0 js/functions.js | 2 +- lock/.empty | 0 lock/.htaccess | 0 plugins/digest/digest.js | 2 +- utility.css | 4 ++ 11 files changed, 109 insertions(+), 2 deletions(-) mode change 100644 => 100755 cache/.htaccess mode change 100644 => 100755 cache/images/.empty mode change 100644 => 100755 cache/js/.empty mode change 100644 => 100755 cache/simplepie/.empty mode change 100644 => 100755 feed-icons/.empty mode change 100644 => 100755 lock/.empty mode change 100644 => 100755 lock/.htaccess diff --git a/cache/.htaccess b/cache/.htaccess old mode 100644 new mode 100755 diff --git a/cache/images/.empty b/cache/images/.empty old mode 100644 new mode 100755 diff --git a/cache/js/.empty b/cache/js/.empty old mode 100644 new mode 100755 diff --git a/cache/simplepie/.empty b/cache/simplepie/.empty old mode 100644 new mode 100755 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 "

+ +
"; + + } + } + ?> + +
+ + + h2 { + margin-top : 0px; +} + div.rss h1 { border-width : 0px 0px 1px 0px; border-color : gray;