From e1383c65d8755350caafd581c08b1ab37bb87afb Mon Sep 17 00:00:00 2001 From: Mike Koch Date: Sun, 18 Oct 2015 16:37:55 -0400 Subject: [PATCH] Update installer --- install/install_functions.inc.php | 3 +- .../ajax/install-database-ajax.php | 3 + install/mods-for-hesk/installModsForHesk.php | 3 + install/mods-for-hesk/js/version-scripts.js | 2 + install/mods-for-hesk/modsForHesk.php | 85 +++++++++++++------ 5 files changed, 71 insertions(+), 25 deletions(-) diff --git a/install/install_functions.inc.php b/install/install_functions.inc.php index e1e85b76..7bd1c449 100644 --- a/install/install_functions.inc.php +++ b/install/install_functions.inc.php @@ -37,7 +37,8 @@ if (!defined('IN_SCRIPT')) {die('Invalid attempt');} // We will be installing this HESK version: define('HESK_NEW_VERSION','2.6.5'); -define('MODS_FOR_HESK_NEW_VERSION','2.4.2'); +define('MODS_FOR_HESK_NEW_VERSION_INT', 250); +define('MODS_FOR_HESK_NEW_VERSION','2.5.0'); define('REQUIRE_PHP_VERSION','5.0.0'); define('REQUIRE_MYSQL_VERSION','5.0.7'); diff --git a/install/mods-for-hesk/ajax/install-database-ajax.php b/install/mods-for-hesk/ajax/install-database-ajax.php index 9fb46b90..50dbea77 100644 --- a/install/mods-for-hesk/ajax/install-database-ajax.php +++ b/install/mods-for-hesk/ajax/install-database-ajax.php @@ -53,6 +53,9 @@ if ($version == 1) { execute241FileUpdate(); } elseif ($version == 242) { execute242Scripts(); +} elseif ($version == 250) { + migrateSettings(); + execute250Scripts(); } else { $response = 'The version "' . $version . '" was not recognized. Check the value submitted and try again.'; print $response; diff --git a/install/mods-for-hesk/installModsForHesk.php b/install/mods-for-hesk/installModsForHesk.php index ae99ffa8..125872f0 100644 --- a/install/mods-for-hesk/installModsForHesk.php +++ b/install/mods-for-hesk/installModsForHesk.php @@ -68,6 +68,9 @@ function echoInitialVersionRows($version) if ($version < 20) { printRow('2.4.2'); } + if ($version < 21) { + printRow('2.5.0'); + } } function printRow($version) diff --git a/install/mods-for-hesk/js/version-scripts.js b/install/mods-for-hesk/js/version-scripts.js index 42d62286..f2128677 100644 --- a/install/mods-for-hesk/js/version-scripts.js +++ b/install/mods-for-hesk/js/version-scripts.js @@ -56,6 +56,8 @@ function processUpdates(startingVersion) { } else if (startingVersion < 20) { startVersionUpgrade('242'); executeUpdate(20, '242', '2.4.2'); + } else if (startingVersion < 21) { + executeUpdate(21, '250', '2.5.0'); } else { installationFinished(); } diff --git a/install/mods-for-hesk/modsForHesk.php b/install/mods-for-hesk/modsForHesk.php index dfa0dcba..02626a9e 100644 --- a/install/mods-for-hesk/modsForHesk.php +++ b/install/mods-for-hesk/modsForHesk.php @@ -77,6 +77,39 @@ hesk_dbConnect(); * Mods for HESK is unable to check database permissions automatically. + 0) { + $versionRS = hesk_dbQuery('SELECT `Value` FROM `' . hesk_dbEscape($hesk_settings['db_pfix']) . 'settings` WHERE `Key` = \'modsForHeskVersion\''); + $versionArray = hesk_dbFetchAssoc($versionRS); + $version = $versionArray['Value']; + $no_dotted_version = str_replace('.', '', $version); + $int_version = intval($no_dotted_version); + $int_newest_version = MODS_FOR_HESK_NEW_VERSION_INT; + + // Display file permissions if the user doesn't have 2.5.0 installed yet + if ($int_version < $int_newest_version): ?> + + + modsForHesk_settings.inc.php + + + > + Success'; + } else { + echo ' CHMOD to 0666, yours is '.$fileperm; + $allowInstallation = false; + } + ?> + + + @@ -109,14 +142,6 @@ hesk_dbConnect();

What version of Mods for HESK do you currently have installed?


0) { - $versionRS = hesk_dbQuery('SELECT `Value` FROM `' . hesk_dbEscape($hesk_settings['db_pfix']) . 'settings` WHERE `Key` = \'modsForHeskVersion\''); - $versionArray = hesk_dbFetchAssoc($versionRS); - $version = $versionArray['Value']; - if ($version != MODS_FOR_HESK_NEW_VERSION) { echo '
'; echo '
'; @@ -129,6 +154,18 @@ hesk_dbConnect(); } ?>
+
+ + 2.4.2 +
btn-block disablable" href="installModsForHesk.php?v=17">2.3.2
+
+
+ +
btn-block disablable" href="installModsForHesk.php?v=16">2.3.1
-
-
- -
btn-block disablable" href="installModsForHesk.php?v=13">2.2.0
+
+
+ +
btn-block disablable" href="installModsForHesk.php?v=12">2.1.1
-
-
- -
btn-block disablable" href="installModsForHesk.php?v=9">2.0.0
+
+
+ +
btn-block disablable" href="installModsForHesk.php?v=8">1.7.0
-
-
- -
1.5.0
-
- 1.4.1 -

+
+ 1.4.1 +