]> git.wh0rd.org - tt-rss.git/commitdiff
update.php: display error message when running from the browser
authorAndrew Dolgov <fox@madoka.volgo-balt.ru>
Thu, 23 Aug 2012 09:17:22 +0000 (13:17 +0400)
committerAndrew Dolgov <fox@madoka.volgo-balt.ru>
Thu, 23 Aug 2012 09:17:22 +0000 (13:17 +0400)
mention self-updating in new version dialog

classes/dlg.php
update.php

index 008518a8aa5c0f528a76ca7e644724d9f72f1f67..2701a98b29d961bd7ebca098a899f5540ef59a13 100644 (file)
@@ -899,6 +899,8 @@ class Dlg extends Handler_Protected {
                $details = "http://tt-rss.org/redmine/versions/show/$id";
                $download = "http://tt-rss.org/#Download";
 
+               print "<p align='center'>".__("You can try updating automatically using update.php")."</p>";
+
                print "<div style='text-align : center'>";
                print "<button dojoType=\"dijit.form.Button\"
                        onclick=\"return window.open('$details')\">".__("Details")."</button>";
index f23244d84625538cf8e6abc76bcf99a42124593e..01ce6df81a590e385e138c29f60a34b08eac16be 100755 (executable)
        require_once "db.php";
        require_once "db-prefs.php";
 
+       if (!defined('STDIN')) {
+               ?> <html>
+               <head>
+               <title>Database Updater</title>
+               <meta http-equiv="Content-Type" content="text/html; charset=utf-8">
+               <link rel="stylesheet" type="text/css" href="utility.css">
+               </head>
+
+               <body>
+               <div class="floatingLogo"><img src="images/logo_wide.png"></div>
+               <h1><?php echo __("Update") ?></h1>
+
+               <?php print_error("Please run this script from the command line."); ?>
+
+               </body></html>
+       <?php
+               exit;
+       }
+
        if (!defined('PHP_EXECUTABLE'))
                define('PHP_EXECUTABLE', '/usr/bin/php');