From c3eb369b6d6dd325c18e1291baa42166e6004c62 Mon Sep 17 00:00:00 2001
From: Banana 
Date: Sun, 8 Aug 2021 10:01:28 +0200
Subject: [PATCH] first steps in setup file
---
 CHANGELOG                           |   1 +
 webclient/config/config.php.default |  18 ++--
 webclient/index.php                 |   1 -
 webclient/setup.php                 | 144 ++++++++++++++++++++++++++++
 4 files changed, 154 insertions(+), 10 deletions(-)
 create mode 100644 webclient/setup.php
diff --git a/CHANGELOG b/CHANGELOG
index 1b25a02..90c5277 100644
--- a/CHANGELOG
+++ b/CHANGELOG
@@ -1,6 +1,7 @@
 1.x - Rrajigar Mine
 	* Fixed install sql file.
 	* New field: artists - lookupmultiple field
+	* Added setup file. See setup.txt for more details
 
 1.2 - NyLeve's Falls 20210717
 	* Updated requirements information
diff --git a/webclient/config/config.php.default b/webclient/config/config.php.default
index 486851a..aa32af9 100644
--- a/webclient/config/config.php.default
+++ b/webclient/config/config.php.default
@@ -17,25 +17,25 @@
  */
 
 # set to true if you need debug messages in error log file
-define('DEBUG',true);
+define('DEBUG',false);
 # set to ture if you need query log messages in error log file.
-define('QUERY_DEBUG',true);
+define('QUERY_DEBUG',false);
 
 # timezone settings
-define('TIMEZONE','Europe/Berlin');
+define('TIMEZONE','~timezone~');
 
 # path settings
-define('PATH_ABSOLUTE','/home/some/path/bibliotheca/webclient');
+define('PATH_ABSOLUTE','~pathabsolute~');
 define('PATH_SYSTEMOUT',PATH_ABSOLUTE.'/systemout');
 define('PATH_STORAGE',PATH_ABSOLUTE.'/storage');
 define('PATH_WEB_STORAGE','storage');
 
 # database config
-define('DB_HOST','127.0.0.1');
-define('DB_USERNAME','user');
-define('DB_PASSWORD','test');
-define('DB_NAME','bibliotheca');
-define('DB_PREFIX','bib'); # a _ is added automatically as separation
+define('DB_HOST','~dbhost~');
+define('DB_USERNAME','~dbuser~');
+define('DB_PASSWORD','~dbpassword~');
+define('DB_NAME','~dbname~');
+define('DB_PREFIX','~dbprefix~'); # a _ is added automatically as separation
 
 ## theme support
 # fallback is default theme
diff --git a/webclient/index.php b/webclient/index.php
index beae986..d379624 100644
--- a/webclient/index.php
+++ b/webclient/index.php
@@ -25,7 +25,6 @@ ini_set('error_reporting',-1); // E_ALL & E_STRICT
 # check request
 $_urlToParse = filter_var($_SERVER['QUERY_STRING'],FILTER_SANITIZE_STRING, FILTER_FLAG_STRIP_LOW);
 if(!empty($_urlToParse)) {
-	# see http://de2.php.net/manual/en/regexp.reference.unicode.php
 	if(preg_match('/[\p{C}\p{M}\p{Sc}\p{Sk}\p{So}\p{Zl}\p{Zp}]/u',$_urlToParse) === 1) {
 		die('Malformed request. Make sure you know what you are doing.');
 	}
diff --git a/webclient/setup.php b/webclient/setup.php
new file mode 100644
index 0000000..8456b60
--- /dev/null
+++ b/webclient/setup.php
@@ -0,0 +1,144 @@
+ 'Europe/Berlin'
+		);
+
+		$TemplateData['bodyForm'] = stepConfig($data);
+	break;
+
+	case 'ready':
+	default:
+		$TemplateData['headline'] = 'Complete';
+		$TemplateData['body'] = 'All done. This file is now gone. To restart the setup remove all non .default config files and upload the setup.php file again.';
+		$TemplateData['bodyForm'] = '';
+		$TemplateData['footer'] = 'cya';
+}
+
+?>
+
+
+
+	
+	
+	
+	Setup - Bibliotheca
+
+
+	
+	
+		
+		
+	
+	
+
+
+".$tz."";
+	}
+	$absPath = getcwd();
+
+	return <<
+	Select your timezone
+	
+
+
+	The absolute path to this installation on your webspace. Current {$absPath} should be the right one.
+	
+
+
+	Database Hostname
+	
+
+
+	Database User
+	
+
+
+	Database Password for the given user
+	
+
+
+	Database name
+	
+
+
+	Database table prefix. Default is bib. A _ is added automatically.
+	
+
+RET;
+}
-- 
2.39.5