Skip to content

Commit e48b172

Browse files
committed
updates to installercli and bump of version info
1 parent 9447687 commit e48b172

File tree

5 files changed

+35
-48
lines changed

5 files changed

+35
-48
lines changed

README.md

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,15 @@ network attributes such as DNS names, IP addresses, Subnets, MAC addresses
66
just to name a few. Through the use of plugins you can add extended it's
77
functionality.
88

9+
---
10+
**Recent Changes**
11+
12+
It's been too many years since the last official version! This update is to fix a few incompatibilities with newer PHP, MYSQL and OS versions. Fundamentally not much has changed. For those interested I have been playing with a new [ona-core project](https://github.com/opennetadmin/ona-core) that is the beginnings of a true RESTful API interface. These changes should allow ONA to continue working on newer systems while the new core, and GUI is completed.
13+
14+
Thanks for your interest in OpenNetAdmin!
15+
16+
---
17+
918
Each host or subnet can be tracked via a centralized AJAX enabled web interface
1019
that can help reduce errors. A full [CLI interface](https://github.com/opennetadmin/dcm) is available
1120
as well to use for scripting and bulk work. We hope to provide a useful

VERSION

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
v13.03.01
1+
v17.12.22

install/installcli.php

Lines changed: 19 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -91,12 +91,10 @@
9191
// License info
9292
echo "ONA is licensed under GPL v2.0.\n";
9393
$showlicense = promptUser("Would you like to view license? [y/N] ", 'n');
94-
if ($showlicense == 'y') { system("more -80 {$base}/../docs/LICENSE"); }
95-
// TODO: Do you agree to the license
96-
97-
#while(empty($name)){
98-
# $name = promptUser(" Enter server name");
99-
#}
94+
if ($showlicense == 'y') {
95+
system("more -80 {$base}/../docs/LICENSE");
96+
promptUser("[Press Enter To Continue]");
97+
}
10098

10199
check_requirements();
102100

@@ -118,7 +116,7 @@
118116
// Gather requirement information
119117
function check_requirements() {
120118

121-
global $onabase;
119+
global $conf,$onabase;
122120

123121
system('clear');
124122
// Get some pre-requisite information
@@ -129,6 +127,7 @@ function check_requirements() {
129127
$hasxml = function_exists( 'xml_parser_create' ) ? 'PASS' : 'FAIL';
130128
$hasmbstring = function_exists( 'mb_internal_encoding' ) ? 'PASS' : 'FAIL';
131129
$dbconfwrite = @is_writable($onabase.'/www/local/config/') ? 'PASS' : 'FAIL';
130+
$logfilewrite = @is_writable($conf['logfile']) ? 'PASS' : 'FAIL';
132131

133132
echo <<<EOL
134133
@@ -140,6 +139,7 @@ function check_requirements() {
140139
PHP mysqli function: $hasmysql
141140
PHP mbstring function: $hasmbstring
142141
$onabase/www/local/config dir writable: $dbconfwrite
142+
{$conf['logfile']} writable: $logfilewrite
143143
144144
EOL;
145145
}
@@ -197,19 +197,19 @@ function upgrade() {
197197
@$db->Close();
198198

199199

200-
$text .= "{$cname} {$cdbs['db_type']} {$cdbs['db_host']} {$cdbs['db_database']} {$curr_ver} {$levelinfo}\n";
200+
$text .= "{$cname} {$cdbs['db_type']} {$cdbs['db_host']} {$cdbs['db_database']} {$curr_ver} {$levelinfo}\n";
201201
}
202202

203203
}
204204

205205

206206
if ($status == 0) {
207207
echo $text."\n";
208-
$upgrade = promptUser("Perform the upgrade? ", 'N');
208+
$upgrade = promptUser("Perform the upgrade? ", 'y/N');
209209
$text = '';
210210
} else {
211211
$text .= <<<EOL
212-
There was an error determining database context versions. Please correct them before proceeding.<br><br>Check that the content of your database configuration file:<br> '<i>{$dbconffile}</i>'<br>is accurate and that the databases themselves are configured properly.<br><br>{$err_txt}</div><br>
212+
There was an error determining database context versions. Please correct them before proceeding. \n\nCheck that the content of your database configuration file '{$dbconffile}' is accurate and that the databases themselves are configured properly.\n\n{$err_txt}\n
213213
EOL;
214214
}
215215

@@ -219,7 +219,7 @@ function upgrade() {
219219
$dbtype = 'mysqli'; $adotype = $dbtype;
220220

221221
// If they have selected to keep the tables then remove the run_install file
222-
if ($upgrade == 'Y') {
222+
if ($upgrade == 'Y' or $upgrade == 'y') {
223223

224224
// Loop through each context and upgrade the Databases within
225225
foreach(array_keys($ona_contexts) as $cname) {
@@ -252,14 +252,15 @@ function upgrade() {
252252
$schema = new adoSchema( $db );
253253
// Build the SQL array from the schema XML file
254254
$sql = $schema->ParseSchema($xmlfile_tables);
255+
// Uncomment the following to display the raw SQL
256+
#$text .= "----------\n".$schema->PrintSQL('TEXT')."\n---------\n";
255257
// Execute the SQL on the database
256-
//$text .= $schema->PrintSQL('TEXT')."\n";
257258
if ($schema->ExecuteSchema( $sql ) == 2) {
258259
$text .= "[{$cname}/{$cdbs['db_host']}] Upgrading tables within database '{$cdbs['db_database']}'.\n";
259260
printmsg("INFO => [{$cname}/{$cdbs['db_host']}] Upgrading tables within database: {$cdbs['db_database']}",0);
260261
} else {
261262
$status++;
262-
$text .= "<img src=\"{$images}/silk/exclamation.png\" border=\"0\" /> There was an error upgrading tables.<br><span style='font-size: xx-small;'>".$db->ErrorMsg()."</span><br>";
263+
$text .= "There was an error upgrading tables. ERROR: ".$db->ErrorMsg()."\n";
263264
printmsg("ERROR => There was an error processing tables: ".$db->ErrorMsg(),0);
264265
break;
265266
}
@@ -295,7 +296,6 @@ function upgrade() {
295296
// Execute the SQL on the database
296297
if ($schema->ExecuteSchema( $sql ) == 2) {
297298
$text .= "[{$cname}/{$cdbs['db_host']}] Processed XML update file.\n";
298-
printmsg("INFO => [{$cname}/{$cdbs['db_host']}] Processed XML update file.",0);
299299

300300
// update index info in the DB
301301
$text .= "[{$cname}/{$cdbs['db_host']}] Upgraded from index {$upgrade_index} to {$new_index}.\n";
@@ -311,7 +311,7 @@ function upgrade() {
311311
$upgrade_index++;
312312
} else {
313313
$status++;
314-
$text .= "[{$cname}/{$cdbs['db_host']}] Failed to process XML update file.<br><span style='font-size: xx-small;'>".$db->ErrorMsg()."</span>\n";
314+
$text .= "[{$cname}/{$cdbs['db_host']}] Failed to process XML update file.\n".$db->ErrorMsg()."\n";
315315
printmsg("ERROR => [{$cname}/{$cdbs['db_host']}] Failed to process XML update file. ".$db->ErrorMsg(),0);
316316
break;
317317
}
@@ -360,18 +360,17 @@ function upgrade() {
360360
fwrite($fh, "<?php\n\n\$ona_contexts=".var_export($ona_contexts,TRUE).";\n\n?>");
361361
fclose($fh);
362362
$text .= "Upgraded database connection config file to new format.\n";
363-
printmsg("INFO => Upgraded database connection config file to new format.",0);
364363
}
365364
}
366365

367366

368367
if($status == 0) {
369368
$text .= $script_text;
370-
$text .= "You can now <a href='".parse_url($_SERVER['REQUEST_URI'],PHP_URL_PATH)."'>CLICK HERE</a> to start using OpenNetAdmin! Enjoy!";
369+
$text .= "Upgrade complete, you may start using OpenNetAdmin! Enjoy!\n";
371370

372371
if (@file_exists($runinstall)) {
373372
if (!@unlink($runinstall)) {
374-
$text .= "Failed to delete the file '{$runinstall}'.\n";
373+
$text .= "Buuut.. Failed to delete the file '{$runinstall}'.\n";
375374
$text .= "Please remove '{$runinstall}' manually.\n";
376375
}
377376
}
@@ -428,7 +427,6 @@ function new_install() {
428427
if (!$db->IsConnected()) {
429428
$status++;
430429
$text .= "Failed to connect to '{$database_host}' as '{$admin_login}'.\n".$db->ErrorMsg()."\n";
431-
printmsg("INFO => Unable to connect to server '$database_host'. ".$db->ErrorMsg(),0);
432430
} else {
433431
$text .= "Connected to '{$database_host}' as '{$admin_login}'.\n";
434432

@@ -486,7 +484,8 @@ function new_install() {
486484
$schema = new adoSchema( $db );
487485
// Build the SQL array from the schema XML file
488486
$sql = $schema->ParseSchema($xmlfile_data);
489-
/////$text .= $schema->PrintSQL('TEXT');
487+
// Uncomment the following to display the raw SQL
488+
#$text .= "----------\n".$schema->PrintSQL('TEXT')."\n---------\n";
490489
// Execute the SQL on the database
491490
if ($schema->ExecuteSchema( $sql ) == 2) {
492491
$text .= "Loaded tables with default data.\n";

www/winc/app_about.inc.php

Lines changed: 4 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@
2525
2626
<tr>
2727
<td colspan="2" align="center" class="padding" style="font-weight: bold;">
28-
<br><u>&copy; {$year} OpenNetAdmin - {$conf['version']}</u>
28+
<u>&copy; {$year} OpenNetAdmin - {$conf['version']}</u>
2929
</td>
3030
</tr>
3131
@@ -40,19 +40,10 @@
4040
4141
<tr>
4242
<td align="right" valign="top" class="padding" style="font-weight: bold;">
43-
Bugs/Tickets:
43+
Issues/Discussion:
4444
</td>
4545
<td align="left" rowspan="1" class="padding">
46-
<a href="http://opennetadmin.com/bugs/">http://opennetadmin.com/bugs</a>
47-
</td>
48-
</tr>
49-
50-
<tr>
51-
<td align="right" valign="top" class="padding" style="font-weight: bold;">
52-
Forum:
53-
</td>
54-
<td align="left" rowspan="1" class="padding">
55-
<a href="http://opennetadmin.com/forum/">http://opennetadmin.com/forum</a>
46+
<a href="https://github.com/opennetadmin/ona/issues">https://github.com/opennetadmin/ona/issues</a>
5647
</td>
5748
</tr>
5849
@@ -83,10 +74,6 @@
8374
</td>
8475
</tr>
8576
86-
<tr>
87-
<br>
88-
</tr>
89-
9077
</table>
9178
9279
@@ -96,4 +83,4 @@
9683

9784

9885

99-
?>
86+
?>

www/winc/menu_control.inc.php

Lines changed: 2 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -145,14 +145,6 @@ function get_html_menu_button_ona() {
145145
><img style="vertical-align: middle;" src="{$images}/silk/user_gray.png" border="0"
146146
/>&nbsp;User info/Change password</div>
147147
148-
<div class="row"
149-
onMouseOver="this.className='hovered';"
150-
onMouseOut="this.className='row';"
151-
onClick="ona_menu_closedown(); window.location.href = 'http://opennetadmin.com/forum/';"
152-
title="Participate in our forums"
153-
><img style="vertical-align: middle;" src="{$images}/silk/comments.png" border="0"
154-
/>&nbsp;Discussion forums</div>
155-
156148
<div class="row"
157149
onMouseOver="this.className='hovered';"
158150
onMouseOut="this.className='row';"
@@ -164,10 +156,10 @@ function get_html_menu_button_ona() {
164156
<div class="row"
165157
onMouseOver="this.className='hovered';"
166158
onMouseOut="this.className='row';"
167-
onClick="ona_menu_closedown(); window.location.href = 'http://opennetadmin.com/bugs/';"
159+
onClick="ona_menu_closedown(); window.location.href = 'https://github.com/opennetadmin/ona/issues';"
168160
title="File a bug report or feature request"
169161
><img style="vertical-align: middle;" src="{$images}/silk/bug.png" border="0"
170-
/>&nbsp;File a bug/feature</div>
162+
/>&nbsp;Issues & Discussion</div>
171163
172164
<div class="row"
173165
onMouseOver="this.className='hovered';"

0 commit comments

Comments
 (0)