diff --git a/updates/update-2.2-to-2.3.php b/updates/update-2.2-to-2.3.php
new file mode 100644
index 0000000..3f9b207
--- /dev/null
+++ b/updates/update-2.2-to-2.3.php
@@ -0,0 +1,178 @@
+.
+*/
+
+ini_set('display_errors', 1); //Display errors in case something occurs
+?>
+
+
+
+
+
+
+
+
+
+
+ CWSlack Updater
+
+
+
+
+
CWSlack-SlashCommands Updater
+ Settings Configuration";
+ echo "
Any field left blank will not change the setting, however yes/no questions must be updated any time you save this.
";
+ echo "";
+ echo "
";
+ //Template for future use
+ //
Yes No
+ //
+ die();
+ }
+ if ($_GET["page"] == "Save Settings") {
+ $filedata = file('config.php');
+ $newdata = array();
+ $line1 = false; //For later use
+
+ foreach ($filedata as $data) {
+ if (stristr($data, '$timeoutfix =')) {
+ if ($_POST["timeoutfix"] == "yes") {
+ $newdata[] = '$timeoutfix = true; //Enable to fix any 3000ms response from Slack.' . PHP_EOL;
+ $line1=true;
+ } else {
+ $newdata[] = '$timeoutfix = false; //Enable to fix any 3000ms response from Slack.' . PHP_EOL;
+ }
+ } else if (stristr($data, '$timebusinessstart =')) {
+ if (!empty($_POST["timebusinessstart"])) {
+ $newdata[] = '$timebusinessstart = ' . $_POST["timebusinessstart"] . '; //Set to when your business opens in your timezone' . PHP_EOL;
+ } else {
+ $newdata[] = $data;
+ }
+ } else if (stristr($data, '$timebusinessclose =')) {
+ if (!empty($_POST["timebusinessclose"])) {
+ $newdata[] = '$timebusinessclose = ' . $_POST["timebusinessclose"] . '; //Set to when your business closes in your timezone' . PHP_EOL;
+ } else {
+ $newdata[] = $data;
+ }
+ } else if (stristr($data, '//cwslack-incoming.php') && !$line1) {
+ array_pop($newdata);
+ if (!empty($_POST["timebusinessstart"])) {
+ $newdata[] = '$timebusinessstart = ' . $_POST["timebusinessstart"] . '; //Set to when your business opens in your timezone' . PHP_EOL;
+ } else {
+ $newdata[] = $data;
+ }
+ if (!empty($_POST["timebusinessstart"])) {
+ $newdata[] = '$timebusinessstart = ' . $_POST["timebusinessstart"] . '; //Set to when your business opens in your timezone' . PHP_EOL;
+ } else {
+ $newdata[] = $data;
+ }
+ $newdata[] = PHP_EOL . $data;
+ } else if (stristr($data, '// Database Configuration') && !$line1) {
+ array_pop($newdata);
+ if ($_POST["timeoutfix"] == "yes") {
+ $newdata[] = '$timeoutfix = true; //Enable to fix any 3000ms response from Slack.' . PHP_EOL;
+ } else {
+ $newdata[] = '$timeoutfix = false; //Enable to fix any 3000ms response from Slack.' . PHP_EOL;
+ }
+ $newdata[] = PHP_EOL . $data;
+ } else {
+ $newdata[] = $data;
+ }
+ }
+
+
+ file_put_contents('config.php', implode('', $newdata));
+ echo "
";
+ echo "Successfully configured the config.php file! Please test out your commands in Slack and submit any issues you have to GitHub!";
+ echo "
Please remove update-2.2-to-2.3.php to avoid people accessing it externally. You can re-add it anytime to configure database or settings again, or just manually edit config.php.