forked from glpunzi/nuBuilderPro
-
Notifications
You must be signed in to change notification settings - Fork 0
/
nuinstall.php
157 lines (128 loc) · 5.79 KB
/
nuinstall.php
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
<?php
require_once("config.php");
require_once("nuinstall_lib.php");
session_start();
$_SESSION['DBHost'] = $nuConfigDBHost;
$_SESSION['DBName'] = $nuConfigDBName;
$_SESSION['DBUser'] = $nuConfigDBUser;
$_SESSION['DBPassword'] = $nuConfigDBPassword;
$_SESSION['DBGlobeadminPassword'] = $nuConfigDBGlobeadminPassword;
$_SESSION['title'] = $nuConfigtitle;
$template = new nuinstall();
$template->setDB($_SESSION['DBHost'], $_SESSION['DBName'], $_SESSION['DBUser'], $_SESSION['DBPassword']);
$template->checkInstall();
?>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd">
<html>
<head>
<meta http-equiv='Content-type' content='text/html;charset=UTF-8'>
<meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=0" />
<meta name="apple-mobile-web-app-capable" content="yes" />
<title>nuBuilder</title>
<style>
.nuShadeHolder {border-bottom-left-radius:5px;border-bottom-right-radius:5px;border-top-right-radius:5px;border-top-left-radius:5px;box-shadow: 5px 5px 5px #888888;position:absolute;top:70px;left:0px;margin:auto;
width:auto; height:auto}
</style>
<body bgcolor="#CCCCCC">
<div class="nuShadeHolder" style="width: 500px; height: 300px; top: 15px; left: 15px; border: 1px solid grey; position: absolute; background-color: rgb(255, 255, 255);">
<span style="top: 15px; left: 20px; text-align: center; font-size: 25px; font-family: sans-serif; position: absolute; background-color: rgb(255, 255, 255);">
<strong><span style="color: #78C13A; text-shadow: 1px 1px #D0D7D1;">nu</span><span style="color: #03AAE9; text-shadow: 1px 1px #D0D7D1;">Builder</span></strong><strong><span style="color: #FB0003; text-shadow: 1px 1px #D0D7D1;"><i>Pro</i></span></strong>
</span>
<span style="top: 55px; left: 20px; text-align: left; font-size: 15px; font-family: sans-serif; position: absolute; background-color: rgb(255, 255, 255);">
<?php if ( $template->initResult != 'CANNOT_CONNECT_TO_SERVER' && $template->initResult != 'DATABASE_NOT_CREATED' ) { ?>
<h3>Schema Installer / Upgrader</h3>
<form method="POST" action="nuinstall.php">
<table>
<tr>
<td>Globeadmin Password</td> <td><input type="password" name="pwd"></td>
</tr>
<?php if ( $template->initResult != 'SCHEMA_INCOMPLETE' ) { ?>
<tr>
<td>Override Setup Table</td>
<td>
<select name="overrideSetup">
<option value="n" SELECTED>No</option>
<option value="y">Yes</option>
</select>
</td>
</tr>
<tr>
<td>Drop columns not used by nuBuilder</td>
<td>
<select name="dropColumns">
<option value="n">No</option>
<option value="y" SELECTED>Yes</option>
</select>
</td>
</tr>
<tr>
<td>Drop indexes not used by nuBuilder</td>
<td>
<select name="dropIndexes">
<option value="n">No</option>
<option value="y" SELECTED>Yes</option>
</select>
</td>
</tr>
<?php } ?>
<tr>
<td>Show full output</td>
<td>
<select name="showAll">
<option value="n" SELECTED>No</option>
<option value="y">Yes</option>
</select>
</td>
</tr>
</table>
</span>
<input type="submit" value="Run" style="width: 60px; height: 35px; top: 150px; left: 350px; position: absolute; border-top-left-radius: 5px; border-top-right-radius: 5px; border-bottom-right-radius: 5px; border-bottom-left-radius: 5px; font-size: 22px; line-height: 22px; background-color: rgb(212, 206, 230);">
</form>
<?php } else { ?>
It appears your database server is not configured, <br>please enter a mysql database name, user name<br> and password into your config.php file.
<?php } ?>
</div>
<?php
if ( isset($_POST['pwd']) && $_POST['pwd'] != $_SESSION['DBGlobeadminPassword'] ) {
echo "<div class=\"nuShadeHolder\" style=\"width: 500px; height: 40px; top: 330px; left: 15px; border: 1px solid grey; position: absolute; background-color: rgb(255, 255, 255);\">";
echo "<span style=\"top: 10px; left: 20px; text-align: left; font-size: 15px; font-family: sans-serif; position: absolute; background-color: rgb(255, 255, 255);\">";
echo "Globadmin password incorrect";
echo "</span>";
echo "</div>";
}
if ( isset($_POST['pwd']) && $_POST['pwd'] == $_SESSION['DBGlobeadminPassword'] ) {
$template = new nuinstall();
$template->setDB($_SESSION['DBHost'], $_SESSION['DBName'], $_SESSION['DBUser'], $_SESSION['DBPassword']);
$template->checkInstall();
if ( $_POST['overrideSetup'] == "y" ) {
$template->overrideSetup = true;
}
if ( $_POST['dropColumns'] == "y" ) {
$template->removeColumns = true;
}
if ( $_POST['dropIndexes'] == "y" ) {
$template->removeIndexes = true;
}
$template->run();
$height = '600px';
$width = '500px';
if ( $_POST['showAll'] == "y" ) {
$height = '1100px';
$width = '900px';
}
echo "<div style=\"width: $width; height: $height; top: 330px; left: 15px; position: absolute; background-color: #CCCCCC;\">";
echo "<span style=\"top: 10px; left: 20px; text-align: left; font-size: 15px; font-family: sans-serif; position: absolute; background-color: #CCCCCC;\">";
echo "Done! <br>";
$template->showChangeSummary();
$template->showSQLerrors();
$template->showWarnings();
if ( $_POST['showAll'] == "y" ) {
echo "<h4>Full Output:</h4>";
$template->showContent();
}
echo "</span>";
echo "</div>";
}
?>
</body>
</html>