Making some more progress on AJAX-driven install
This commit is contained in:
parent
fe1c483b1f
commit
a9713886d8
@ -54,7 +54,7 @@ hesk_iHeader();
|
||||
<a class="btn btn-default btn-lg" href="update.php?" role="button">Upgrade</a>
|
||||
<p><br/>Upgrade existing HESK installation to version <?php echo HESK_NEW_VERSION; ?></p>
|
||||
<br/><br/>
|
||||
<a class="btn btn-default btn-lg" href="modsForHesk.php" role="button">Install / Upgrade Mods for HESK</a>
|
||||
<a class="btn btn-default btn-lg" href="mods-for-hesk/modsForHesk.php" role="button">Install / Upgrade Mods for HESK</a>
|
||||
<p><br/>Install or upgrade existing Mods for HESK installation to version <?php echo MODS_FOR_HESK_NEW_VERSION; ?></p>
|
||||
</div>
|
||||
|
||||
|
10
install/mods-for-hesk/ajax/database-ajax.php
Normal file
10
install/mods-for-hesk/ajax/database-ajax.php
Normal file
@ -0,0 +1,10 @@
|
||||
<?php
|
||||
define('IN_SCRIPT',1);
|
||||
define('HESK_PATH','../../');
|
||||
require(HESK_PATH . 'install/install_functions.inc.php');
|
||||
require(HESK_PATH . 'hesk_settings.inc.php');
|
||||
require('modsForHeskSql.php');
|
||||
|
||||
$version = $_POST['version'];
|
||||
$type = $_POST['type'];
|
||||
return;
|
@ -1,9 +1,8 @@
|
||||
<?php
|
||||
define('IN_SCRIPT',1);
|
||||
define('HESK_PATH','../');
|
||||
define('HESK_PATH','../../');
|
||||
require(HESK_PATH . 'install/install_functions.inc.php');
|
||||
require(HESK_PATH . 'hesk_settings.inc.php');
|
||||
require('modsForHeskSql.php');
|
||||
|
||||
if (!isset($_GET['v'])) {
|
||||
die('Starting version not set!');
|
||||
@ -50,11 +49,11 @@ function printRow($version) {
|
||||
<html>
|
||||
<head>
|
||||
<title>Installing / Updating Mods for HESK</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-theme.css?v=<?php echo $hesk_settings['hesk_version']; ?>" type="text/css" rel="stylesheet" />
|
||||
<link href="//netdna.bootstrapcdn.com/font-awesome/4.3.0/css/font-awesome.min.css" rel="stylesheet">
|
||||
<link href="../css/hesk_newStyle.php" type="text/css" rel="stylesheet" />
|
||||
<link href="../../css/hesk_newStyle.php" type="text/css" rel="stylesheet" />
|
||||
<script src="<?php echo HESK_PATH; ?>js/jquery-1.10.2.min.js"></script>
|
||||
<script language="Javascript" type="text/javascript" src="<?php echo HESK_PATH; ?>js/bootstrap.min.js"></script>
|
||||
<script language="Javascript" type="text/javascript" src="<?php echo HESK_PATH; ?>js/modsForHesk-javascript.js"></script>
|
||||
@ -81,6 +80,20 @@ function printRow($version) {
|
||||
<?php echoInitialVersionRows($startingVersion); ?>
|
||||
</tbody>
|
||||
</table>
|
||||
<table class="table table-striped" style="table-layout: fixed">
|
||||
<thead>
|
||||
<tr>
|
||||
<th>Task</th>
|
||||
<th>Status</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
<tr id="row-banmigrate">
|
||||
<td>Migrate IP / Email Bans</td>
|
||||
<td><i id="spinner-banmigrate" class="fa fa-spinner"></i> <span id="span-banmigrate">Waiting...</span></td>
|
||||
</tr>
|
||||
</tbody>
|
||||
</table>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
@ -104,51 +117,8 @@ function printRow($version) {
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<script>
|
||||
processUpdates(<?php echo intval($startingVersion); ?>);
|
||||
</script>
|
||||
</body>
|
||||
</html>
|
||||
|
||||
<?php
|
||||
if ($startingVersion < 1) {
|
||||
echo '<script>startVersionUpgrade(\'p140\')</script>';
|
||||
//executePre140Scripts();
|
||||
echo '<script>markUpdateAsSuccess(\'p140\')</script>';
|
||||
}
|
||||
if ($startingVersion < 140) {
|
||||
echo '<script>startVersionUpgrade(\'140\')</script>';
|
||||
//executePre140Scripts();
|
||||
echo '<script>markUpdateAsSuccess(\'140\')</script>';
|
||||
}
|
||||
if ($startingVersion < 141) {
|
||||
echo '<script>startVersionUpgrade(\'141\')</script>';
|
||||
//execute141Scripts();
|
||||
echo '<script>markUpdateAsSuccess(\'141\')</script>';
|
||||
}
|
||||
if ($startingVersion < 150) {
|
||||
echo '<script>startVersionUpgrade(\'150\')</script>';
|
||||
//execute150Scripts();
|
||||
echo '<script>markUpdateAsSuccess(\'150\')</script>';
|
||||
}
|
||||
if ($startingVersion < 160) {
|
||||
echo '<script>startVersionUpgrade(\'160\')</script>';
|
||||
//execute160Scripts();
|
||||
echo '<script>markUpdateAsSuccess(\'160\')</script>';
|
||||
}
|
||||
if ($startingVersion < 161) {
|
||||
echo '<script>startVersionUpgrade(\'161\')</script>';
|
||||
//execute161Scripts();
|
||||
echo '<script>markUpdateAsSuccess(\'161\')</script>';
|
||||
}
|
||||
if ($startingVersion < 170) {
|
||||
echo '<script>startVersionUpgrade(\'170\')</script>';
|
||||
//execute170Scripts();
|
||||
//execute170FileUpdate();
|
||||
echo '<script>markUpdateAsSuccess(\'170\')</script>';
|
||||
}
|
||||
if ($startingVersion < 200) {
|
||||
echo '<script>startVersionUpgrade(\'200\')</script>';
|
||||
//execute200Scripts();
|
||||
//execute200FileUpdate();
|
||||
echo '<script>markUpdateAsSuccess(\'200\')</script>';
|
||||
//Echo completion message where the warning panel is.
|
||||
}
|
||||
?>
|
@ -1,6 +1,6 @@
|
||||
<?php
|
||||
define('IN_SCRIPT',1);
|
||||
define('HESK_PATH','../');
|
||||
define('HESK_PATH','../../');
|
||||
require(HESK_PATH . 'install/install_functions.inc.php');
|
||||
require(HESK_PATH . 'hesk_settings.inc.php');
|
||||
|
||||
@ -10,6 +10,6 @@ if ($updateSuccess) {
|
||||
?>
|
||||
|
||||
<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>
|
||||
<p>Please delete the <b>install</b> folder for security reasons, and then proceed back to the <a href="../../">Help Desk</a></p>
|
||||
|
||||
<?php } ?>
|
@ -1,6 +1,6 @@
|
||||
<?php
|
||||
define('IN_SCRIPT',1);
|
||||
define('HESK_PATH','../');
|
||||
define('HESK_PATH','../../');
|
||||
require(HESK_PATH . 'install/install_functions.inc.php');
|
||||
require(HESK_PATH . 'hesk_settings.inc.php');
|
||||
|
||||
@ -9,11 +9,11 @@ hesk_dbConnect();
|
||||
<html>
|
||||
<head>
|
||||
<title>Mods For HESK 2.0.0 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-theme.css?v=<?php echo $hesk_settings['hesk_version']; ?>" type="text/css" rel="stylesheet" />
|
||||
<link href="//netdna.bootstrapcdn.com/font-awesome/4.3.0/css/font-awesome.min.css" rel="stylesheet">
|
||||
<link href="../css/hesk_newStyle.php" type="text/css" rel="stylesheet" />
|
||||
<link href="../../css/hesk_newStyle.php" type="text/css" rel="stylesheet" />
|
||||
<script src="<?php echo HESK_PATH; ?>js/jquery-1.10.2.min.js"></script>
|
||||
<script language="Javascript" type="text/javascript" src="<?php echo HESK_PATH; ?>js/bootstrap.min.js"></script>
|
||||
<script language="Javascript" type="text/javascript" src="<?php echo HESK_PATH; ?>js/modsForHesk-javascript.js"></script>
|
@ -29,5 +29,5 @@ then click "Submit".</p>
|
||||
</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>
|
||||
<p>Please delete the <b>install</b> folder for security reasons, and then proceed back to the <a href="../../">Help Desk</a></p>
|
||||
<?php } ?>
|
@ -133,4 +133,59 @@ function appendToInstallConsole(text) {
|
||||
$('#console-text').append(text).append('<br>');
|
||||
}
|
||||
|
||||
function processUpdates(startingVersion) {
|
||||
if (startingVersion < 1) {
|
||||
startVersionUpgrade('p140');
|
||||
executeUpdate(1, 'p140');
|
||||
} else if (startingVersion < 140) {
|
||||
startVersionUpgrade('140');
|
||||
executeUpdate(140, '140');
|
||||
} else if (startingVersion < 141) {
|
||||
startVersionUpgrade('141');
|
||||
executeUpdate(141, '141');
|
||||
} else if (startingVersion < 150) {
|
||||
startVersionUpgrade('150');
|
||||
executeUpdate(150, '150');
|
||||
} else if (startingVersion < 160) {
|
||||
startVersionUpgrade('160');
|
||||
executeUpdate(160, '160');
|
||||
} else if (startingVersion < 161) {
|
||||
startVersionUpgrade('161');
|
||||
executeUpdate(161, '161');
|
||||
} else if (startingVersion < 170) {
|
||||
startVersionUpgrade('170');
|
||||
executeUpdate(170, '170');
|
||||
} else if (startingVersion < 200) {
|
||||
startVersionUpgrade('200');
|
||||
executeUpdate(200, '200');
|
||||
}
|
||||
}
|
||||
|
||||
function executeUpdate(version, cssclass) {
|
||||
$.ajax({
|
||||
type: 'POST',
|
||||
url: 'ajax/database-ajax.php',
|
||||
data: { version: version },
|
||||
success: function() {
|
||||
appendToInstallConsole('Version: ' + version);
|
||||
console.log('Version: ' + version);
|
||||
markUpdateAsSuccess(cssclass);
|
||||
if (version == 200) {
|
||||
//go to ipbanmigration
|
||||
appendToInstallConsole('Going to IP/Email Ban Migration...');
|
||||
console.log('Going to IP/Email Ban Migration...');
|
||||
}
|
||||
processUpdates(version);
|
||||
},
|
||||
error: function() {
|
||||
markUpdateAsFailure(cssclass);
|
||||
console.error('ERROR!');
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
function migrateIpEmailBans() {
|
||||
|
||||
}
|
||||
|
||||
jQuery(document).ready(loadJquery);
|
||||
|
Loading…
x
Reference in New Issue
Block a user