19 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]

19 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]

19 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]

19 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

19 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.

19 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.

19 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().

19 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

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

19 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]

19 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

[skip ci]

19 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.

19 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]

19 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]

19 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

19 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]

19 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]

19 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()

19 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]

19 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]

19 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]

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

[skip ci]

19 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.

20 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]

20 months agoshow object names in allocated units (Mantis#1711)
Denis Ovsienko [Fri, 2 Nov 2018 19:28:50 +0000 (19:28 +0000)] 
show object names in allocated units (Mantis#1711)

This change implements the original idea by Bram.

renderAtomGrid() generates forms built into rack diagrams to allow the
user to adjust rack design and to mark rack-specific problems and to
change rackspace allocation for an object. The function used to put a
checkbox into each atom of the diagram regardless if specific atoms
belong to the context (where they did not belong, the checkboxes were
disabled). This was supposedly done to keep the rack diagram unit rows
exactly the same height.

However, that was not convenient as the user could not correlate the
checkboxes of interest with neither names nor exact boundaries of known
objects in the rack and often had to rely on unit numbers only or to flip
between the default and the rackspace tabs.

Port some logic from renderRack() to renderAtomGrid() to show mounted
objects on the said forms. Amend addBulkSelectorJS() to keep the bulk
selector away from the object hyperlinks, which are much more useful if
they remain clickable, especially on the object rackspace tab.

20 months agorefine other rackspace checkboxes JavaScript props
Denis Ovsienko [Fri, 2 Nov 2018 19:06:14 +0000 (19:06 +0000)] 
refine other rackspace checkboxes JavaScript props

20 months agorenderRackSpaceForObject(): wrap LABEL around INPUT
Denis Ovsienko [Fri, 2 Nov 2018 18:48:56 +0000 (18:48 +0000)] 
renderRackSpaceForObject(): wrap LABEL around INPUT

20 months agoimprove the rackspace atoms bulk selector
Denis Ovsienko [Fri, 2 Nov 2018 18:44:55 +0000 (18:44 +0000)] 
improve the rackspace atoms bulk selector

When the rackspace tab summoned more than one rack for the current
object, each rack diagram TABLE would have the same ID. Although this
turned out to work somehow with a single JavaScript block that addressed
the target element by ID, it is better to make it a more correct HTML
document by giving each diagram TABLE a unique ID and amending the
JavaScript respectively.

Also specify that the bulk selector should keep away from TH elements as
the row and column checkbox toggling already uses them.

Also enable the bulk selector on the rack design and rack problems tabs.

* addBulkSelectorJS(): new function to generate the JavaScript
* renderRackSpaceForObject(): use that instead of the fixed JavaScript
* renderGridForm(): enable the selector too
* js/bulkselector.js: delete the file (again)

20 months agomake the "Uncheck all" button rack-specific
Denis Ovsienko [Fri, 2 Nov 2018 18:19:34 +0000 (18:19 +0000)] 
make the "Uncheck all" button rack-specific

When the rackspace tab summoned more than one rack for the current
object, there was a button under each rack, but each button would unset
all checkboxes on the page, so make it work more like it looks.

* uncheckAll(): replace with uncheckAllAtoms(), which unchecks all
  checkboxes within the specified rack only
* renderRackSpaceForObject(): provide required rack-specific arguments to
  the JavaScript function

20 months agoprintObjectDetailsForRenderRack(): swap if() branches
Denis Ovsienko [Fri, 2 Nov 2018 13:48:50 +0000 (13:48 +0000)] 
printObjectDetailsForRenderRack(): swap if() branches

Make it easier to read.

20 months agosimplify markupAtomGrid()
Denis Ovsienko [Fri, 2 Nov 2018 12:39:09 +0000 (12:39 +0000)] 
simplify markupAtomGrid()

20 months agoremove an unnecessary function call
Denis Ovsienko [Fri, 2 Nov 2018 12:24:06 +0000 (12:24 +0000)] 
remove an unnecessary function call

renderMolecule() does not use any of the data set by markAllSpans().

20 months agofixup a comment in pi.css
Denis Ovsienko [Fri, 2 Nov 2018 11:55:54 +0000 (11:55 +0000)] 
fixup a comment in pi.css

20 months agorefine rack unit number inversion
Denis Ovsienko [Fri, 2 Nov 2018 11:08:21 +0000 (11:08 +0000)] 
refine rack unit number inversion

* inverseRackUnit(): let the calling function see if the rack needs its
  unit numbers reversed as this property is the same for each unit; this
  eliminates excess calls to considerConfiguredConstraint() and amounts
  of data from the signature
* renderRack(): update to accommodate the change above
* renderMolecule(): idem
* renderAtomGrid(): idem

20 months agoremove a stale comment
Denis Ovsienko [Fri, 2 Nov 2018 10:12:49 +0000 (10:12 +0000)] 
remove a stale comment

[skip ci]

20 months agofix array printing in exception handlers
Denis Ovsienko [Thu, 1 Nov 2018 23:45:50 +0000 (23:45 +0000)] 
fix array printing in exception handlers

PHP provides means to encode arrays in HTTP request parameters. However,
the existing dumpArray() function used not to print such parameters
properly, also resulting in two PHP warnings. Add another function,
dumpArrayElement(), and rearrange the code to distinguish integers,
arrays and other types (i.e. strings). Drop a reference to an undefined
CSS class while at it.

[skip ci]

20 months agofixup an SQL query in the integrity report
Denis Ovsienko [Thu, 1 Nov 2018 18:20:25 +0000 (18:20 +0000)] 
fixup an SQL query in the integrity report

Have renderDataIntegrityReport() test both parent_objtype_id and
child_objtype_id in ObjectParentCompat when looking for any rows in
EntityLink that do not meet the constraint. This lets the report find
some rows that it did not before.

[skip ci]

20 months agodelete the user tags too (fixup commit ec78e24)
Denis Ovsienko [Thu, 1 Nov 2018 13:17:08 +0000 (13:17 +0000)] 
delete the user tags too (fixup commit ec78e24)

* commitDeleteUserAccount()

[skip ci]

20 months agoAllow webfonts through CSS (#230)
Mark Brugnoli-Vinten [Tue, 30 Oct 2018 21:44:19 +0000 (21:44 +0000)] 
Allow webfonts through CSS (#230)

20 months agoadd D-Link DES-3028 SNMP support (#229)
rychka [Tue, 30 Oct 2018 20:28:38 +0000 (23:28 +0300)] 
add D-Link DES-3028 SNMP support (#229)

20 months agoadd some finish to the HP and IOS 15 code
Denis Ovsienko [Wed, 17 Oct 2018 18:18:52 +0000 (19:18 +0100)] 
add some finish to the HP and IOS 15 code

20 months agorelax whitespace in some IOS 12 regexps
Denis Ovsienko [Wed, 17 Oct 2018 22:56:53 +0000 (23:56 +0100)] 
relax whitespace in some IOS 12 regexps

As far as a draft commit in pull request #225 went, this is supposed to
improve compatibility with IOS 15.

[skip ci]

20 months agonew breeds for HP Procurve and ios15; unit tests for HP Procurve breed 225/head
Vasilii Shashkov [Mon, 13 Aug 2018 12:34:11 +0000 (19:34 +0700)] 
new breeds for HP Procurve and ios15; unit tests for HP Procurve breed

20 months agoput some more IAE/IRAE exceptions right
Denis Ovsienko [Fri, 12 Oct 2018 11:14:53 +0000 (12:14 +0100)] 
put some more IAE/IRAE exceptions right

The functions below did not take into account that the exception could
already be an instance of IRAE raised by assertStringArg() because the
argument was absent from the request. In that case the call to newIRAE()
would result in a PHP warning:

Undefined index: address in .../wwwroot/inc/exceptions.php on line 188

* assertIPArg()
* assertIPv4Arg()
* assertIPv6Arg()

21 months agoupgrade CodeMirror from 5.39.0 to 5.40.2
Denis Ovsienko [Thu, 20 Sep 2018 16:38:17 +0000 (17:38 +0100)] 
upgrade CodeMirror from 5.39.0 to 5.40.2

[skip ci]

21 months agotests: also test deleting user accounts
Denis Ovsienko [Tue, 18 Sep 2018 08:52:24 +0000 (09:52 +0100)] 
tests: also test deleting user accounts

21 months agofixup the previous commit
Denis Ovsienko [Mon, 17 Sep 2018 17:13:40 +0000 (18:13 +0100)] 
fixup the previous commit

Move the call to sha1() back into updateUser() to fix the test that
properly failed after the unintended API change. Add missing hash
argument assertions to commitCreateUserAccount() and
commitUpdateUserAccount() and cover these with new tests. While at it,
update some code for clarity.

21 months agorefine layering around updating user accounts
Denis Ovsienko [Mon, 17 Sep 2018 16:38:36 +0000 (17:38 +0100)] 
refine layering around updating user accounts

Move the logic from updateUser() to commitUpdateUserAccount() as that's
where it belongs.

21 months agoallow to delete local user accounts (Mantis#1089)
Denis Ovsienko [Mon, 17 Sep 2018 15:52:11 +0000 (16:52 +0100)] 
allow to delete local user accounts (Mantis#1089)

* commitDeleteUserAccount(): new database interface function
* renderUserListEditor(): extend the form with a "delete" button
* deleteUser(): a new ophandler function

22 months agoAdded entries for some other Dell machines that were missing that we have. 226/head
Michael C Tiernan [Tue, 21 Aug 2018 12:22:01 +0000 (08:22 -0400)] 
Added entries for some other Dell machines that were missing that we have.

23 months agoMerge pull request #224 from xornet-sl/master
Alexey Andriyanov [Fri, 3 Aug 2018 12:44:12 +0000 (15:44 +0300)] 
Merge pull request #224 from xornet-sl/master

New iif_type SFP28

23 months agoadd Huawei CE6865-48S8CQ-EI 224/head
Vladimir Sukhonosov [Thu, 2 Aug 2018 17:25:15 +0000 (20:25 +0300)] 
add Huawei CE6865-48S8CQ-EI

23 months agoadd hce snmp sync support for 25G ports
Vladimir Sukhonosov [Thu, 2 Aug 2018 17:06:24 +0000 (20:06 +0300)] 
add hce snmp sync support for 25G ports

23 months agoNew iif_type SFP28
Vladimir Sukhonosov [Thu, 2 Aug 2018 16:14:16 +0000 (19:14 +0300)] 
New iif_type SFP28

23 months agobuildVLANFilter: allow 'A1' config for anymode ports
Alexey Andriyanov [Tue, 24 Jul 2018 15:48:41 +0000 (18:48 +0300)] 
buildVLANFilter: allow 'A1' config for anymode ports

23 months agodictionary: add a few Arista switches
Denis Ovsienko [Mon, 23 Jul 2018 10:58:20 +0000 (11:58 +0100)] 
dictionary: add a few Arista switches

[skip ci]

23 months agofixup some code style
Denis Ovsienko [Fri, 13 Jul 2018 15:54:38 +0000 (16:54 +0100)] 
fixup some code style

[skip ci]

23 months agoprintTagsPickerUl(): escape the tag descriptions
Denis Ovsienko [Fri, 13 Jul 2018 15:09:49 +0000 (16:09 +0100)] 
printTagsPickerUl(): escape the tag descriptions

One more bug fix after commit 660b657. If a tag description contained a
single quote, json_encode() would produce a string that would break HTML
syntax for the UL that feeds TagIt! JavaScript. Then the entity
properties tab would display no tags and sumbitting the form would remote
all tags from the entity.

[skip ci]

23 months agofixup once again: spell function name properly
Denis Ovsienko [Fri, 13 Jul 2018 11:38:28 +0000 (12:38 +0100)] 
fixup once again: spell function name properly

23 months agofixup the previous commit not to fail in Travis CI
Denis Ovsienko [Fri, 13 Jul 2018 11:35:43 +0000 (12:35 +0100)] 
fixup the previous commit not to fail in Travis CI

23 months agoadd a new helper script -- reload_dictionary.php
Denis Ovsienko [Fri, 13 Jul 2018 11:14:04 +0000 (12:14 +0100)] 
add a new helper script -- reload_dictionary.php

23 months agoimprove reloadDictionary()
Denis Ovsienko [Fri, 13 Jul 2018 11:12:11 +0000 (12:12 +0100)] 
improve reloadDictionary()

Make the maximum amount of rows per query the function argument rather
than hard-code it. Get rid of the previously unused argument. Add a
helper function to make the code cleaner.

23 months agouse require_once in the CLI scripts
Denis Ovsienko [Fri, 13 Jul 2018 09:50:04 +0000 (10:50 +0100)] 
use require_once in the CLI scripts

[skip ci]

23 months agoformatAgeSeconds(): spell month(s) as "mo"
Denis Ovsienko [Thu, 12 Jul 2018 16:01:55 +0000 (17:01 +0100)] 
formatAgeSeconds(): spell month(s) as "mo"

Various users including myself keep reading strings like "10m ago" as
"10 minutes ago", not "10 months ago". Disambiguate the language.

23 months agorefine some CSS to avoid repetition
Denis Ovsienko [Wed, 11 Jul 2018 13:28:12 +0000 (14:28 +0100)] 
refine some CSS to avoid repetition

This is another small fixup to commit 660b657.

[skip ci]

23 months agorefine a couple exception classes
Denis Ovsienko [Sat, 7 Jul 2018 14:45:57 +0000 (15:45 +0100)] 
refine a couple exception classes

* createIPv4Prefix(): throw IAE instead of IRAE, as the user interface
  is not the only valid path to this code
* createIPv6Prefix(): idem
* addIPv4Prefix(): take care of the IAE->IRAE conversion
* addIPv6Prefix(): idem

23 months agoremove no-op code from buildTagCheckboxRows()
Denis Ovsienko [Sat, 7 Jul 2018 09:04:35 +0000 (10:04 +0100)] 
remove no-op code from buildTagCheckboxRows()

The only function that calls buildTagCheckboxRows() is
printTagCheckboxTable(), and the latter does not look for the "color"
index in the rows returned by the former.

23 months agoserializeTags(): refine the newlines in the TITLE
Denis Ovsienko [Fri, 6 Jul 2018 21:55:03 +0000 (22:55 +0100)] 
serializeTags(): refine the newlines in the TITLE

This is a small fixup to commit 660b657. Do not prepend the tag
description with newlines if the TITLE does not contain any other text
before the description.

2 years agoremove dead code related to magic_quotes
Denis Ovsienko [Fri, 6 Jul 2018 11:43:13 +0000 (12:43 +0100)] 
remove dead code related to magic_quotes

RackTables requires PHP 5.5 or newer, and the magic_quotes feature had
been removed in PHP 5.4.0. In modern PHP get_magic_quotes_gpc() exists,
but always returns FALSE.

2 years agofix some more language in the comments
Denis Ovsienko [Fri, 6 Jul 2018 11:28:26 +0000 (12:28 +0100)] 
fix some more language in the comments

[skip ci]

2 years agogetAccessPortControlCode(): add missing quotes
Denis Ovsienko [Fri, 6 Jul 2018 10:33:29 +0000 (11:33 +0100)] 
getAccessPortControlCode(): add missing quotes

The HTML form was broken for port names that contain a space.

2 years agosave8021QPorts(): refine some code
Denis Ovsienko [Fri, 6 Jul 2018 08:56:05 +0000 (09:56 +0100)] 
save8021QPorts(): refine some code

Use the switch default, add a missing assertion, update a comment.

2 years agofix some more language in the comments
Denis Ovsienko [Thu, 5 Jul 2018 17:05:58 +0000 (18:05 +0100)] 
fix some more language in the comments

[skip ci]

2 years agoimplement tag descriptions
Denis Ovsienko [Thu, 5 Jul 2018 10:57:59 +0000 (11:57 +0100)] 
implement tag descriptions

In this first implementation the tag descriptions editor resides on a tab
separate from the main tag "tree" (in fact, forest) editor. This allows
to fit the form into smaller horizontal space and to authorize the
descriptions editor in a separate context (as the descriptions do not
affect RackCode processing, for example).

* install.php: add a new "description" column to TagTree
* upgrade.php: idem
* listCells(): expedite the new "description" column
* spotEntity(): idem
* getTagList(): idem
* getObjectiveTagTree(): idem
* buildTagCheckboxRows(): idem
* renderTagRowForViewer(): display the new column in the table
* renderTagTree(): add a table header
* renderTagRowForDescriptions(): a new function for tagtree-descriptions
* renderTagDescriptionsEditor(): idem
* serializeTags(): set CLASS and TITLE depending on the tag description
* printTagCheckboxTable(): idem
* navigation.php: register a new tab for the "tagtree" page
* ophandlers.php: add an $opspec_list entry for the new tab
* pi.css: specify the style for described tags

2 years agofixup function name in renderVSTRulesEditor()
Denis Ovsienko [Wed, 4 Jul 2018 16:21:37 +0000 (17:21 +0100)] 
fixup function name in renderVSTRulesEditor()

[skip ci]

2 years agofixup some whitespace
Denis Ovsienko [Wed, 4 Jul 2018 14:18:37 +0000 (15:18 +0100)] 
fixup some whitespace

* renderEntityTagsPortlet()
* listCells()
* spotEntity()
* switchportInfoJS()

[skip ci]

2 years agofix some language in comments
Denis Ovsienko [Tue, 3 Jul 2018 13:05:56 +0000 (14:05 +0100)] 
fix some language in comments

"We" isn't a good word for making comments on a technical subject.
Remove some obsolete comments altogether.

[skip ci]

2 years agoupgrade CodeMirror from 5.37.0 to 5.39.0
Denis Ovsienko [Tue, 3 Jul 2018 07:41:03 +0000 (08:41 +0100)] 
upgrade CodeMirror from 5.37.0 to 5.39.0

[skip ci]

2 years agoremove obsolete code from buildOpspecColumns()
Denis Ovsienko [Thu, 28 Jun 2018 10:01:52 +0000 (11:01 +0100)] 
remove obsolete code from buildOpspecColumns()

Since commit 3c3487c (delivered in release 0.20.11) 'if_empty' was not
supposed to appear in the $opspec_list structures. It has been more than
2 years since the change and it is the time to remove the obsolete code.

2 years agospell remaining "unsigned" and "natural" cases
Denis Ovsienko [Thu, 28 Jun 2018 08:50:08 +0000 (09:50 +0100)] 
spell remaining "unsigned" and "natural" cases

* getPortInfoAJAX()
* updatePortRsvAJAX()
* updateCableIdAJAX()
* getAutocompleteListAJAX()
* fixContext()
* renderRackCodeViewer()
* addBulkPorts()
* updateObject()
* updateObjectAttributes()
* addMultipleObjects()
* addLotOfObjects()
* updateTag()
* addLocation()
* updateLocation()
* deleteLocation()
* updateRow()
* save8021QPorts()
* resolve8021QConflicts()
* cloneVST()
* updVSTRule()
* setPatchCableAmount()
* index.php

2 years agospell "natural" assertion type in more functions
Denis Ovsienko [Wed, 27 Jun 2018 17:24:51 +0000 (18:24 +0100)] 
spell "natural" assertion type in more functions

* addBulkPorts()
* updIPAllocation()
* delIPAllocation()
* addIPAllocation()
* delIPv4Prefix()
* delIPv6Prefix()
* updateUser()
* supplementAttrMap()
* updateObject()
* updateObjectAttributes()
* addMultipleObjects()
* linkObjects()
* deleteObject()
* updateUI()
* saveMyPreferences()
* deleteVService()
* updateRealServer()
* updateVService()
* addLoadBalancer()
* deleteRSPool()
* importPTRData()
* updateTag()
* rollTags()
* updateLocation()
* deleteLocation()
* addRow()
* addRack()
* updateRack()
* querySNMPData()
* linkFileToEntity()
* unlinkFile()
* deleteFile()
* add8021QOrder()
* del8021QOrder()
* save8021QPorts()
* bindVLANtoIPv4()
* bindVLANtoIPv6()
* unbindVLANfromIPv4()
* unbindVLANfromIPv6()
* resolve8021QConflicts()
* cloneVST()
* importDPData()
* unlinkPort()
* consumePatchCable()
* replenishPatchCable()
* setPatchCableAmount()

[skip ci]

2 years agospell "natural" and "unsigned" in some more files
Denis Ovsienko [Tue, 26 Jun 2018 14:46:40 +0000 (15:46 +0100)] 
spell "natural" and "unsigned" in some more files

[skip ci]

2 years agorefine some variable scope in the plugins
Denis Ovsienko [Sat, 23 Jun 2018 21:50:10 +0000 (22:50 +0100)] 
refine some variable scope in the plugins

* renderObjectCactiGraphs(): $options does not belong here
* renderObjectMuninGraphs(): idem

[skip ci]

2 years agoupgrade.php: wrap LABEL around INPUT
Denis Ovsienko [Wed, 20 Jun 2018 09:38:51 +0000 (10:38 +0100)] 
upgrade.php: wrap LABEL around INPUT

[skip ci]

2 years agorefine two hooks API functions
Denis Ovsienko [Tue, 19 Jun 2018 21:38:27 +0000 (22:38 +0100)] 
refine two hooks API functions

* registerHook(): do not reinvent a switch block; change an exception
  class from IRAE to IAE as the argument is not a user input
* universalHookHandler(): change an exception class from IRAE to an
  internal error because that is what a malformed internal structure is

2 years agomake the object port list header row overloadable
Mahomed Hussein [Tue, 19 Jun 2018 15:20:54 +0000 (16:20 +0100)] 
make the object port list header row overloadable

* renderObject(): move the code that prints the TR with THs into a new
  hook function
* renderObjectPortHeaderRow(): the new function

2 years agoswitch assertion type to "natural" in the plugins
Denis Ovsienko [Sun, 17 Jun 2018 10:34:53 +0000 (11:34 +0100)] 
switch assertion type to "natural" in the plugins

2 years agoupdate COPYING for 2018
Denis Ovsienko [Fri, 1 Jun 2018 21:33:56 +0000 (22:33 +0100)] 
update COPYING for 2018

[skip ci]

2 years agoAdded .editorconfig for editors that support it (#223)
M. Hagen [Wed, 23 May 2018 09:34:17 +0000 (11:34 +0200)] 
Added .editorconfig for editors that support it (#223)

[skip ci]

2 years agospell "natural" and "unsigned" in $opspec_list
Denis Ovsienko [Sun, 20 May 2018 08:11:43 +0000 (09:11 +0100)] 
spell "natural" and "unsigned" in $opspec_list

[skip ci]

2 years agofixup a couple more assertion types
Denis Ovsienko [Fri, 18 May 2018 14:54:23 +0000 (15:54 +0100)] 
fixup a couple more assertion types

The protocol code is not just a string, it is an enum.

* updatePortInVS()
* removePortFromVS()

2 years agoadd the new unsigned and natural assertion types
Denis Ovsienko [Fri, 18 May 2018 14:30:22 +0000 (15:30 +0100)] 
add the new unsigned and natural assertion types

For clarity update genericAssertion() to accept new "natural" and
"unsigned" assertion types. Update the functions below to replace the
call(s) to assertUIntArg() with something else, mostly the natural number

* render8021QOrderForm()
* renderObject8021QPorts()
* renderObject8021QSyncPreview()
* renderObject()
* renderPortsForObject()
* dynamic_title_decoder_throwing()
* renderDiscoveredNeighbors()
* addPortForwarding()
* delPortForwarding()
* updPortForwarding()
* editPortForObject()
* supplementAttrMap()
* clearSticker()
* deleteVS()
* updateVS()
* addPortToVS: unsigned()
* updatePortInVS: unsigned()
* removePortFromVS: unsigned()
* updateTripletConfig()
* removeTriplet()
* createTriplet()
* deleteRow()
* addOIFCompat()
* delOIFCompat()
* updateVLANDomain()
* handlePopupPortLink()
* renderPopupPortSelector()
* getTripletConfigAJAX()

2 years agofixup indentation in render8021QOrderForm()
Denis Ovsienko [Fri, 18 May 2018 14:09:22 +0000 (15:09 +0100)] 
fixup indentation in render8021QOrderForm()

2 years agosave8021QPorts(): refine an assertion type
Denis Ovsienko [Fri, 18 May 2018 14:03:12 +0000 (15:03 +0100)] 
save8021QPorts(): refine an assertion type

2 years agomake isUnsignedInteger() unary
Denis Ovsienko [Fri, 18 May 2018 13:33:59 +0000 (14:33 +0100)] 
make isUnsignedInteger() unary

This gets rid of the default value and makes the code easier to read. The
function now treats zero is a valid value and any other function that
calls it expects exactly that. Remove the explicit 2nd argument from the
following functions:

* setConfigVar()
* setUserConfigVar()
* HTMLColorFromDatabase()
* sortTokenize()
* constructIPRange()
* updVSTRule()

Add two unary functions -- assertUnsignedIntArg() and
assertNaturalNumArg() -- and reduce assertUIntArg() to a wrapper.

Update the tests.

2 years agointroduce isNaturalNumber()
Denis Ovsienko [Fri, 18 May 2018 12:57:33 +0000 (13:57 +0100)] 
introduce isNaturalNumber()

In this case a separate unary function does a better job than the second
optional argument to isUnsignedInteger(), whether implicit or explicit.
Use it in decodeVLANCK() and questionMarks(). Add some tests.

2 years agomake isInteger() unary
Denis Ovsienko [Fri, 18 May 2018 12:19:11 +0000 (13:19 +0100)] 
make isInteger() unary

The only effect is on isUnsignedInteger() and the tests.

2 years agofix a bug in sortObjectAddressesAndNames()
Denis Ovsienko [Fri, 18 May 2018 10:34:57 +0000 (11:34 +0100)] 
fix a bug in sortObjectAddressesAndNames()

Since the very first known revision the function discarded the last
test result, this sometimes made the sort order wrong in the IPv4
address selector pop-up (via the NATv4 tab). Put it right and add
a few tests.

2 years agofix sortTokenize() after commit 21c8b04
Denis Ovsienko [Fri, 18 May 2018 09:58:07 +0000 (10:58 +0100)] 
fix sortTokenize() after commit 21c8b04

Use numCompare() even when one or both items are zero, like it was done
before the change.

2 years agorefine isValidVLANID()
Denis Ovsienko [Fri, 18 May 2018 09:08:10 +0000 (10:08 +0100)] 
refine isValidVLANID()

There is no sense in testing the integer to be non-negative two times,
one time is enough.