X-Git-Url: https://git.wh0rd.org/?a=blobdiff_plain;f=update.php;h=f59f9ef3e56c04397c6a2d7de718df1d7305f353;hb=f46192bb191acdbc733f60bad60c4eb83ebb2e26;hp=41206dc757cdc5fbfaba6a04f639e50d330ad17b;hpb=07a2b3142e75e6a643db0993886dca356ba1cbb9;p=tt-rss.git diff --git a/update.php b/update.php index 41206dc7..f59f9ef3 100644 --- a/update.php +++ b/update.php @@ -13,18 +13,23 @@ if (DB_TYPE == "pgsql") { pg_query($link, "set client_encoding = 'utf-8'"); pg_set_client_encoding("UNICODE"); + } else { + if (defined('MYSQL_CHARSET') && MYSQL_CHARSET) { + db_query($link, "SET NAMES " . MYSQL_CHARSET); +// db_query($link, "SET CHARACTER SET " . MYSQL_CHARSET); + } } - + login_sequence($link); $owner_uid = $_SESSION["uid"]; - if ($_SESSION["access_level"] < 10) { - print "
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', 14); + ?> @@ -39,13 +44,13 @@ -" . + __("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:"; @@ -110,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; } @@ -150,11 +164,11 @@ function confirmOP() { } } - print "
Finished. Performed $num_updates update(s) up to schema - version $version.
"; + print "".T_sprintf("Finished. Performed %d update(s) up to schema + version %d.", $num_updates, $version)."
"; print ""; }