]> git.wh0rd.org - tt-rss.git/blobdiff - install/index.php
generate base css files using lessc
[tt-rss.git] / install / index.php
index 00e90dfe7c8d8db348cfc35d3de9a3f63e7035b5..9f817db1790d6da4dd3e834170f62d1e22b21cd8 100755 (executable)
@@ -3,7 +3,7 @@
        <title>Tiny Tiny RSS - Installer</title>
        <meta http-equiv="Content-Type" content="text/html; charset=utf-8">
        <link rel="stylesheet" type="text/css" href="../css/utility.css">
-       <link rel="stylesheet" type="text/css" href="../css/dijit.css">
+       <link rel="stylesheet" type="text/css" href="../css/default.css">
        <style type="text/css">
        textarea { font-size : 12px; }
        </style>
@@ -22,7 +22,7 @@
                $password = "";
                $possible = "0123456789abcdfghjkmnpqrstvwxyzABCDFGHJKMNPQRSTVWXYZ*%+^";
 
-       $i = 0;
+       $i = 0;
 
                while ($i < $length) {
                        $char = substr($possible, mt_rand(0, strlen($possible)-1), 1);
 
                $finished = false;
 
-               if (function_exists("mcrypt_decrypt")) {
-                       $crypt_key = make_password(24);
-               } else {
-                       $crypt_key = "";
-               }
-
                foreach ($data as $line) {
                        if (preg_match("/define\('DB_TYPE'/", $line)) {
                                $rv .= "\tdefine('DB_TYPE', '$DB_TYPE');\n";
                                $rv .= "\tdefine('DB_PORT', '$DB_PORT');\n";
                        } else if (preg_match("/define\('SELF_URL_PATH'/", $line)) {
                                $rv .= "\tdefine('SELF_URL_PATH', '$SELF_URL_PATH');\n";
-                       } else if (preg_match("/define\('FEED_CRYPT_KEY'/", $line)) {
-                               $rv .= "\tdefine('FEED_CRYPT_KEY', '$crypt_key');\n";
                        } else if (!$finished) {
                                $rv .= "$line\n";
                        }
                }
        }
 
+       function is_server_https() {
+               return (!empty($_SERVER['HTTPS']) && ($_SERVER['HTTPS'] != 'off')) || $_SERVER['HTTP_X_FORWARDED_PROTO'] == 'https';
+       }
+
        function make_self_url_path() {
-               $url_path = ((!isset($_SERVER['HTTPS']) || $_SERVER['HTTPS'] != "on") ? 'http://' :  'https://') . $_SERVER["HTTP_HOST"] . parse_url($_SERVER["REQUEST_URI"], PHP_URL_PATH);
+               $url_path = (is_server_https() ? 'https://' :  'http://') . $_SERVER["HTTP_HOST"] . parse_url($_SERVER["REQUEST_URI"], PHP_URL_PATH);
 
                return $url_path;
        }
                        array_push($notices, "CURL and open_basedir combination breaks support for HTTP redirects. See the FAQ for more information.");
                }
 
+               if (!function_exists("idn_to_ascii")) {
+                       array_push($notices, "PHP support for Internationalization Functions is required to handle Internationalized Domain Names.");
+               }
+
                if (count($notices) > 0) {
                        print_notice("Configuration check succeeded with minor problems:");