]> git.mxchange.org Git - quix0rs-gnu-social.git/blobdiff - install.php
Merge branch '0.8.x' of git@gitorious.org:laconica/dev into 0.8.x
[quix0rs-gnu-social.git] / install.php
index bc82e5e37a8e0fbb7c5491ce88146b76fadf367d..570b08edf473b13e709ece605656a279d89016de 100644 (file)
@@ -1,7 +1,7 @@
 <?php
 /**
  * Laconica - a distributed open-source microblogging tool
- * Copyright (C) 2009, Controlez-Vous, Inc.
+ * Copyright (C) 2009, Control Yourself, Inc.
  *
  * This program is free software: you can redistribute it and/or modify
  * it under the terms of the GNU Affero General Public License as published by
@@ -36,7 +36,7 @@ function main()
 function checkPrereqs()
 {
        $pass = true;
-       
+
     if (file_exists(INSTALLDIR.'/config.php')) {
          ?><p class="error">Config file &quot;config.php&quot; already exists.</p>
          <?php
@@ -72,6 +72,12 @@ function checkPrereqs()
          <?
             $pass = false;
        }
+       if (!is_writable(INSTALLDIR.'/background/')) {
+         ?><p class="error">Cannot write background directory: <code><?php echo INSTALLDIR; ?>/background/</code></p>
+              <p>On your server, try this command: <code>chmod a+w <?php echo INSTALLDIR; ?>/background/</code></p>
+         <?
+            $pass = false;
+       }
 
        return $pass;
 }
@@ -88,7 +94,6 @@ function checkExtension($name)
 
 function showForm()
 {
-    $config_path = htmlentities(trim(dirname($_SERVER['REQUEST_URI']), '/'));
     echo<<<E_O_T
         </ul>
     </dd>
@@ -121,11 +126,6 @@ function showForm()
                 <input type="text" id="host" name="host" />
                 <p class="form_guide">Database hostname</p>
             </li>
-            <li>
-                <label for="host">Site path</label>
-                <input type="text" id="path" name="path" value="$config_path" />
-                <p class="form_guide">Site path, following the "/" after the domain name in the URL. Empty is fine. Field should be filled automatically.</p>
-            </li>
             <li>
                 <label for="host">Database</label>
                 <input type="text" id="database" name="database" />
@@ -167,7 +167,6 @@ function handlePost()
     $username = $_POST['username'];
     $password = $_POST['password'];
     $sitename = $_POST['sitename'];
-    $path     = $_POST['path'];
     $fancy    = !empty($_POST['fancy']);
 ?>
     <dl class="system_notice">
@@ -176,7 +175,7 @@ function handlePost()
             <ul>
 <?php
        $fail = false;
-       
+
     if (empty($host)) {
         updateStatus("No hostname specified.", true);
                $fail = true;
@@ -243,7 +242,7 @@ function handlePost()
     }
     updateStatus("Writing config file...");
     $sqlUrl = "mysqli://$username:$password@$host/$database";
-    $res = writeConf($sitename, $sqlUrl, $fancy, $path);
+    $res = writeConf($sitename, $sqlUrl, $fancy);
     if (!$res) {
         updateStatus("Can't write config file.", true);
         showForm();
@@ -257,14 +256,13 @@ function handlePost()
 <?php
 }
 
-function writeConf($sitename, $sqlUrl, $fancy, $path)
+function writeConf($sitename, $sqlUrl, $fancy)
 {
     $res = file_put_contents(INSTALLDIR.'/config.php',
                              "<?php\n".
                              "if (!defined('LACONICA')) { exit(1); }\n\n".
                              "\$config['site']['name'] = \"$sitename\";\n\n".
                              ($fancy ? "\$config['site']['fancy'] = true;\n\n":'').
-                             "\$config['site']['path'] = \"$path\";\n\n".
                              "\$config['db']['database'] = \"$sqlUrl\";\n\n".
                              "?>");
     return $res;
@@ -295,13 +293,13 @@ PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
 <html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en_US" lang="en_US">
     <head>
         <title>Install Laconica</title>
-        <link rel="stylesheet" type="text/css" href="theme/base/css/display.css?version=0.8" media="screen, projection, tv"/>
+       <link rel="shortcut icon" href="favicon.ico"/>
         <link rel="stylesheet" type="text/css" href="theme/default/css/display.css?version=0.8" media="screen, projection, tv"/>
         <!--[if IE]><link rel="stylesheet" type="text/css" href="theme/base/css/ie.css?version=0.8" /><![endif]-->
         <!--[if lte IE 6]><link rel="stylesheet" type="text/css" theme/base/css/ie6.css?version=0.8" /><![endif]-->
-        <!--[if IE]><link rel="stylesheet" type="text/css" href="theme/earthy/css/ie.css?version=0.8" /><![endif]-->
-        <script src='js/jquery.min.js'></script>
-        <script src='js/install.js'></script>
+        <!--[if IE]><link rel="stylesheet" type="text/css" href="theme/default/css/ie.css?version=0.8" /><![endif]-->
+        <script src="js/jquery.min.js"></script>
+        <script src="js/install.js"></script>
     </head>
     <body id="install">
         <div id="wrap">