- /* We try to create an empty one. */
- if (!@touch (JIRAFEAU_CFG))
- {
- require (JIRAFEAU_ROOT . 'lib/template/header.php');
- echo '<div class="error"><p>' .
- t('The local configuration file could not be created. Create a ' .
+ echo '<div class="error"><h2>Error</h2><p>' . $errorText . '</p></div>';
+ require(JIRAFEAU_ROOT . 'lib/template/footer.php');
+ exit;
+}
+
+/**
+ * Check installation
+ **/
+
+// Is the installation process done already?
+// Then there is nothing to do here → redirect to the main page.
+if ($cfg['installation_done'] === true) {
+ header('Location: index.php');
+ exit;
+}
+
+/**
+ * Prepare installation process
+ **/
+
+require(JIRAFEAU_ROOT . 'lib/template/header.php');
+
+// does the local configuration file exist?
+if (!file_exists(JIRAFEAU_CFG)) {
+ // show an error if it is not possible to create the file
+ if (!@touch(JIRAFEAU_CFG)) {
+ jirafeau_fatal_error(
+ t('The local configuration file could not be created. Create a ' .