X-Git-Url: https://git.wh0rd.org/?a=blobdiff_plain;f=update.php;h=f59f9ef3e56c04397c6a2d7de718df1d7305f353;hb=f46192bb191acdbc733f60bad60c4eb83ebb2e26;hp=4e1eb923aa52831653e7b6356374d2cec1d940bf;hpb=ef59e6e85fe949a3afcd42a4a9b9df42a625ace2;p=tt-rss.git diff --git a/update.php b/update.php index 4e1eb923..f59f9ef3 100644 --- a/update.php +++ b/update.php @@ -1,4 +1,6 @@ Error: your access level is insufficient to run this script.

"; + 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; } - - define('SCHEMA_VERSION', 13); + ?> @@ -37,13 +44,13 @@ -

Database Updater

+

Tiny Tiny RSS database is up to date (version $version).

"; - print "
- -
"; + + if ($version != SCHEMA_VERSION) { + print_error(__("Could not update database")); + + print "

" . + __("Could not find necessary schema file, need version:") . + " " . SCHEMA_VERSION . __(", found: ") . $latest_version . "

"; + + } else { + print "

".__("Tiny Tiny RSS database is up to date.")."

"; + print "
+ +
"; + } return; } if (!$op) { - print "

Warning: Please backup your database before proceeding.

"; + print_warning(__("Please backup your database before proceeding.")); - print "

Your Tiny Tiny RSS database needs update to the latest - version ($version —> $latest_version).

"; + print "

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

"; /* print "

Available incremental updates:"; @@ -108,39 +124,39 @@ function confirmOP() { print "

- +
"; } else if ($op == "do") { - print "

Performing updates (from version $version)...

"; + print "

".__("Performing updates...")."

"; $num_updates = 0; foreach (array_keys($update_versions) as $v) { if ($v == $version + 1) { - print "

Updating to version $v...

"; + print "

".T_sprintf("Updating to version %d...", $v)."

"; $fp = fopen($update_versions[$v], "r"); if ($fp) { while (!feof($fp)) { $query = trim(getline($fp, ";")); if ($query != "") { - print "

QUERY: $query

"; + print "

$query

"; db_query($link, $query); } } } fclose($fp); - print "

Checking version... "; + print "

".__("Checking version... "); $result = db_query($link, "SELECT schema_version FROM ttrss_version"); $version = db_fetch_result($result, 0, "schema_version"); if ($version == $v) { - print "OK! ($version)"; + print __("OK!"); } else { - print "ERROR!"; + print "".__("ERROR!").""; return; } @@ -148,11 +164,11 @@ function confirmOP() { } } - print "

Finished. Performed $num_updates updates up to schema - version $version.

"; + print "

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

"; - print "
- + print " +
"; }