]> git.wh0rd.org - tt-rss.git/blobdiff - install/index.php
Removing required attribute from database password field
[tt-rss.git] / install / index.php
index 6cb2ace4f370c8b5e0788354c5fd9a66b5e04893..a3f21cbb313f44633de30b35c55c43aa7f1257ce 100644 (file)
@@ -2,7 +2,8 @@
 <head>
        <title>Tiny Tiny RSS - Installer</title>
        <meta http-equiv="Content-Type" content="text/html; charset=utf-8">
-       <link rel="stylesheet" type="text/css" href="../utility.css">
+       <link rel="stylesheet" type="text/css" href="../css/utility.css">
+       <link rel="stylesheet" type="text/css" href="../css/dijit.css">
        <style type="text/css">
        textarea { font-size : 12px; }
        </style>
 <body>
 
 <?php
+
+       // could be needed because of existing config.php
+       function define_default($param, $value) {
+               //
+       }
+
        function make_password($length = 8) {
 
                $password = "";
        }
 
        function print_error($msg) {
-               print "<div class='error'><span><img src='../images/sign_excl.svg'></span>
+               print "<div class='error'><span><img src='../images/alert.png'></span>
                        <span>$msg</span></div>";
        }
 
        function print_notice($msg) {
                print "<div class=\"notice\">
-                       <span><img src=\"../images/sign_info.svg\"></span><span>$msg</span></div>";
+                       <span><img src=\"../images/information.png\"></span><span>$msg</span></div>";
        }
 
        function db_connect($host, $user, $pass, $db, $type, $port = false) {
                        if (!$result) {
                                $query = htmlspecialchars($query);
                                if ($die_on_error) {
-                                       die("Query <i>$query</i> failed: " . ($link ? mysql_error($link) : "No connection"));
+                                       die("Query <i>$query</i> failed: " . ($link ? function_exists("mysqli_connect") ? mysqli_error($link) : mysql_error($link) : "No connection"));
                                }
                        }
                        return $result;
        }
 
        function make_self_url_path() {
-               $url_path = ($_SERVER['HTTPS'] != "on" ? 'http://' :  'https://') . $_SERVER["HTTP_HOST"] . parse_url($_SERVER["REQUEST_URI"], PHP_URL_PATH);
+               $url_path = ((!isset($_SERVER['HTTPS']) || $_SERVER['HTTPS'] != "on") ? 'http://' :  'https://') . $_SERVER["HTTP_HOST"] . parse_url($_SERVER["REQUEST_URI"], PHP_URL_PATH);
 
                return $url_path;
        }
 
 <fieldset>
        <label>Password</label>
-       <input required name="DB_PASS" size="20" type="password" value="<?php echo $DB_PASS ?>"/>
+       <input name="DB_PASS" size="20" type="password" value="<?php echo $DB_PASS ?>"/>
 </fieldset>
 
 <fieldset>
                        <p>Before you can start using tt-rss, database needs to be initialized. Click on the button below to do that now.</p>
 
                        <?php
-                               $result = db_query($link, "SELECT true FROM ttrss_feeds", $DB_TYPE, false);
+                               $result = @db_query($link, "SELECT true FROM ttrss_feeds", $DB_TYPE, false);
 
                                if ($result) {
                                        print_error("Existing tt-rss tables will be removed from the database. If you would like to keep your data, skip database initialization.");
 
                } else if ($op == 'installschema' || $op == 'skipschema') {
 
-                       $link = db_connect($DB_HOST, $DB_USER, $DB_PASS, $DB_NAME, $DB_TYPE);
+                       $link = db_connect($DB_HOST, $DB_USER, $DB_PASS, $DB_NAME, $DB_TYPE, $DB_PORT);
 
                        if (!$link) {
                                print_error("Unable to connect to database using specified parameters.");