commit bfefe1b6cef7dcfbd8f0a4f54ef598777f85c206
parent fe664100b097dfb1dad4671e4647c0eeb442e75f
Author: Felicitus <felicitus@felicitus.org>
Date: Sun, 29 Nov 2015 13:32:34 +0100
Added webserver rewrite test, relates to #507
Diffstat:
6 files changed, 31 insertions(+), 1 deletion(-)
diff --git a/web/.htaccess b/web/.htaccess
@@ -16,6 +16,7 @@ DirectoryIndex app.php
RewriteRule ^setup\/$ setup/index.html
+ RewriteRule ^setup\/webserver-test$ setup/tests/webservercheck.json
# Determine the RewriteBase automatically and set it as environment variable.
# If you are using Apache aliases to do mass virtual hosting or installed the
# project in a subdirectory, the base path will be prepended to allow proper
diff --git a/web/setup/index.html b/web/setup/index.html
@@ -36,6 +36,7 @@
<script type="text/javascript" src="js/SetupTests/GenerateAuthKey.js"></script>
<script type="text/javascript" src="js/SetupTests/PHPTest.js"></script>
<script type="text/javascript" src="js/SetupTests/WebserverTest.js"></script>
+ <script type="text/javascript" src="js/SetupTests/WebserverRewriteTest.js"></script>
<script type="text/javascript" src="js/SetupTests/PHPPrerequisitesTest.js"></script>
<script type="text/javascript" src="js/SetupTests/DatabaseConnectivityTest.js"></script>
<script type="text/javascript" src="js/SetupTests/PHPSettingsTest.js"></script>
diff --git a/web/setup/js/Cards/PrerequisitesTestCard.js b/web/setup/js/Cards/PrerequisitesTestCard.js
@@ -15,6 +15,7 @@ Ext.define('PartKeeprSetup.PrerequisitesTestCard', {
this.tests.push(new PartKeeprSetup.PHPPrerequisitesTest());
this.tests.push(new PartKeeprSetup.PHPSettingsTest());
this.tests.push(new PartKeeprSetup.WebserverTest());
+ this.tests.push(new PartKeeprSetup.WebserverRewriteTest());
this.tests.push(new PartKeeprSetup.GenerateAuthKey());
}
});
diff --git a/web/setup/js/SetupTests/WebserverRewriteTest.js b/web/setup/js/SetupTests/WebserverRewriteTest.js
@@ -0,0 +1,22 @@
+/**
+ * Tests if the web server can handle rewrites
+ */
+Ext.define('PartKeeprSetup.WebserverRewriteTest', {
+ extend: 'PartKeeprSetup.AbstractTest',
+ url: 'webserver-test',
+ name: "PHP",
+ message: "Testing webserver rewrite capability",
+ onFailure: function (response) {
+ this.success = false;
+ this.resultMessage = "Web Server misconfiguration";
+ this.errors = ['Web Server Configuration error. Please read our <a href="https://wiki.partkeepr.org/wiki/KB00005:Web_Server_Configuration" target="_blank">wiki about the proper web server configuration</a>', response.responseText];
+
+ if (this.callback) {
+ this.callback.appendTestResult(this);
+ }
+
+ if (this.success) {
+ this.fireEvent("complete", this);
+ }
+ }
+});
diff --git a/web/setup/js/SetupTests/WebserverTest.js b/web/setup/js/SetupTests/WebserverTest.js
@@ -1,5 +1,5 @@
/**
- * Tests if the most important PHP prerequisites are met (e.g. json_encode).
+ * Tests if the web server can handle pathInfo
*/
Ext.define('PartKeeprSetup.WebserverTest', {
extend: 'PartKeeprSetup.AbstractTest',
diff --git a/web/setup/tests/webservercheck.json b/web/setup/tests/webservercheck.json
@@ -0,0 +1,5 @@
+{
+ "success": true,
+ "message": "Rewrite Capability present",
+ "errors": []
+}