Update installer to 2.0.1

merge-requests/2/head v2.0.1
Mike Koch 9 years ago
parent ad63e95975
commit 92ea19e47c

@ -1,4 +1,4 @@
## [Mods for HESK](http://mods-for-hesk.mkochcs.com) v2.0.0 ## [Mods for HESK](http://mods-for-hesk.mkochcs.com) v2.0.1
[![Stories in Ready](https://badge.waffle.io/mkoch227/Mods-For-Hesk.png?label=waffle:ready&title=Ready)](https://waffle.io/mkoch227/Mods-For-Hesk) [![Stories in Ready](https://badge.waffle.io/mkoch227/Mods-For-Hesk.png?label=waffle:ready&title=Ready)](https://waffle.io/mkoch227/Mods-For-Hesk)
[![Join the chat at https://gitter.im/mkoch227/Mods-for-HESK](https://badges.gitter.im/Join%20Chat.svg)](https://gitter.im/mkoch227/Mods-for-HESK?utm_source=badge&utm_medium=badge&utm_campaign=pr-badge&utm_content=badge) [![Join the chat at https://gitter.im/mkoch227/Mods-for-HESK](https://badges.gitter.im/Join%20Chat.svg)](https://gitter.im/mkoch227/Mods-for-HESK?utm_source=badge&utm_medium=badge&utm_campaign=pr-badge&utm_content=badge)

@ -37,7 +37,7 @@ if (!defined('IN_SCRIPT')) {die('Invalid attempt');}
// We will be installing this HESK version: // We will be installing this HESK version:
define('HESK_NEW_VERSION','2.6.0'); define('HESK_NEW_VERSION','2.6.0');
define('MODS_FOR_HESK_NEW_VERSION','2.0.0'); define('MODS_FOR_HESK_NEW_VERSION','2.0.1');
define('REQUIRE_PHP_VERSION','5.0.0'); define('REQUIRE_PHP_VERSION','5.0.0');
define('REQUIRE_MYSQL_VERSION','5.0.7'); define('REQUIRE_MYSQL_VERSION','5.0.7');

@ -25,6 +25,8 @@ if ($version == 1) {
} elseif ($version == 200) { } elseif ($version == 200) {
execute200Scripts(); execute200Scripts();
execute200FileUpdate(); execute200FileUpdate();
} elseif ($version == 201) {
execute201Scripts();
} else { } else {
$response = 'The version "'.$version.'" was not recognized. Check the value submitted and try again.'; $response = 'The version "'.$version.'" was not recognized. Check the value submitted and try again.';
print $response; print $response;

@ -34,6 +34,9 @@ function echoInitialVersionRows($version) {
if ($version < 200) { if ($version < 200) {
printRow('v2.0.0'); printRow('v2.0.0');
} }
if ($version < 201) {
printRow('v2.0.1');
}
} }
function printRow($version) { function printRow($version) {
@ -81,20 +84,22 @@ function printRow($version) {
<?php echoInitialVersionRows($startingVersion); ?> <?php echoInitialVersionRows($startingVersion); ?>
</tbody> </tbody>
</table> </table>
<table class="table table-striped" style="table-layout: fixed"> <?php if ($startingVersion < 200) { ?>
<thead> <table class="table table-striped" style="table-layout: fixed">
<tr> <thead>
<th>Task</th> <tr>
<th>Status</th> <th>Task</th>
</tr> <th>Status</th>
</thead> </tr>
<tbody> </thead>
<tr id="row-banmigrate"> <tbody>
<td>Migrate IP / Email Bans</td> <tr id="row-banmigrate">
<td><i id="spinner-banmigrate" class="fa fa-spinner"></i> <span id="span-banmigrate">Waiting...</span></td> <td>Migrate IP / Email Bans</td>
</tr> <td><i id="spinner-banmigrate" class="fa fa-spinner"></i> <span id="span-banmigrate">Waiting...</span></td>
</tbody> </tr>
</table> </tbody>
</table>
<?php } ?>
</div> </div>
</div> </div>
</div> </div>

@ -8,7 +8,7 @@ hesk_dbConnect();
?> ?>
<html> <html>
<head> <head>
<title>Mods For HESK 2.0.0 Install / Upgrade</title> <title>Mods For HESK 2.0.1 Install / Upgrade</title>
<link href="../../hesk_style.css?<?php echo HESK_NEW_VERSION; ?>" type="text/css" rel="stylesheet" /> <link href="../../hesk_style.css?<?php echo HESK_NEW_VERSION; ?>" type="text/css" rel="stylesheet" />
<link href="<?php echo HESK_PATH; ?>css/bootstrap.css?v=<?php echo $hesk_settings['hesk_version']; ?>" type="text/css" rel="stylesheet" /> <link href="<?php echo HESK_PATH; ?>css/bootstrap.css?v=<?php echo $hesk_settings['hesk_version']; ?>" type="text/css" rel="stylesheet" />
<link href="<?php echo HESK_PATH; ?>css/bootstrap-theme.css?v=<?php echo $hesk_settings['hesk_version']; ?>" type="text/css" rel="stylesheet" /> <link href="<?php echo HESK_PATH; ?>css/bootstrap-theme.css?v=<?php echo $hesk_settings['hesk_version']; ?>" type="text/css" rel="stylesheet" />
@ -20,10 +20,10 @@ hesk_dbConnect();
<script language="JavaScript" type="text/javascript" src="<?php echo HESK_PATH; ?>js/bootstrap-datepicker.js"></script> <script language="JavaScript" type="text/javascript" src="<?php echo HESK_PATH; ?>js/bootstrap-datepicker.js"></script>
</head> </head>
<body> <body>
<div class="headersm">Mods for HESK 2.0.0 Install / Upgrade</div> <div class="headersm">Mods for HESK 2.0.1 Install / Upgrade</div>
<div class="container"> <div class="container">
<div class="page-header"> <div class="page-header">
<h1>Mods for HESK 2.0.0 Install / Upgrade</h1> <h1>Mods for HESK 2.0.1 Install / Upgrade</h1>
</div> </div>
<?php <?php
$allowInstallation = true; $allowInstallation = true;
@ -135,6 +135,17 @@ hesk_dbConnect();
} }
?> ?>
<div class="row"> <div class="row">
<div class="col-md-3 col-sm-12">
<?php
if ($version == '2.0.0') {
$v200btn = 'btn-success';
$disableAllExcept = '200';
} else {
$v200btn = 'btn-default';
}
?>
<a id="200" class="btn <?php echo $v200btn; ?> btn-block disablable" href="installModsForHesk.php?v=200">v2.0.0</a>
</div>
<div class="col-md-3 col-sm-12"> <div class="col-md-3 col-sm-12">
<?php <?php
if ($version == '1.7.0') { if ($version == '1.7.0') {
@ -169,12 +180,12 @@ hesk_dbConnect();
?> ?>
<a id="160" class="btn <?php echo $v160btn; ?> btn-block disablable" href="installModsForHesk.php?v=160">v1.6.0</a> <a id="160" class="btn <?php echo $v160btn; ?> btn-block disablable" href="installModsForHesk.php?v=160">v1.6.0</a>
</div> </div>
<div class="col-md-3 col-sm-12">
<a id="150" class="btn btn-default btn-block disablable" href="installModsForHesk.php?v=150">v1.5.0</a>
</div>
</div> </div>
<br> <br>
<div class="row"> <div class="row">
<div class="col-md-3 col-sm-12">
<a id="150" class="btn btn-default btn-block disablable" href="installModsForHesk.php?v=150">v1.5.0</a>
</div>
<div class="col-md-3 col-sm-12"> <div class="col-md-3 col-sm-12">
<a id="141" class="btn btn-default btn-block disablable" href="installModsForHesk.php?v=141">v1.4.1</a> <a id="141" class="btn btn-default btn-block disablable" href="installModsForHesk.php?v=141">v1.4.1</a>
</div> </div>
@ -184,14 +195,14 @@ hesk_dbConnect();
<div class="col-md-3 col-sm-12"> <div class="col-md-3 col-sm-12">
<a id="130" class="btn btn-default btn-block disablable" href="installModsForHesk.php?v=130">v1.3.0</a> <a id="130" class="btn btn-default btn-block disablable" href="installModsForHesk.php?v=130">v1.3.0</a>
</div> </div>
<div class="col-md-3 col-sm-12">
<a id="124" class="btn btn-default btn-block disablable" href="installModsForHesk.php?v=124">v1.2.4</a>
</div>
</div> </div>
<br> <br>
<div class="row"> <div class="row">
<div class="col-sm-12"> <div class="col-md-3 col-sm-12">
<a class="btn btn-default btn-block disablable" href="installModsForHesk.php?v=0">I do not currently have Mods for HESK installed</a> <a id="124" class="btn btn-default btn-block disablable" href="installModsForHesk.php?v=124">v1.2.4</a>
</div>
<div class="col-md-9 col-sm-12">
<a class="btn btn-default btn-block disablable" href="installModsForHesk.php?v=0">No previous installation</a>
</div> </div>
</div> </div>
<br> <br>

@ -319,4 +319,13 @@ function migrateBans($creator) {
executeQuery("DROP TABLE `".hesk_dbEscape($hesk_settings['db_pfix'])."denied_ips`"); executeQuery("DROP TABLE `".hesk_dbEscape($hesk_settings['db_pfix'])."denied_ips`");
executeQuery("DROP TABLE `".hesk_dbEscape($hesk_settings['db_pfix'])."denied_emails`"); executeQuery("DROP TABLE `".hesk_dbEscape($hesk_settings['db_pfix'])."denied_emails`");
} }
// END Version 2.0.0 // END Version 2.0.0
// BEGIN Version 2.0.1
function execute201Scripts() {
global $hesk_settings;
hesk_dbConnect();
executeQuery("UPDATE `".hesk_dbEscape($hesk_settings['db_pfix'])."settings` SET `Value` = '2.0.1' WHERE `Key` = 'modsForHeskVersion'");
}
// END Version 2.0.1

@ -1,33 +0,0 @@
<?php
define('IN_SCRIPT',1);
define('HESK_PATH','../');
require(HESK_PATH . 'install/install_functions.inc.php');
require(HESK_PATH . 'hesk_settings.inc.php');
$banRS = hesk_dbQuery("SELECT `ID` FROM `".hesk_dbEscape($hesk_settings['db_pfix'])."denied_emails`
UNION ALL SELECT `ID` FROM `".hesk_dbEscape($hesk_settings['db_pfix'])."denied_ips`");
$banRows = hesk_dbNumRows($banRS);
if (hesk_dbNumRows($banRS) > 0)
{
$usersRS = hesk_dbQuery("SELECT `id`, `name` FROM `".hesk_dbEscape($hesk_settings['db_pfix'])."users` WHERE `active` = '1' ORDER BY `name`");
?>
<h2>Migrating IP / E-mail Bans</h2>
<p>Mods for HESK has detected that you have added IP address and/or email bans using Mods for HESK. As part of the upgrade process,
Mods for HESK will migrate these bans for you to HESK 2.6.0's IP/email ban feature. Select the user below that will be the "creator" of the bans,
then click "Submit".</p>
<form action="migrateBans.php" method="post" role="form">
<select name="user" id="user">
<?php
while ($row = hesk_dbFetchAssoc($usersRS))
{ ?>
<option value="<?php echo $row['id']; ?>"><?php echo $row['name']; ?></option>
<?php }
?>
</select>
<input type="submit">
</form>
<?php } else { ?>
<h1>Installation / Update complete!</h1>
<p>Please delete the <b>install</b> folder for security reasons, and then proceed back to the <a href="../../">Help Desk</a></p>
<?php } ?>

@ -160,6 +160,11 @@ function processUpdates(startingVersion) {
} else if (startingVersion < 200) { } else if (startingVersion < 200) {
startVersionUpgrade('200'); startVersionUpgrade('200');
executeUpdate(200, '200'); executeUpdate(200, '200');
} else if (startingVersion < 201) {
startVersionUpgrade('201');
executeUpdate(201, '201');
} else {
installationFinished();
} }
} }
@ -209,7 +214,7 @@ function migrateIpEmailBans(version, cssclass) {
function installationFinished() { function installationFinished() {
var output = '<div class="panel-body">' + var output = '<div class="panel-body">' +
'<div class="col-md-12 text-center">' + '<div class="col-md-12 text-center">' +
'<i class="fa fa-check fa-4x" style="color: #008000"></i><br><br>' + '<i class="fa fa-check-circle fa-4x" style="color: #008000"></i><br><br>' +
'<h4>Awesome! The installation / upgrade has completed. Please delete the <code>install</code> directory and then proceed to your helpdesk!</h4>' + '<h4>Awesome! The installation / upgrade has completed. Please delete the <code>install</code> directory and then proceed to your helpdesk!</h4>' +
'</div>' + '</div>' +
'</div>'; '</div>';
@ -261,7 +266,7 @@ function runMigration() {
function migrateComplete() { function migrateComplete() {
$('#attention-row').hide(); $('#attention-row').hide();
markUpdateAsSuccess('banmigrate'); markUpdateAsSuccess('banmigrate');
installationFinished(); processUpdates(200);
} }
jQuery(document).ready(loadJquery); jQuery(document).ready(loadJquery);

Loading…
Cancel
Save