]> git.wh0rd.org - tt-rss.git/blobdiff - db-updater.php
overall directory tree cleanup
[tt-rss.git] / db-updater.php
index dca3a374d1f46e131da7910e6851f4d631e7dde2..9a4fdf604b2eb52e2c9a4ea0faa56b40ed081135 100644 (file)
@@ -1,4 +1,6 @@
 <?php
+       set_include_path(get_include_path() . PATH_SEPARATOR . "include");
+
        require_once "functions.php";
        require_once "sessions.php";
        require_once "sanity_check.php";
@@ -36,7 +38,7 @@ function confirmOP() {
 }
 </script>
 
-<div class="floatingLogo"><img src="images/logo.png"></div>
+<div class="floatingLogo"><img src="images/logo_wide.png"></div>
 
 <h1><?php echo __("Database Updater") ?></h1>
 
@@ -87,15 +89,13 @@ function confirmOP() {
 
                } else {
                        print_notice(__("Tiny Tiny RSS database is up to date."));
-                       print "<form method=\"GET\" action=\"tt-rss.php\">
+                       print "<form method=\"GET\" action=\"index.php\">
                                <input type=\"submit\" value=\"".__("Return to Tiny Tiny RSS")."\">
                                </form>";
                }
 
-               return;
-       }
+       } else if ($version <= $latest_version && !$op) {
 
-       if (!$op) {
                print_warning(__("Please backup your database before proceeding."));
 
                print "<p>" . T_sprintf("Your Tiny Tiny RSS database needs update to the latest version (<b>%d</b> to <b>%d</b>).", $version, $latest_version) . "</p>";
@@ -155,10 +155,25 @@ function confirmOP() {
                print "<p>".T_sprintf("Finished. Performed <b>%d</b> update(s) up to schema
                        version <b>%d</b>.", $num_updates, $version)."</p>";
 
-               print "<form method=\"GET\" action=\"backend.php?op=logout\">
+               print "<form method=\"GET\" action=\"backend.php\">
+                       <input type=\"hidden\" name=\"op\" value=\"logout\">
+                       <input type=\"submit\" value=\"".__("Return to Tiny Tiny RSS")."\">
+                       </form>";
+
+       } else if ($version >= $latest_version) {
+
+               print_error(__("Your database schema is from a newer version of Tiny Tiny RSS."));
+
+               print "<p>" . T_sprintf("Found schema version: <b>%d</b>, required: <b>%d</b>.", $version, $latest_version) . "</p>";
+
+               print "<p>" . __("Schema upgrade impossible. Please update Tiny Tiny RSS files to the newer version and continue.") . "</p>";
+
+               print "<form method=\"GET\" action=\"backend.php\">
+                       <input type=\"hidden\" name=\"op\" value=\"logout\">
                        <input type=\"submit\" value=\"".__("Return to Tiny Tiny RSS")."\">
                        </form>";
 
+
        }
 
 ?>