racktables
8 weeks agoadd SNMP support for HP Switches (GH #252)
Sergey Rychka [Wed, 20 Feb 2019 00:01:52 +0000 (03:01 +0300)] 
add SNMP support for HP Switches (GH #252)

add SNMP support for Hp Procurve 5406zl  (Mantis#1485)
add SNMP support for HP A5120-24G (Mantis#1257)
add SNMP support for HP V1910-48G Switch JE009A (Mantis#1193)
add SNMP support for HP Procurve 2900 (Mantis#689)

8 weeks agogit-commit: remove unnecessary backticks
Denis Ovsienko [Mon, 18 Feb 2019 21:38:58 +0000 (21:38 +0000)] 
git-commit: remove unnecessary backticks

[skip ci]

8 weeks agogit-commit: make a few variables readonly
Denis Ovsienko [Mon, 18 Feb 2019 21:35:56 +0000 (21:35 +0000)] 
git-commit: make a few variables readonly

[skip ci]

8 weeks agotests: disregard PHPUnit 8 for now
Denis Ovsienko [Mon, 18 Feb 2019 16:12:20 +0000 (16:12 +0000)] 
tests: disregard PHPUnit 8 for now

In Travis CI PHP 7.2 now comes with PHPUnit 8, which seems to require
rewriting the tests in a way that is not compatible with older PHPUnit
versions. Introduce SKIP_PHPUNIT into the Travis CI matrix to avoid
running PHPUnit 8 on PHP 7.2 until RackTables code is ready (and
potentially to prevent running older PHPUnit versions on older PHP
versions if the switch happens).

2 months agofixup the previous commits
Denis Ovsienko [Thu, 31 Jan 2019 23:50:30 +0000 (23:50 +0000)] 
fixup the previous commits

2 months agoUpdate snmp.php 251/head
Sergey Rychka [Thu, 31 Jan 2019 13:20:17 +0000 (16:20 +0300)] 
Update snmp.php

add SNMP support for Cisco Catalyst 3850-48T (Mantis#1169 and Mantis#1423)
add SNMP support for Cisco 871 (Mantis#1355)
add SNMP support for Cisco Catalyst Model WS-C3850-24T (Mantis#1701)
add SNMP support for Cisco Nexus 3064T (Mantis#1697)

2 months agoUpdate dictionary.php
Sergey Rychka [Thu, 31 Jan 2019 13:11:03 +0000 (16:11 +0300)] 
Update dictionary.php

add SNMP support for Cisco Catalyst 3850-48T (Mantis#1169 and Mantis#1423)
add SNMP support for Cisco 871 (Mantis#1355)
add SNMP support for Cisco Catalyst Model WS-C3850-24T (Mantis#1701)
add SNMP support for Cisco Nexus 3064T (Mantis#1697)

2 months agofunction ios15ShortenIfName_real added to handle port-channel interfaces names correc... 247/head
Vasilii Shashkov [Wed, 23 Jan 2019 06:04:08 +0000 (13:04 +0700)] 
function ios15ShortenIfName_real added to handle port-channel interfaces names correctly - ios15 does not support shorten "po" interface name in cli view

2 months agoupgrade CodeMirror from 5.42.2 to 5.43.0
Denis Ovsienko [Tue, 22 Jan 2019 22:18:07 +0000 (22:18 +0000)] 
upgrade CodeMirror from 5.42.2 to 5.43.0

[skip ci]

2 months agoremove more trailing spaces
Denis Ovsienko [Tue, 22 Jan 2019 22:14:43 +0000 (22:14 +0000)] 
remove more trailing spaces

* renderRackspace()
* snmp.php
* GetChildrenListTest.php
* LinkTriggerTest::setUpBeforeClass()
* StringInsertHrefsTest::setUpBeforeClass()

[skip ci]

2 months agoios15ReadLLDPStatus(): add a break for consistency
Denis Ovsienko [Tue, 22 Jan 2019 22:04:31 +0000 (22:04 +0000)] 
ios15ReadLLDPStatus(): add a break for consistency

[skip ci]

2 months agofixup more code style
Denis Ovsienko [Tue, 22 Jan 2019 22:01:31 +0000 (22:01 +0000)] 
fixup more code style

Put spacing right and do not use empty() to test for an empty string.

* hpprocurveN1178ReadLLDPStatus()
* hpprocurveN1178ReadInterfaceStatus()
* hpprocurveN1178ReadMacList()
* hpprocurveN1178Read8021QConfig()
* hpprocurveN1178TranslatePushQueue()

[skip ci]

2 months agofixup some code style
Denis Ovsienko [Tue, 22 Jan 2019 21:32:21 +0000 (21:32 +0000)] 
fixup some code style

Remove excess braces, put indentation right and simplify a few if's.

* hpprocurveN1178ReadLLDPStatus()
* hpprocurveN1178ReadInterfaceStatus()
* hpprocurveN1178ReadMacList()
* hpprocurveN1178Read8021QConfig()
* hpprocurveN1178TranslatePushQueue()

[skip ci]

2 months agogit-commit: say add/update in the default message
Denis Ovsienko [Tue, 22 Jan 2019 15:18:33 +0000 (15:18 +0000)] 
git-commit: say add/update in the default message

The script used to log "update <filename>" regardless if it was a new
file or a change to an existing file. To make it easier to follow the
history, have it log "add <filename>" in the former case. Replace a
long if() wrapper with an early return while at it.

[skip ci]

2 months agoUpdate regexp in func hpprocurveN1178Read8021QConfig to match Trk interfaces on HP...
igloo777 [Mon, 21 Jan 2019 14:24:12 +0000 (21:24 +0700)] 
Update regexp in func hpprocurveN1178Read8021QConfig to match Trk interfaces on HP Procurve (#245)

2 months agofixup the previous commit
Denis Ovsienko [Sun, 20 Jan 2019 00:49:31 +0000 (00:49 +0000)] 
fixup the previous commit

[skip ci]

2 months agoadd SNMP support for HP switches (GH #243)
Sergey Rychka [Sun, 20 Jan 2019 00:36:59 +0000 (03:36 +0300)] 
add SNMP support for HP switches (GH #243)

add SNMP support for HP 1810-24G (J9450A) (Mantis#1379)
add SNMP support for HP 1810-8G (J9449A) (Mantis#1377)
add SNMP support for HP 1810-24G v2 (J9803A) (Mantis#1285)

2 months agogit-commit: clarify the usage for -a and -d
Denis Ovsienko [Sat, 19 Jan 2019 19:05:11 +0000 (19:05 +0000)] 
git-commit: clarify the usage for -a and -d

[skip ci]

2 months agofixed typo for breed io15 in function queryTerminal
Vasilii Shashkov [Tue, 15 Jan 2019 07:50:30 +0000 (14:50 +0700)] 
fixed typo for breed io15 in function queryTerminal

3 months agotests: fixup the previous commit
Denis Ovsienko [Mon, 14 Jan 2019 22:29:21 +0000 (22:29 +0000)] 
tests: fixup the previous commit

3 months agotests: make the express test sequence safer
Denis Ovsienko [Mon, 14 Jan 2019 18:02:03 +0000 (18:02 +0000)] 
tests: make the express test sequence safer

3 months agogit-commit: try to clean up on a commit failure
Denis Ovsienko [Sun, 13 Jan 2019 22:02:58 +0000 (22:02 +0000)] 
git-commit: try to clean up on a commit failure

[skip ci]

3 months agogit-commit: factor print_error() out
Denis Ovsienko [Sun, 13 Jan 2019 20:46:49 +0000 (20:46 +0000)] 
git-commit: factor print_error() out

[skip ci]

3 months agogit-commit: add a check for FILEPATH
Denis Ovsienko [Sun, 13 Jan 2019 20:32:02 +0000 (20:32 +0000)] 
git-commit: add a check for FILEPATH

Test that the file is not outside of the repository directory. While at
it, move the non-empty check into git_commit_or_exit() as it actually
belongs there.

[skip ci]

3 months agogit-commit: add support for -M (replace|append)
Denis Ovsienko [Sun, 13 Jan 2019 19:25:01 +0000 (19:25 +0000)] 
git-commit: add support for -M (replace|append)

[skip ci]

3 months agogit-commit: fixup the help text for -u
Denis Ovsienko [Sun, 13 Jan 2019 00:33:56 +0000 (00:33 +0000)] 
git-commit: fixup the help text for -u

[skip ci]

3 months agogit-commit: print the usage text on -h only
Denis Ovsienko [Thu, 10 Jan 2019 23:27:01 +0000 (23:27 +0000)] 
git-commit: print the usage text on -h only

On an option error instead of printing the full text only suggest the -h
option as that is more appropriate for stderr.

[skip ci]

3 months agogit-commit: fixup issues from previous commits
Denis Ovsienko [Thu, 10 Jan 2019 23:03:03 +0000 (23:03 +0000)] 
git-commit: fixup issues from previous commits

[skip ci]

3 months agoupgrade CodeMirror from 5.41.0 to 5.42.2
Denis Ovsienko [Thu, 10 Jan 2019 22:17:23 +0000 (22:17 +0000)] 
upgrade CodeMirror from 5.41.0 to 5.42.2

[skip ci]

3 months agogit-commit: add an early check for -o
Denis Ovsienko [Tue, 8 Jan 2019 22:54:26 +0000 (22:54 +0000)] 
git-commit: add an early check for -o

3 months agospell the product number for HP 1810G-24
Denis Ovsienko [Tue, 8 Jan 2019 22:08:59 +0000 (22:08 +0000)] 
spell the product number for HP 1810G-24

[skip ci]

3 months agogit-commit: add -v for git verbosity level
Denis Ovsienko [Tue, 8 Jan 2019 22:05:50 +0000 (22:05 +0000)] 
git-commit: add -v for git verbosity level

Make it possible for the calling PHP code to receive the git command(s)
output on request. Make the current quiet mode the default to preserve
some backward compatibility.

3 months agogit-commit: add an error check for mkdir
Denis Ovsienko [Tue, 8 Jan 2019 21:40:27 +0000 (21:40 +0000)] 
git-commit: add an error check for mkdir

[skip ci]

3 months agosnmp: add support for a variant of HP JE006A (Mantis #1293)
Christoph Goth [Thu, 14 Aug 2014 20:30:00 +0000 (21:30 +0100)] 
snmp: add support for a variant of HP JE006A (Mantis #1293)

HP JE006A is a 3Com 3CRBSG2893.

[skip ci]

3 months agogit-commit: add -h for "help"
Denis Ovsienko [Sat, 5 Jan 2019 23:05:04 +0000 (23:05 +0000)] 
git-commit: add -h for "help"

[skip ci]

3 months agogit-commit: add more error checks
Denis Ovsienko [Sat, 5 Jan 2019 22:58:01 +0000 (22:58 +0000)] 
git-commit: add more error checks

Test that the provided <repodir> is good before making any changes. Test
that git is available. Test that "git add" and "git commit" worked.

Move the default value for COMMITMSG right into the git command. Update
the usage text.

[skip ci]

3 months agospell the product number for HP 1910-24G
Denis Ovsienko [Sat, 5 Jan 2019 21:53:42 +0000 (21:53 +0000)] 
spell the product number for HP 1910-24G

Clarify the end result of the following series of commits (in
chronological order):

e7705e2a add HP ProCurve 1910-24G
8df12894 finalize the previous commit
8db81368 dict: remove duplicate item HP ProCurve 1910-24G
e6562cdb SNMP: fix dict_key for HP 1910-24G

[skip ci]

3 months agogit-commit: implement -d for git commit --date
Denis Ovsienko [Thu, 3 Jan 2019 18:09:23 +0000 (18:09 +0000)] 
git-commit: implement -d for git commit --date

[skip-ci]

3 months agogit-commit: make the actions more fine-grained
Denis Ovsienko [Thu, 3 Jan 2019 17:46:49 +0000 (17:46 +0000)] 
git-commit: make the actions more fine-grained

Introduce an optional -o ("only") option to request only a specific
step of the pull-commit-push workflow. This is useful for updating many
files in a batch -- any changes will still end up one commit per file,
but the workflow will be pull-commit-commit-...-commit-commit-push, which
will not multiply the delay accessing a slow git remote before and after
every attempted file.

Without the option the script will work same as before this change.

[skip ci]

3 months agogit-commit: move the code into smaller functions
Denis Ovsienko [Thu, 3 Jan 2019 13:14:24 +0000 (13:14 +0000)] 
git-commit: move the code into smaller functions

[skip ci]

3 months agofixup the previous commit
Denis Ovsienko [Thu, 3 Jan 2019 00:21:33 +0000 (00:21 +0000)] 
fixup the previous commit

Put HP JG311A ports right and fix some regexp issues.

[skip ci]

3 months agoUpdate snmp.php
rychka [Tue, 18 Dec 2018 14:02:43 +0000 (17:02 +0300)] 
Update snmp.php

add SNMP support for HP 1950 48G 2SFP+ 2XGT Switch (Mantis#1599)
add SNMP support for HPE FlexFabric 5900AF 48XG 4QSFP+ Switch (Mantis#1841)
add SNMP support for HPE 5500-24G-4SFP Switch (Mantis#1839)
add SNMP support for HP A5800AF-48G Switch with 2 Processors (JG225A) (Mantis#1843)
add SNMP support for HP 1810-8G v2 (J9802A) Switch (Mantis#1287)

3 months agoUpdate dictionary.php
rychka [Tue, 18 Dec 2018 13:53:16 +0000 (16:53 +0300)] 
Update dictionary.php

add SNMP support for HP 1950 48G 2SFP+ 2XGT Switch (Mantis#1599)
add SNMP support for HPE FlexFabric 5900AF 48XG 4QSFP+ Switch (Mantis#1841)
add SNMP support for HPE 5500-24G-4SFP Switch (Mantis#1839)
add SNMP support for HP A5800AF-48G Switch with 2 Processors (JG225A) (Mantis#1843)
add SNMP support for HP 1810-8G v2 (J9802A) Switch (Mantis#1287)

3 months agocallScript(): fixup an error message
Denis Ovsienko [Tue, 1 Jan 2019 16:58:59 +0000 (16:58 +0000)] 
callScript(): fixup an error message

[skip ci]

3 months agogit-commit: quote $SUDOUSER too
Denis Ovsienko [Tue, 1 Jan 2019 16:55:01 +0000 (16:55 +0000)] 
git-commit: quote $SUDOUSER too

3 months agogit-commit: support custom author for the commit
Denis Ovsienko [Tue, 1 Jan 2019 16:53:17 +0000 (16:53 +0000)] 
git-commit: support custom author for the commit

3 months agogit-commit: switch to getopts
Denis Ovsienko [Tue, 1 Jan 2019 16:39:27 +0000 (16:39 +0000)] 
git-commit: switch to getopts

This breaks backward compatibility, but makes it easier to add new
options in future.

3 months agogit-commit: prepend all messages with own filename
Denis Ovsienko [Tue, 1 Jan 2019 12:45:09 +0000 (12:45 +0000)] 
git-commit: prepend all messages with own filename

4 months agogateways/git-commit: handle new files better
Denis Ovsienko [Wed, 19 Dec 2018 13:01:36 +0000 (13:01 +0000)] 
gateways/git-commit: handle new files better

The script works as expected updating existing files, but to add new
files to the repository things need to be done slightly differently.

[skip ci]

4 months agodisplay file comment in the SELECT (Mantis#1419)
Denis Ovsienko [Mon, 17 Dec 2018 17:51:30 +0000 (17:51 +0000)] 
display file comment in the SELECT (Mantis#1419)

* getAllUnlinkedFiles(): include the beginning of the comment into the
  result and return the result as it is
* renderFilesForEntity(): add a round to build the printSelect() input

4 months agosimplify getFilesOfEntity()
Denis Ovsienko [Mon, 17 Dec 2018 17:39:55 +0000 (17:39 +0000)] 
simplify getFilesOfEntity()

4 months agosqueeze some blank lines
Denis Ovsienko [Mon, 17 Dec 2018 16:55:05 +0000 (16:55 +0000)] 
squeeze some blank lines

[skip ci]

4 months agosyncdomain.php: just use basename()
Denis Ovsienko [Thu, 13 Dec 2018 13:14:14 +0000 (13:14 +0000)] 
syncdomain.php: just use basename()

4 months agofixup indentation in snmp.php
Denis Ovsienko [Tue, 11 Dec 2018 17:01:54 +0000 (17:01 +0000)] 
fixup indentation in snmp.php

[skip ci]

4 months agorefine platform tests further
Denis Ovsienko [Wed, 5 Dec 2018 23:30:04 +0000 (23:30 +0000)] 
refine platform tests further

In platform_is_ok() convert the PHP extension tests to declarations and
describe the impact of a failed test iff the test is not critical for the
core RackTables features to work in the default configuration. Ibid,
display the impact of an optional test in the output table when it fails
(this did not work before because platform_function_test() ignored one of
its parameters). Ibid, for the test just use extension_loaded(). Remove
platform_function_test(), which now has no purpose.

[skip ci]

4 months agoplatform_is_ok(): add a non-critical test for cURL
Denis Ovsienko [Wed, 5 Dec 2018 16:19:33 +0000 (16:19 +0000)] 
platform_is_ok(): add a non-critical test for cURL

[skip ci]

4 months agosimplify renderObjectHistory()
Denis Ovsienko [Tue, 4 Dec 2018 12:21:33 +0000 (12:21 +0000)] 
simplify renderObjectHistory()

Just use renderTableViewer(), this among other things yields a better
formatted table.

[skip ci]

4 months agoadd basic integrity checks for config variables
Denis Ovsienko [Fri, 30 Nov 2018 23:43:25 +0000 (23:43 +0000)] 
add basic integrity checks for config variables

Use the configuration defaults data in two new checks in
renderDataIntegrityReport(). One of the checks immediately fails because
the data in getConfigDefaults() did not include ENABLE_BULKPORT_FORM, so
fix that right away.

4 months agomake the configuration defaults data shareable
Denis Ovsienko [Fri, 30 Nov 2018 22:42:21 +0000 (22:42 +0000)] 
make the configuration defaults data shareable

Move the array from resetUIConfig() to a new function,
getConfigDefaults(). Place the new function in dictionary.php as that is
the best way to make it available in the installer (which still does not
use it though). Update renderUIResetForm() to use a new opcode that
works better with the hardcoded require_once in index.php.

4 months agotests: update RenderReportsTest
Denis Ovsienko [Fri, 30 Nov 2018 21:01:09 +0000 (21:01 +0000)] 
tests: update RenderReportsTest

Assert that the integrity report prints the "all clear" message.

Remove some dead code: the class props are no longer required since
commit 4829189; the test condition is always true because
renderLocalReports() does not exist since commit df8739f.

4 months agorenderTableViewer(): quote the TD class value
Denis Ovsienko [Fri, 30 Nov 2018 20:29:31 +0000 (20:29 +0000)] 
renderTableViewer(): quote the TD class value

This way specifying more than one class in the calling function isn't
more difficult than it should be.

[skip ci]

4 months agomake RE_L2_SOLID uppercase-only
Denis Ovsienko [Fri, 30 Nov 2018 19:06:52 +0000 (19:06 +0000)] 
make RE_L2_SOLID uppercase-only

This is a fixup to commit 97792a8.

4 months agoUpdate dictionary.php
rychka [Fri, 30 Nov 2018 10:54:13 +0000 (13:54 +0300)] 
Update dictionary.php

add SNMP support for HP Aruba 2530 48 PoE+ Switch and HP Aruba 2530 24 PoE+ Switch (Mantis#1641)

4 months agoUpdate snmp.php
rychka [Fri, 30 Nov 2018 10:52:32 +0000 (13:52 +0300)] 
Update snmp.php

add SNMP support for HP Aruba 2530 48 PoE+ Switch and HP Aruba 2530 24 PoE+ Switch (Mantis#1641)

4 months agorenderObject(): align some TDs in the NATv4 tables
Denis Ovsienko [Wed, 28 Nov 2018 18:15:58 +0000 (18:15 +0000)] 
renderObject(): align some TDs in the NATv4 tables

[skip ci]

4 months agoeliminate a global variable
Denis Ovsienko [Wed, 28 Nov 2018 13:07:02 +0000 (13:07 +0000)] 
eliminate a global variable

Rewrite addPageHeader() so it does not need the helper array.

4 months agorename getObjectClass() to getCellClass()
Denis Ovsienko [Wed, 28 Nov 2018 12:43:58 +0000 (12:43 +0000)] 
rename getObjectClass() to getCellClass()

This completes the change started in the previous commit -- the function
input may come from realms other than 'object'. Update the functions
below.

* printObjectDetailsForRenderRack()
* renderRack()
* renderDepot()
* renderIPSpaceRecords()
* renderAtomGrid()
* renderCell()
* renderRouterCell()
* renderSLBEntityCell()

4 months agofix colour handling in user account search results
Denis Ovsienko [Wed, 28 Nov 2018 12:22:07 +0000 (12:22 +0000)] 
fix colour handling in user account search results

setEntityColors() caused the following log messages when the search
results included any local user accounts:

PHP Notice:  Undefined index: etags in .../inc/interface-lib.php on
line 1344
PHP Warning:  Invalid argument supplied for foreach() in
.../inc/interface-lib.php on line 1344

This was caused by getAccountSearchResult() constructing and returning
a mock user cell structure, which through the search results eventually
ended up in renderCell(). The latter used to have a workaround for that
specific case (see commit 573214e), but only after the call to
setEntityColors(), which needs the 'etags' data, even when it is an
empty list.

Remove the workaround from renderCell() and remove the unnecessary
custom code from getAccountSearchResult(), which now just calls
spotEntity() like other similar search functions. That delivers 'etags'
to renderCell(), which now has input for getObjectClass(), which now
yields another log message:

PHP Notice:  Undefined index: id in .../interface-lib.php on line 1302

To fix that update getObjectClass() to use the proper index for user
cells like mkCellA() does.

[skip ci]

4 months agoreplace includeJQueryUI() with 2 nullary functions
Denis Ovsienko [Mon, 26 Nov 2018 19:16:23 +0000 (19:16 +0000)] 
replace includeJQueryUI() with 2 nullary functions

The only argument to this function was always a constant.

* includeJQueryUI(): mark deprecated
* includeJQueryUIJS(): a new function
* includeJQueryUICSS(): a new function
* enableTagsPicker(): update to use the new functions
* renderRackSortForm(): idem
* renderGridForm: idem
* renderIPForObject: idem
* renderRackSpaceForObject: idem
* renderIPAddressAllocations: idem
* renderPopupPortSelector: idem

[skip ci]

4 months agospell PHP FALSE in upppercase
Denis Ovsienko [Mon, 26 Nov 2018 18:52:03 +0000 (18:52 +0000)] 
spell PHP FALSE in upppercase

[skip ci]

4 months agodeprecate escapeString()
Denis Ovsienko [Tue, 20 Nov 2018 10:10:58 +0000 (10:10 +0000)] 
deprecate escapeString()

[skip ci]

4 months agofixup the previous commit
Denis Ovsienko [Mon, 19 Nov 2018 18:14:46 +0000 (18:14 +0000)] 
fixup the previous commit

Move RE_STATIC_URI from solutions.php to functions.php and address
assorted non-critical issues:

* isUri(): use the same regexp as the chrome module does (update the
  tests respectively)
* addPageHeader(): a new helper function with the common code
* addJSExternal(): simplify by using the above function
* addJSInternal(): idem
* addJSText(): idem
* addCSSExternal(): idem
* addCSSInternal(): idem
* addCSSText(): idem
* checkColumnOfRadios8021Q(): update to make a clean call to addJSText()
* renderRackCodeViewer(): idem
* renderRackCodeEditor(): idem
* addParentNodeOptionsJS(): idem
* getOptionTree(): idem
* renderLocationFilterPortlet(): idem

Put some lettercase and punctuation right and add some missing comments
while at it.

4 months agoenable CSS and JavaScript from external URLs
netniV [Tue, 13 Nov 2018 10:45:20 +0000 (10:45 +0000)] 
enable CSS and JavaScript from external URLs

5 months agotests: default to PHPUnit versions 6 and 7
Denis Ovsienko [Mon, 19 Nov 2018 09:21:47 +0000 (09:21 +0000)] 
tests: default to PHPUnit versions 6 and 7

Versions 4 and 5 still work (that's what is in Travis CI PHP versions
5.5 and 5.6 respectively) with the right bootstrap file, but they are
not available anymore on the system where I happen to run phpunit
without express.sh.

[skip ci]

5 months agorename VIRTUAL_OBJ_LISTSRC to VIRTUAL_OBJ_CSV
Denis Ovsienko [Fri, 16 Nov 2018 15:28:17 +0000 (15:28 +0000)] 
rename VIRTUAL_OBJ_LISTSRC to VIRTUAL_OBJ_CSV

After commit 8dc2a6c the value is no longer a RackCode string, so change
the name for clarity.

5 months agoimprove the object NATv4 tab trigger
Denis Ovsienko [Fri, 16 Nov 2018 14:40:05 +0000 (14:40 +0000)] 
improve the object NATv4 tab trigger

* getNATv4CountForObject(): a new helper function
* trigger_natv4(): update to work like trigger_ip(), i.e. keep the tab
  available so long as the object has associated items

Add some tests while at it.

5 months agoreplace remaining niftyString() occurrences
Denis Ovsienko [Wed, 14 Nov 2018 10:37:52 +0000 (10:37 +0000)] 
replace remaining niftyString() occurrences

This seems to be the last commit in the series, the previous one was
commit a0bdf6d.

* formatVLANAsLabel()
* formatVLANAsPlainText()
* formatVLANAsShortLink()
* formatPatchCableHeapAsPlainText()
* dynamic_title_decoder_throwing()

[skip ci]

5 months agofix allObjectLogs() after the previous commit
Denis Ovsienko [Tue, 13 Nov 2018 16:37:09 +0000 (16:37 +0000)] 
fix allObjectLogs() after the previous commit

Make the <BR> work again, though keep escaping the user name.

[skip ci]

5 months agofix object log TD escaping after commit 274f160
Denis Ovsienko [Tue, 13 Nov 2018 16:24:22 +0000 (16:24 +0000)] 
fix object log TD escaping after commit 274f160

In allObjectLogs() it is the comment column that renderTableViewer()
ought not escape, not the date/user column.

[skip ci]

5 months agotests: use myString() and myStringStatic() more
Denis Ovsienko [Mon, 12 Nov 2018 16:28:06 +0000 (16:28 +0000)] 
tests: use myString() and myStringStatic() more

* EmptySQLWhereTest
* LinkTriggerTest
* RenderDepotTest
* TagTreeCircularReferenceTest

5 months agotests: skip symlinks in tests/
Denis Ovsienko [Mon, 12 Nov 2018 16:25:33 +0000 (16:25 +0000)] 
tests: skip symlinks in tests/

This removes bootstrap.php from the list and the totals.

5 months agotests: check init.php for syntax errors
Denis Ovsienko [Mon, 12 Nov 2018 15:49:26 +0000 (15:49 +0000)] 
tests: check init.php for syntax errors

In express.sh move the checks code out to functions and leave the
simplified main loops to decide which check to run and to count the
errors. Have init.php checked at least syntax-wise.

While at it, update a comment and increase the format width to
accommodate the recently added long file name.

5 months agodrop support for $localreports
Denis Ovsienko [Mon, 12 Nov 2018 10:52:34 +0000 (10:52 +0000)] 
drop support for $localreports

10 years ago this feature seemed to be a useful shortcut, but based on
the experience with both free and proprietary plugins since then it
became clear that it is either not used at all, or can be trivially
implemented without the code in RackTables when really required. Remove
renderLocalReports() and trigger_localreports().

5 months agoadd and use RTTestCase::myStringStatic()
Denis Ovsienko [Mon, 12 Nov 2018 10:47:13 +0000 (10:47 +0000)] 
add and use RTTestCase::myStringStatic()

Even after the introduction of RTTestCase::myString() some tests
continued to use fixed strings for the database props naming in their
static setup methods. When such a test failed in a way that prevented the
teardown method to run, that would fail subsequent attempts to run the
setup method until the props were manually removed or the unit test
database contents was reset.

Introduce a static counterpart of the existing solution and update the
following classes to use it:

* EntityLinkTriggerTest
* GetChildrenListTest
* ObjectCircularReferenceTest
* ObjectLogTest

5 months agorenderTagStats(): remove an unused global
Denis Ovsienko [Mon, 12 Nov 2018 08:51:30 +0000 (08:51 +0000)] 
renderTagStats(): remove an unused global

5 months agofixup some language in the installer messages
Denis Ovsienko [Sun, 11 Nov 2018 21:56:24 +0000 (21:56 +0000)] 
fixup some language in the installer messages

* not_already_installed()
* check_config_access()

[skip ci]

5 months agogateways/git-commit: accept a full commit message
Denis Ovsienko [Fri, 9 Nov 2018 16:19:55 +0000 (16:19 +0000)] 
gateways/git-commit: accept a full commit message

The script used to prepend the first line to the provided message, which
isn't always convenient. Change that and make the message parameter
optional.

[skip ci]

5 months agorenderServerConfigurationReport(): handle InnoDB failures better
Denis Ovsienko [Fri, 9 Nov 2018 15:01:10 +0000 (15:01 +0000)] 
renderServerConfigurationReport(): handle InnoDB failures better

The InnoDB test fails trying to create a trigger when binary logging is
enabled in the database server (in particular, that is required for the
old-style master-slave replication setup). This used to result in an
unhandled PDOException, which effectively blinded all other tests.

Use the exception to generate a separate specific error message and to
skip the InnoDB test only.

5 months agofixup some whitespace in the PHP code
Denis Ovsienko [Fri, 9 Nov 2018 11:42:44 +0000 (11:42 +0000)] 
fixup some whitespace in the PHP code

[skip ci]

5 months agorenderRackSpaceForObject(): improve page layout a bit
Denis Ovsienko [Thu, 8 Nov 2018 22:48:42 +0000 (22:48 +0000)] 
renderRackSpaceForObject(): improve page layout a bit

As a follow-up to commits a302199 and d69e5d6, align the rack diagrams to
the row bottom. Make the labels above them clickable and prepended with
respective row name(s). Add a line break between the TEXTAREA and the
form submit button.

[skip ci]

5 months agoreorganize the reports a little
Denis Ovsienko [Thu, 8 Nov 2018 21:42:29 +0000 (21:42 +0000)] 
reorganize the reports a little

* renderRackCodeReports(): merge into renderSystemReports()
* renderIPv4Reports(): idem
* renderIPv6Reports(): idem
* renderPortsReport(): idem
* renderReports(): change the meters TD to fit better into a wider table
* renderTagStats(): update the table style for readability

5 months agofixup a message code in updateUI()
Denis Ovsienko [Wed, 7 Nov 2018 22:33:04 +0000 (22:33 +0000)] 
fixup a message code in updateUI()

[skip ci]

5 months agoisConfigVarChanged(): use intval() too
Denis Ovsienko [Wed, 7 Nov 2018 22:23:43 +0000 (22:23 +0000)] 
isConfigVarChanged(): use intval() too

This fixes another PHP warning with PHP 7.1 (see commit 272a945).

A non-numeric value encountered in .../inc/functions.php on line 5536

[skip ci]

5 months agoshow colours on the cell background too
Denis Ovsienko [Wed, 7 Nov 2018 18:04:37 +0000 (18:04 +0000)] 
show colours on the cell background too

* renderCell()
* renderSLBEntityCell()
* renderRouterCell()

5 months agorefine renderCellList()
Denis Ovsienko [Wed, 7 Nov 2018 17:21:00 +0000 (17:21 +0000)] 
refine renderCellList()

Do zebra with CSS, not PHP; when the input list is empty display a
message instead of a table with no rows.

[skip ci]

5 months agoremove more unused globals
Denis Ovsienko [Wed, 7 Nov 2018 17:19:28 +0000 (17:19 +0000)] 
remove more unused globals

* renderEditObjectForm()
* renderEditRackForm()
* renderIPv4NetworkAddresses()
* renderIPNetworkProperties()
* renderEditLocationForm()

[skip ci]

5 months agofix some HTML syntax in getColorSelect()
Denis Ovsienko [Wed, 7 Nov 2018 14:43:35 +0000 (14:43 +0000)] 
fix some HTML syntax in getColorSelect()

[skip ci]

5 months agoupdate a comment
Denis Ovsienko [Wed, 7 Nov 2018 10:11:58 +0000 (10:11 +0000)] 
update a comment

[skip ci]

5 months agoput some tag colour CSS processing right
Denis Ovsienko [Tue, 6 Nov 2018 14:09:59 +0000 (14:09 +0000)] 
put some tag colour CSS processing right

getObjectClass() used to accept as one of its parameters a custom string
to prepend to the generated CSS, but the functions that called it didn't
always properly decide what that string should be, if any. Modify
getObjectClass() to accept a mandatory context code, this makes it a
single place to yield the CSS for this purpose, and makes the code in the
calling functions easier to follow.

Fix printObjectDetailsForRenderRack() to highlight the currently selected
nested object with coloured tags.

Fix renderAtomGrid() not to highlight mounted objects with coloured tags
just because they have the "has_problems" flag set.

Fix the same issue in renderRack(), and fix it to highlight the currently
selected zero-U object with coloured tags.

Remove additional zebra style from renderDepot() to make the list of
objects look consistently with the list of networks (which looks better).

In renderIPSpaceRecords() simplify and comment related code.

5 months agoupgrade CodeMirror from 5.40.2 to 5.41.0
Denis Ovsienko [Sat, 3 Nov 2018 09:51:27 +0000 (09:51 +0000)] 
upgrade CodeMirror from 5.40.2 to 5.41.0

[skip ci]