Skip to content

Commit ce7babd

Browse files
authored
Merge pull request #120 from opennetadmin/develop
Develop
2 parents eba2c7a + d295d22 commit ce7babd

File tree

100 files changed

+756
-248
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

100 files changed

+756
-248
lines changed

install/1-to-2.sql

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ CREATE TABLE `locations` (
1111
`zip_code` int(5) unsigned NOT NULL,
1212
`latitude` varchar(20) NOT NULL,
1313
`longitude` varchar(20) NOT NULL,
14-
`misc` varchar(256) NOT NULL COMMENT 'Misc info, site contacts, phone numbers etc.',
14+
`misc` varchar(191) NOT NULL COMMENT 'Misc info, site contacts, phone numbers etc.',
1515
PRIMARY KEY (`id`)
1616
) ENGINE=InnoDB DEFAULT CHARSET=latin1 COMMENT='This table needs re-worked';
1717

install/install.php

Lines changed: 5 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,7 @@
11
<?php
2+
// MP: Since we know ONA will generate a ton of notice level errors, lets turn them off here
3+
error_reporting (E_ALL ^ E_NOTICE);
4+
25
// get adodb xml processing
36
require_once($conf['inc_adodb_xml']);
47

@@ -218,12 +221,8 @@
218221
foreach($ona_contexts[$cname]['databases'] as $cdbs) {
219222
printmsg("INFO => [{$cname}/{$cdbs['db_host']}] Performing an upgrade.",0);
220223

221-
// switch from mysqlt to mysql becuase of adodb problems with innodb and opt stuff when doing xml
222-
$adotype = $cdbs['db_type'];
223-
//if ($adotype == 'mysqlt') $adotype = 'mysql';
224-
225224
// Make an initial connection to a DB server without specifying a database
226-
$db = ADONewConnection($adotype);
225+
$db = ADONewConnection($cdbs['db_type']);
227226
@$db->NConnect( $cdbs['db_host'], $cdbs['db_login'], $cdbs['db_passwd'], '' );
228227

229228
if (!$db->IsConnected()) {
@@ -232,21 +231,14 @@
232231
$text .= " <img src=\"{$images}/silk/exclamation.png\" border=\"0\" /> [{$cname}] Failed to connect to '{$cdbs['db_host']}' as '{$cdbs['db_login']}'.<br><span style='font-size: xx-small;'>".$db->ErrorMsg()."</span><br>";
233232
} else {
234233
$db->Close();
235-
if ($db->NConnect( $database_host, $admin_login, $admin_passwd, $cdbs['db_database'])) {
234+
if ($db->NConnect( $database_host, $cdbs['db_login'], $cdbs['db_passwd'], $cdbs['db_database'])) {
236235

237236

238237
// Get the current upgrade index if there is one.
239238
$rs = $db->Execute("SELECT value FROM sys_config WHERE name like 'upgrade_index'");
240239
$array = $rs->FetchRow();
241240
$upgrade_index = $array['value'];
242241

243-
if ($upgrade_index < 8) {
244-
$status++;
245-
$text .= "<img src=\"{$images}/silk/exclamation.png\" border=\"0\" /> [{$cname}/{$cdbs['db_host']}] This database must be on at least v09.09.15 before upgrading to this version.<br>";
246-
printmsg("ERROR => [{$cname}/{$cdbs['db_host']}] This database must be on at least v09.09.15 before upgrading to this version.",0);
247-
break;
248-
}
249-
250242
$text .= "<img src=\"{$images}/silk/accept.png\" border=\"0\" /> [{$cname}/{$cdbs['db_host']}] Keeping your original data.<br>";
251243

252244
// update existing tables in our database to match our baseline xml schema

install/installcli.php

Lines changed: 8 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -190,7 +190,7 @@ function upgrade() {
190190
if ($upgrade_index < 8) { $levelinfo = "Must upgrade to at least v09.09.15 first!\n"; }
191191
} else {
192192
$status++;
193-
$text .= " [{$cname}] Failed to select DB '{$cdbs['db_database']}'. ERROR: ".$db->ErrorMsg();
193+
$text .= "[{$cname}] Failed to select DB '{$cdbs['db_database']}'. ERROR: ".$db->ErrorMsg()."\n";
194194
}
195195
}
196196
// Close the database connection
@@ -237,7 +237,7 @@ function upgrade() {
237237
$text .= " [{$cname}] Failed to connect to '{$cdbs['db_host']}' as '{$cdbs['db_login']}'. ERROR: ".$db->ErrorMsg()."\n";
238238
} else {
239239
$db->Close();
240-
if ($db->NConnect( $database_host, $admin_login, $admin_passwd, $cdbs['db_database'])) {
240+
if ($db->NConnect( $database_host, $cdbs['db_login'], $cdbs['db_passwd'], $cdbs['db_database'])) {
241241

242242

243243
// Get the current upgrade index if there is one.
@@ -335,7 +335,7 @@ function upgrade() {
335335
}
336336
} else {
337337
$status++;
338-
$text .= "[{$cname}/{$cdbs['db_host']}] Failed to select DB '{$cdbs['db_database']}'.<br><span style='font-size: xx-small;'>".$db->ErrorMsg()."</span><br>";
338+
$text .= "[{$cname}] Failed to select DB '{$cdbs['db_database']}'. ERROR: ".$db->ErrorMsg()."\n";
339339
}
340340
}
341341
// Close the database connection
@@ -392,10 +392,10 @@ function upgrade() {
392392
function new_install() {
393393

394394
echo "\n\n";
395-
global $text,$xmlfile_data,$xmlfile_tables,$dbconffile;
395+
global $new_ver,$text,$xmlfile_data,$xmlfile_tables,$dbconffile;
396396

397397
// Gather info
398-
$dbtype = 'mysqli'; $adotype = $dbtype;
398+
$adotype = 'mysqli';
399399
$database_host = promptUser("Database host? ", 'localhost');
400400
$admin_login = promptUser("Database admin? ", 'root');
401401
$admin_passwd = promptUser("Database admin password? ", '');
@@ -410,7 +410,7 @@ function new_install() {
410410

411411
// set up initial context connection information
412412
$context_name = 'DEFAULT';
413-
$ona_contexts[$context_name]['databases']['0']['db_type'] = $dbtype;
413+
$ona_contexts[$context_name]['databases']['0']['db_type'] = $adotype;
414414
$ona_contexts[$context_name]['databases']['0']['db_host'] = $database_host;
415415
$ona_contexts[$context_name]['databases']['0']['db_login'] = $sys_login;
416416
$ona_contexts[$context_name]['databases']['0']['db_passwd'] = $sys_passwd;
@@ -422,6 +422,7 @@ function new_install() {
422422

423423
// Make an initial connection to a DB server without specifying a database
424424
$db = ADONewConnection($adotype);
425+
$db->charSet = 'utf8';
425426
$db->NConnect( $database_host, $admin_login, $admin_passwd, '' );
426427

427428
if (!$db->IsConnected()) {
@@ -554,7 +555,7 @@ function new_install() {
554555

555556
// Update the version element in the sys_config table
556557
if(@$db->Execute("UPDATE sys_config SET value='{$new_ver}' WHERE name like 'version'")) {
557-
// $text .= "<img src=\"{$images}/silk/accept.png\" border=\"0\" /> Updated local version info.<br>";
558+
$text .= "Updated local version info.\n";
558559
}
559560
else {
560561
$status++;

install/ona-table_schema.xml

Lines changed: 23 additions & 30 deletions
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@
2222
<field name="name" type="C" size="63">
2323
<NOTNULL/>
2424
</field>
25-
<field name="notes" type="C" size="255">
25+
<field name="notes" type="C" size="191">
2626
<NOTNULL/>
2727
</field>
2828
</table>
@@ -117,7 +117,7 @@
117117
<field name="name" type="C" size="128">
118118
<KEY/>
119119
</field>
120-
<field name="description" type="C" size="255">
120+
<field name="description" type="C" size="191">
121121
<NOTNULL/>
122122
</field>
123123
<field name="file" type="C" size="128">
@@ -158,8 +158,8 @@
158158
<field name="primary_host_id" type="I" size="10">
159159
<NOTNULL/>
160160
</field>
161-
<field name="asset_tag" type="C" size="255"/>
162-
<field name="serial_number" type="C" size="255"/>
161+
<field name="asset_tag" type="C" size="191"/>
162+
<field name="serial_number" type="C" size="191"/>
163163
</table>
164164

165165

@@ -349,7 +349,7 @@
349349
<NOTNULL/>
350350
<UNSIGNED/>
351351
</field>
352-
<field name="name" type="C" size="255">
352+
<field name="name" type="C" size="191">
353353
<NOTNULL/>
354354
</field>
355355
<field name="ebegin" type="T">
@@ -363,7 +363,7 @@
363363
<NOTNULL/>
364364
<UNSIGNED/>
365365
</field>
366-
<field name="txt" type="C" size="255">
366+
<field name="txt" type="C" size="191">
367367
<NOTNULL/>
368368
</field>
369369
<field name="srv_pri" type="I" size="5">
@@ -405,9 +405,6 @@
405405
<field name="role" type="C" size="10">
406406
<NOTNULL/>
407407
</field>
408-
<field name="type" type="C" size="10">
409-
<NOTNULL/>
410-
</field>
411408
<field name="rebuild_flag" type="I" size="1">
412409
<NOTNULL/>
413410
</field>
@@ -419,10 +416,10 @@
419416
<KEY/>
420417
<UNSIGNED/>
421418
</field>
422-
<field name="name" type="C" size="255">
419+
<field name="name" type="C" size="191">
423420
<NOTNULL/>
424421
</field>
425-
<field name="description" type="C" size="255">
422+
<field name="description" type="C" size="191">
426423
<NOTNULL/>
427424
</field>
428425
</table>
@@ -468,13 +465,13 @@
468465
<NOTNULL/>
469466
<UNSIGNED/>
470467
</field>
471-
<field name="primary_master" type="C" size="255">
468+
<field name="primary_master" type="C" size="191">
472469
<NOTNULL/>
473470
</field>
474-
<field name="admin_email" type="C" size="255">
471+
<field name="admin_email" type="C" size="191">
475472
<NOTNULL/>
476473
</field>
477-
<field name="name" type="C" size="255">
474+
<field name="name" type="C" size="191">
478475
<NOTNULL/>
479476
</field>
480477
</table>
@@ -510,7 +507,7 @@
510507
<field name="name" type="C" size="32">
511508
<NOTNULL/>
512509
</field>
513-
<field name="description" type="C" size="255">
510+
<field name="description" type="C" size="191">
514511
<NOTNULL/>
515512
</field>
516513
<field name="level" type="I" size="4">
@@ -559,7 +556,7 @@
559556
<NOTNULL/>
560557
<UNSIGNED/>
561558
</field>
562-
<field name="notes" type="C" size="255">
559+
<field name="notes" type="C" size="191">
563560
<NOTNULL/>
564561
</field>
565562
</table>
@@ -575,7 +572,7 @@
575572
<KEY/>
576573
<UNSIGNED/>
577574
</field>
578-
<field name="name" type="C" size="255">
575+
<field name="name" type="C" size="191">
579576
<NOTNULL/>
580577
</field>
581578
</table>
@@ -607,10 +604,10 @@
607604
<field name="mac_addr" type="C" size="12">
608605
<NOTNULL/>
609606
</field>
610-
<field name="name" type="C" size="255">
607+
<field name="name" type="C" size="191">
611608
<NOTNULL/>
612609
</field>
613-
<field name="description" type="C" size="255"/>
610+
<field name="description" type="C" size="191"/>
614611
<field name="last_response" type="T"/>
615612
</table>
616613

@@ -646,7 +643,7 @@
646643
<field name="longitude" type="C" size="20">
647644
<NOTNULL/>
648645
</field>
649-
<field name="misc" type="C" size="256">
646+
<field name="misc" type="C" size="191">
650647
<NOTNULL/>
651648
</field>
652649
</table>
@@ -658,7 +655,7 @@
658655
<KEY/>
659656
<UNSIGNED/>
660657
</field>
661-
<field name="name" type="C" size="255">
658+
<field name="name" type="C" size="191">
662659
<NOTNULL/>
663660
</field>
664661
<index name="name">
@@ -717,10 +714,10 @@
717714
<NOTNULL/>
718715
<UNSIGNED/>
719716
</field>
720-
<field name="name" type="C" size="255">
717+
<field name="name" type="C" size="191">
721718
<NOTNULL/>
722719
</field>
723-
<field name="snmp_sysobjectid" type="C" size="255">
720+
<field name="snmp_sysobjectid" type="C" size="191">
724721
<NOTNULL/>
725722
</field>
726723
</table>
@@ -787,7 +784,7 @@
787784
<field name="name" type="C" size="32">
788785
<NOTNULL/>
789786
</field>
790-
<field name="description" type="C" size="255">
787+
<field name="description" type="C" size="191">
791788
<NOTNULL/>
792789
</field>
793790
<index name="name">
@@ -852,7 +849,7 @@
852849
<field name="display_name" type="C" size="63">
853850
<NOTNULL/>
854851
</field>
855-
<field name="notes" type="C" size="255">
852+
<field name="notes" type="C" size="191">
856853
<NOTNULL/>
857854
</field>
858855
</table>
@@ -864,10 +861,6 @@
864861
<KEY/>
865862
<UNSIGNED/>
866863
</field>
867-
<field name="network_role_id" type="I" size="10">
868-
<NOTNULL/>
869-
<UNSIGNED/>
870-
</field>
871864
<field name="subnet_type_id" type="I" size="10">
872865
<NOTNULL/>
873866
<UNSIGNED/>
@@ -895,7 +888,7 @@
895888
<field name="name" type="C" size="128">
896889
<KEY/>
897890
</field>
898-
<field name="value" type="C" size="256">
891+
<field name="value" type="C" size="191">
899892
<NOTNULL/>
900893
</field>
901894
<field name="description" type="C" size="512">

www/include/adodb5/adodb-active-record.inc.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
<?php
22
/*
33
4-
@version v5.20.4 30-Mar-2016
4+
@version v5.20.9 21-Dec-2016
55
@copyright (c) 2000-2013 John Lim (jlim#natsoft.com). All rights reserved.
66
@copyright (c) 2014 Damien Regad, Mark Newnham and the ADOdb community
77
Latest version is available at http://adodb.sourceforge.net

www/include/adodb5/adodb-active-recordx.inc.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
<?php
22
/*
33
4-
@version v5.20.4 30-Mar-2016
4+
@version v5.20.9 21-Dec-2016
55
@copyright (c) 2000-2013 John Lim (jlim#natsoft.com). All rights reserved.
66
@copyright (c) 2014 Damien Regad, Mark Newnham and the ADOdb community
77
Latest version is available at http://adodb.sourceforge.net

www/include/adodb5/adodb-csvlib.inc.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88

99
/*
1010
11-
@version v5.20.4 30-Mar-2016
11+
@version v5.20.9 21-Dec-2016
1212
@copyright (c) 2000-2013 John Lim (jlim#natsoft.com). All rights reserved.
1313
@copyright (c) 2014 Damien Regad, Mark Newnham and the ADOdb community
1414
Released under both BSD license and Lesser GPL library license.

www/include/adodb5/adodb-datadict.inc.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
<?php
22

33
/**
4-
@version v5.20.4 30-Mar-2016
4+
@version v5.20.9 21-Dec-2016
55
@copyright (c) 2000-2013 John Lim (jlim#natsoft.com). All rights reserved.
66
@copyright (c) 2014 Damien Regad, Mark Newnham and the ADOdb community
77
Released under both BSD license and Lesser GPL library license.

www/include/adodb5/adodb-error.inc.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
<?php
22
/**
3-
* @version v5.20.4 30-Mar-2016
3+
* @version v5.20.9 21-Dec-2016
44
* @copyright (c) 2000-2013 John Lim (jlim#natsoft.com). All rights reserved.
55
* @copyright (c) 2014 Damien Regad, Mark Newnham and the ADOdb community
66
* Released under both BSD license and Lesser GPL library license.

www/include/adodb5/adodb-errorhandler.inc.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
<?php
22
/**
3-
* @version v5.20.4 30-Mar-2016
3+
* @version v5.20.9 21-Dec-2016
44
* @copyright (c) 2000-2013 John Lim (jlim#natsoft.com). All rights reserved.
55
* @copyright (c) 2014 Damien Regad, Mark Newnham and the ADOdb community
66
* Released under both BSD license and Lesser GPL library license.

0 commit comments

Comments
 (0)