4 years agofixup the has_problems table column for rack rows
Denis Ovsienko [Tue, 16 May 2017 12:22:40 +0000 (13:22 +0100)] 
fixup the has_problems table column for rack rows

Commits 873c6a5 and 725d2f6 took care of the subsequent updates, this
change addresses any old rows that may have been written by the old

4 years agoupgrade.php: add a section for 0.20.14
Denis Ovsienko [Tue, 16 May 2017 11:59:49 +0000 (12:59 +0100)] 
upgrade.php: add a section for 0.20.14

4 years agoTravis CI: stick with PHPUnit 5 to fix PHP 7 build
Denis Ovsienko [Tue, 16 May 2017 11:44:35 +0000 (12:44 +0100)] 
Travis CI: stick with PHPUnit 5 to fix PHP 7 build

Travis CI support has troubleshooted the issue, this change implements
one of the solutions they suggest. Commit 42f767b describes the previous
workaround for the same problem.

4 years agosplit CREATE USER and GRANT (Mantis#1727)
Denis Ovsienko [Mon, 15 May 2017 16:46:54 +0000 (17:46 +0100)] 
split CREATE USER and GRANT (Mantis#1727)

4 years ago0.20.13: cut the release RackTables-0.20.13
Denis Ovsienko [Fri, 12 May 2017 12:57:56 +0000 (13:57 +0100)] 
0.20.13: cut the release

4 years agoadd two more integrity tests for object ports
Denis Ovsienko [Wed, 10 May 2017 17:28:31 +0000 (18:28 +0100)] 
add two more integrity tests for object ports

Follow up with the recent commits in renderDataIntegrityReport().

4 years agocheckPortRole(): don't put "else" after "return"
Denis Ovsienko [Tue, 9 May 2017 08:28:16 +0000 (09:28 +0100)] 
checkPortRole(): don't put "else" after "return"

4 years agoimprove the L2 address constraint check
Denis Ovsienko [Mon, 8 May 2017 15:38:48 +0000 (16:38 +0100)] 
improve the L2 address constraint check

Add a new function assertUniqueL2Addresses(), which accepts a list of
L2 addresses and tests them all with at most one SQL query. It also
incorporates the existing convention of an empty L2 address being OK,
such that the calling functions now have less checks to make.

Make alreadyUsedL2Address() just a wrapper for the above. Switch
commitAddPort(), commitUpdatePort() and syncObjectPorts() to the new
function. Since syncObjectPorts() does not throw IRAE anymore, add
missing try/catch blocks to doSwitchSNMPmining() and doPDUSNMPmining().

4 years agorefine more exception classes in port management
Denis Ovsienko [Mon, 8 May 2017 11:52:13 +0000 (12:52 +0100)] 
refine more exception classes in port management

InvalidArgException means that a parameter has an invalid value in
general, whereas InvalidRequestArgException specifically means that
in addition to that the parameter value is the user input from a more
or less interactive session.

In the latter case the error message should be displayed back to the user
or, if the code does not expect the IRAE class for whatever reason, the
exception should land in the [supposedly present] more general IAE catch

With that in mind fix a long-standing anomaly by making commitAddPort()
and commitUpdatePort() throw an IAE object instead of IRAE. Make changes
to addPortForObject(), editPortForObject(), autoPopulateUCS() and
renameObjectPorts() such that those functions expect an IAE and can
reasonably handle it. Amend test declarations as necessary.

While at it, move code around in syncObjectPorts() to make sure all
exceptions cause the tables lock released soonest possible.

4 years agorefine exception class in addMultiPorts()
Denis Ovsienko [Mon, 8 May 2017 09:31:11 +0000 (10:31 +0100)] 
refine exception class in addMultiPorts()

The default case stands for a bug in software as the invalid input does
not come from the user. Dispatch it as such.

4 years agofixup formatting nits after commit 2e912e8
Denis Ovsienko [Mon, 8 May 2017 09:28:46 +0000 (10:28 +0100)] 
fixup formatting nits after commit 2e912e8

* getSelect(): escape the single option case properly
* renderPortsForObject(): add a missing space char

4 years agoautoPopulateUCS(): just use switch()
Denis Ovsienko [Sun, 7 May 2017 16:53:56 +0000 (17:53 +0100)] 
autoPopulateUCS(): just use switch()

4 years agoremove obsolete port declaration formats
Denis Ovsienko [Sun, 7 May 2017 15:32:51 +0000 (16:32 +0100)] 
remove obsolete port declaration formats

* renderPortsForObject()
* addMultiPorts()

4 years agogeneratePortsForCatModule(): unused, remove
Denis Ovsienko [Sun, 7 May 2017 15:26:21 +0000 (16:26 +0100)] 
generatePortsForCatModule(): unused, remove

4 years agoremove a stale comment
Denis Ovsienko [Sun, 7 May 2017 13:09:43 +0000 (14:09 +0100)] 
remove a stale comment

4 years agorefine exception handling in the "redirect" module
Denis Ovsienko [Thu, 4 May 2017 16:11:57 +0000 (17:11 +0100)] 
refine exception handling in the "redirect" module

Add a catch-all block that prints an exception. This displays an error
message instead of a blank page when in the "redirect" case there is an
exception that isn't one of the listed "soft" errors. In particular,
this change makes it possible to see PDOException errors.

4 years agorenderUpgraderHTML(): update an error message
Denis Ovsienko [Thu, 4 May 2017 16:10:22 +0000 (17:10 +0100)] 
renderUpgraderHTML(): update an error message

This is a follow-up to commit 34ed028.

4 years agoadd a SNMP block for WS-C3560X-24T (Mantis#1343)
Denis Ovsienko [Thu, 4 May 2017 16:07:33 +0000 (17:07 +0100)] 
add a SNMP block for WS-C3560X-24T (Mantis#1343)

4 years agoreplace port triggers with table locking
Denis Ovsienko [Thu, 4 May 2017 15:57:41 +0000 (16:57 +0100)] 
replace port triggers with table locking

It turned out after the 0.20.12 release that error handling in MySQL
triggers works differently across different installations. Several users
had reported that trying to call a non-existent stored procedure from a
trigger may fail in more than one way. The call often fails during the
trigger run time when the L2 address voilates the custom constraint (and
thus rolls the transaction back as originally intended) but sometimes it
fails at the trigger creation time (and thus fails to create the
trigger). On my installation it seems to fail on UPDATE even when the
l2address column is not involved.

Another issue was, the transaction in syncObjectPorts() used SELECT ...
FOR UPDATE to lock the rows that is was going to update or delete, but it
was not clear if the constraint would be reliably enforced for all newly
inserted L2 addresses. This way two or more concurrent transactions could
potentially execute their triggers successfully independently of each
other and insert conflicting rows afterwards.

This change addresses the above issues by switching from triggers back to
table-level locking with PHP constraint implementation. It preserves the
recently added ability to make multiple changes within a single table
lock through addDesiredPort() and syncObjectPorts(). As before, the whole
set of changes does not happen if any individual change fails a sanity

* getObjectPortsAndLinksTerse(): add a new helper function to avoid table
  locking complexity
* commitAddPort(): Restore the use of alreadyUsedL2Address() and the
  locking removed in commit e6b7635.
* commitUpdatePort(): idem
* convertPDOException(): remove the trigger-specific error code
* alreadyUsedL2Address(): reinstate the revision before commit e6b7635
* exceptions.php: remove the now unused L2AddressException class
* syncObjectPorts(): replace the transaction with a table lock and
  rearrange the code to have all checks done before making any changes
* upgrade.php: drop the triggers
* install.php: ditto

4 years agosimplify some more port management code
Denis Ovsienko [Fri, 28 Apr 2017 10:51:05 +0000 (11:51 +0100)] 
simplify some more port management code

* syncObjectPorts(): update to take object ID only
* doSwitchSNMPmining(): update respectively
* doPDUSNMPmining(): ditto
* commitUpdatePortReal(): drop a temporary variable and switch to use a
  simpler function to retrieve the comment

4 years agosplit some port management code
Denis Ovsienko [Fri, 28 Apr 2017 10:02:20 +0000 (11:02 +0100)] 
split some port management code

Leave commitAddPort() to deal with exceptions only and make actual
changes to the database in commitAddPortReal(), a new function. Arrange
the code across commitUpdatePort() and commitUpdatePortReal() in a
similar way.

4 years agorefine port IIF and OIF ID parsing
Denis Ovsienko [Thu, 27 Apr 2017 15:54:38 +0000 (16:54 +0100)] 
refine port IIF and OIF ID parsing

Move the code common to commitAddPort(), commitUpdatePort() and
addDesiredPort() out of those functions into a new helper function

4 years agoMerge pull request #195 from xornet-sl/maintenance-0.20.x
Alexey Andriyanov [Mon, 24 Apr 2017 11:10:37 +0000 (14:10 +0300)] 
Merge pull request #195 from xornet-sl/maintenance-0.20.x

resolve ambiguous port types in selectbox

4 years agoresolve ambiguous port types in selectbox 195/head
Vladimir Sukhonosov [Fri, 21 Apr 2017 15:01:07 +0000 (18:01 +0300)] 
resolve ambiguous port types in selectbox

add port inner type prefix into a select box when outer type is ambiguous.
ex. inner types "QSFP+" and "QSFP28" have the same "empty QSFP" outer

4 years agoadd Huawei CE8850-32CQ-EI
Vladimir Sukhonosov [Thu, 20 Apr 2017 23:28:44 +0000 (02:28 +0300)] 
add Huawei CE8850-32CQ-EI

4 years agoupdate ChangeLog for the previous commit
Denis Ovsienko [Wed, 19 Apr 2017 08:54:44 +0000 (09:54 +0100)] 
update ChangeLog for the previous commit

4 years agoUpdated to work with Cisco ucsmsdk 193/head
Brian [Tue, 18 Apr 2017 22:56:28 +0000 (15:56 -0700)] 
Updated to work with Cisco ucsmsdk

Old Python UcsSdk is deprecated as of 0.8.3 (https://communities.cisco.com/docs/DOC-36899).
New SDK is ucsmsdk (https://communities.cisco.com/docs/DOC-64378)
New ucsmsdk 0.9 and above changed syntax and functions.

4 years agodictionary: add a recent OpenBSD release
Denis Ovsienko [Wed, 12 Apr 2017 13:53:36 +0000 (14:53 +0100)] 
dictionary: add a recent OpenBSD release

4 years agospell Content-Type header name consistently
Denis Ovsienko [Tue, 14 Mar 2017 17:25:37 +0000 (17:25 +0000)] 
spell Content-Type header name consistently

Although RFC 2616 Section 4.2 specifies header names as being
case-insensitive, Section 14.17 ibid spells "Content-Type" and that is
exactly how it appears throughout the rest of the document. Thus let's
keep it consistent in the source code too.

4 years agoTravis CI: also test "make install"
Denis Ovsienko [Tue, 14 Mar 2017 11:25:52 +0000 (11:25 +0000)] 
Travis CI: also test "make install"

4 years agoupdate the installation notes in README
Denis Ovsienko [Mon, 13 Mar 2017 17:27:54 +0000 (17:27 +0000)] 
update the installation notes in README

Remove the notes on OS distributions that were released in or before
2009. Improve the remaining FreeBSD-specific notes.

4 years agorenderMuninServersEditor(): reformat some code
Denis Ovsienko [Mon, 13 Mar 2017 16:46:19 +0000 (16:46 +0000)] 
renderMuninServersEditor(): reformat some code

This repeats an earlier change to renderCactiServersEditor().

4 years agocommitSupplementAttrMap(): make a few cleanups
Denis Ovsienko [Sun, 12 Mar 2017 17:41:42 +0000 (17:41 +0000)] 
commitSupplementAttrMap(): make a few cleanups

Drop a range check that makes no sense because of the foreign key. Add
new checks to enforce that AttributeMap.chapter_id is set to a non-NULL
value iff attribute type is "dict". Manage default values for the
function parameters.

4 years agoSNMP: replace a FIXME with a draft pattern
Denis Ovsienko [Sun, 12 Mar 2017 17:10:48 +0000 (17:10 +0000)] 
SNMP: replace a FIXME with a draft pattern

4 years agosimplify updateUI() a bit
Denis Ovsienko [Sun, 12 Mar 2017 15:56:29 +0000 (15:56 +0000)] 
simplify updateUI() a bit

Place the try-catch block around the iteration, not inside.

4 years agorefine minor nits around getBypassValue()
Denis Ovsienko [Sun, 12 Mar 2017 15:46:35 +0000 (15:46 +0000)] 
refine minor nits around getBypassValue()

4 years agoeditUserProperties(): remove a debug line
Denis Ovsienko [Sun, 12 Mar 2017 11:19:55 +0000 (11:19 +0000)] 
editUserProperties(): remove a debug line

4 years agoTravis CI: allow PHP 7.0 to fail
Denis Ovsienko [Fri, 10 Mar 2017 22:34:22 +0000 (22:34 +0000)] 
Travis CI: allow PHP 7.0 to fail

This is because it seems to be broken on Travis CI side, as the same
commit that passed the build a few days ago (012f09a) does not pass
it (as well as subsequent commits) with an error that has to do with
PHPUnit class autoloading:

PHP Fatal error:  Class 'PHPUnit_Framework_TestCase' not found in
on line 3

In my working copy (PHP 7.0.15) the tests pass as before. This change
does not exclude PHP 7.0 from the Travis CI build matrix so it should
be easy to see the recovery later.

While at it, reduce the git clone depth to reduce the amount of
unnecessary work.

4 years agorefine some code around readChapter()
Denis Ovsienko [Fri, 10 Mar 2017 21:59:57 +0000 (21:59 +0000)] 
refine some code around readChapter()

Don't specify the default value for chapter_id (as in earlier commits),
throw an exception if the chapter does not exist, manage SQL lettercase
and string quoting, add more tests.

4 years agoreformat SQL code in getChapterRefc()
Denis Ovsienko [Thu, 9 Mar 2017 18:42:01 +0000 (18:42 +0000)] 
reformat SQL code in getChapterRefc()

4 years agotests: cover more attributes and dictionary code
Denis Ovsienko [Thu, 9 Mar 2017 18:39:08 +0000 (18:39 +0000)] 
tests: cover more attributes and dictionary code

This change mainly focuses on getChapterRefc() but also adds basic
coverage for:

* commitSupplementAttrMap()
* commitUpdateAttrValue()
* getObjTypeAttrMap()
* readChapter()
* getChapterList()

4 years agorefine code in discardLDAPCache()
Denis Ovsienko [Sun, 5 Mar 2017 13:17:49 +0000 (13:17 +0000)] 
refine code in discardLDAPCache()

4 years agoaddBulkPorts(): imply %u for labels (Mantis#1739)
Gianluca Laudano [Fri, 3 Mar 2017 14:06:51 +0000 (14:06 +0000)] 
addBulkPorts(): imply %u for labels (Mantis#1739)

4 years agoaddBulkPorts(): fixup code formatting
Denis Ovsienko [Fri, 3 Mar 2017 13:56:53 +0000 (13:56 +0000)] 
addBulkPorts(): fixup code formatting

4 years agoloadEntityTags(): make SQL upper-case
Denis Ovsienko [Fri, 3 Mar 2017 12:34:35 +0000 (12:34 +0000)] 
loadEntityTags(): make SQL upper-case

4 years agotests: cover loadEntityTags()
Denis Ovsienko [Fri, 3 Mar 2017 12:32:45 +0000 (12:32 +0000)] 
tests: cover loadEntityTags()

4 years agoloadScript(): make SQL upper-case
Denis Ovsienko [Fri, 3 Mar 2017 10:11:24 +0000 (10:11 +0000)] 
loadScript(): make SQL upper-case

4 years agoadd a new gateway script: git-commit
Denis Ovsienko [Thu, 2 Mar 2017 20:31:11 +0000 (20:31 +0000)] 
add a new gateway script: git-commit

4 years agoimprove some spelling
Denis Ovsienko [Thu, 2 Mar 2017 16:56:43 +0000 (16:56 +0000)] 
improve some spelling

4 years agoremove all mentions of versions 0.18.x and 0.19.x
Denis Ovsienko [Wed, 1 Mar 2017 15:23:52 +0000 (15:23 +0000)] 
remove all mentions of versions 0.18.x and 0.19.x

Those vere released in 2010~2012 and are not supported in any way.

4 years agodictionary: add a router model
Denis Ovsienko [Tue, 28 Feb 2017 11:44:14 +0000 (11:44 +0000)] 
dictionary: add a router model

4 years agoimprove wording in README.md
Denis Ovsienko [Tue, 28 Feb 2017 11:10:34 +0000 (11:10 +0000)] 
improve wording in README.md

4 years agodictionary: add some server OS entries
Denis Ovsienko [Thu, 16 Feb 2017 20:59:38 +0000 (20:59 +0000)] 
dictionary: add some server OS entries

4 years agodictionary: add some missing Arista switches
Denis Ovsienko [Thu, 16 Feb 2017 13:47:48 +0000 (13:47 +0000)] 
dictionary: add some missing Arista switches

4 years agoupdate $breed_by_swcode for Mantis#1721 too
Denis Ovsienko [Tue, 14 Feb 2017 16:09:43 +0000 (16:09 +0000)] 
update $breed_by_swcode for Mantis#1721 too

4 years agoexpand the comment for scanArrayForItem()
Denis Ovsienko [Tue, 14 Feb 2017 12:00:14 +0000 (12:00 +0000)] 
expand the comment for scanArrayForItem()

4 years agodictionary: make some fixups for Mantis#1721
Denis Ovsienko [Tue, 14 Feb 2017 11:27:29 +0000 (11:27 +0000)] 
dictionary: make some fixups for Mantis#1721

4 years agoupgrade.php: add an empty section for 0.20.13
Denis Ovsienko [Thu, 9 Feb 2017 17:10:48 +0000 (17:10 +0000)] 
upgrade.php: add an empty section for 0.20.13

4 years agoupdate ChangeLog
Denis Ovsienko [Thu, 9 Feb 2017 16:00:18 +0000 (16:00 +0000)] 
update ChangeLog

4 years agofixup the previous change
Denis Ovsienko [Thu, 9 Feb 2017 15:50:53 +0000 (15:50 +0000)] 
fixup the previous change

...to follow the usual convention for the interface short names.

4 years agoAdd Brocade ICX7250-48 and VDX 6740
Chris Jones [Thu, 6 Oct 2016 16:37:20 +0000 (17:37 +0100)] 
Add Brocade ICX7250-48 and VDX 6740

4 years agoUse getimagesizefromstring() to get image size
Michael A. Mikhailov [Mon, 26 Dec 2016 09:19:27 +0000 (16:19 +0700)] 
Use getimagesizefromstring() to get image size

Speed up pages with image files preview.
In my case a rack page with 14 images was taking 5 seconds to load.
With this change load time dropped to 300ms.

4 years agoTravis CI: use the mysql DB for the 1st connection
Denis Ovsienko [Wed, 8 Feb 2017 18:33:50 +0000 (18:33 +0000)] 
Travis CI: use the mysql DB for the 1st connection

4 years agoinstall.php: refine file mode suggestions RackTables-0.20.12
Denis Ovsienko [Wed, 8 Feb 2017 16:52:58 +0000 (16:52 +0000)] 
install.php: refine file mode suggestions

4 years agotests: add data/0.20.12.sql
Denis Ovsienko [Wed, 8 Feb 2017 16:36:56 +0000 (16:36 +0000)] 
tests: add data/0.20.12.sql

4 years agodisable NO_ZERO_DATE in the sample SQL dump
Denis Ovsienko [Wed, 8 Feb 2017 16:12:06 +0000 (16:12 +0000)] 
disable NO_ZERO_DATE in the sample SQL dump

4 years ago0.20.12: cut the release
Denis Ovsienko [Wed, 8 Feb 2017 14:32:15 +0000 (14:32 +0000)] 
0.20.12: cut the release

4 years agodictionary: add a few Cisco models (Mantis #1721)
Denis Ovsienko [Wed, 8 Feb 2017 14:24:31 +0000 (14:24 +0000)] 
dictionary: add a few Cisco models (Mantis #1721)

4 years agofixup a 802.1Q configuration variable name 169/head
Denis Ovsienko [Tue, 28 Jun 2016 17:49:31 +0000 (18:49 +0100)] 
fixup a 802.1Q configuration variable name


4 years agobump the copyright line up for 2017
Denis Ovsienko [Mon, 6 Feb 2017 14:23:28 +0000 (14:23 +0000)] 
bump the copyright line up for 2017

4 years agoadd JunOS switch sw types into $breed_by_swcode
Alexey Andriyanov [Wed, 1 Feb 2017 16:33:56 +0000 (19:33 +0300)] 
add JunOS switch sw types into $breed_by_swcode

4 years agooptimize write in callScript()
Alexey Andriyanov [Thu, 26 Jan 2017 16:12:06 +0000 (19:12 +0300)] 
optimize write in callScript()

If a huge buffer was passed into callScript (tens of Mb), it took much
time to write it into pipe using small 4k blocks, even if system not
blocking us. That was because of re-allocating this huge string buffer ($in variable)
on every write iteration ($in = substr($in, $written)).

Now changed to tracking write cursor in the constant $in buffer and
making a small substring (4k) on every iteration.

4 years agosnmp sync support for Huawei CE6870
Alexey Andriyanov [Thu, 19 Jan 2017 17:59:55 +0000 (20:59 +0300)] 
snmp sync support for Huawei CE6870

4 years agonew iif type 'QSFP28'
Alexey Andriyanov [Thu, 19 Jan 2017 17:24:38 +0000 (20:24 +0300)] 
new iif type 'QSFP28'

4 years agoMerge pull request #191 from xornet-sl/maintenance-0.20.x
Alexey Andriyanov [Thu, 19 Jan 2017 12:38:30 +0000 (15:38 +0300)] 
Merge pull request #191 from xornet-sl/maintenance-0.20.x

ability to buffer messages in script mode

4 years agoability to buffer messages in script mode 191/head
Vladimir Sukhonosov [Wed, 18 Jan 2017 18:09:54 +0000 (21:09 +0300)] 
ability to buffer messages in script mode

sometimes in auxiliary scripts that run with $script_mode == TRUE in
background you may need to suppress or rewrite showError/showWarning
messages (ex. format and redirect messages to email)
Now it is possible to mute errors and store them in $log_messages for
further processing.

4 years agouse var_dump() in dump()
Denis Ovsienko [Tue, 10 Jan 2017 17:21:10 +0000 (17:21 +0000)] 
use var_dump() in dump()

This allows to see the difference between an empty string and NULL.

4 years agogetImageHREF(): fix bugs after commit d5f8fa1
Denis Ovsienko [Tue, 3 Jan 2017 11:56:43 +0000 (11:56 +0000)] 
getImageHREF(): fix bugs after commit d5f8fa1

PHP Notice:  Undefined index: error in interface-lib.php on line 419
PHP Notice:  Undefined index: width in interface-lib.php on line 432
PHP Notice:  Undefined index: height in interface-lib.php on line 433

When called with an invalid $tag argument value, the function would
yield the PHP messages and return HTML code with a malformed SRC
attribute value in the IMG element. The image would subsequently fail
to render because the HTTP response for the SRC URI request would be
not an image but an HTML page with error message.

Rewrite the code to prepare input to makeHtmlTag() rather than to
produce any HTML directly (a side effect is that ampersands in the URI
are now properly encoded). For undefined image tags specify an URI that
returns a standard error image, add an undefined index guard.

4 years agofix a minor bug introduced in commit 2d0ccf4
Denis Ovsienko [Mon, 2 Jan 2017 18:20:32 +0000 (18:20 +0000)] 
fix a minor bug introduced in commit 2d0ccf4

Without this change an HTTP request for an unknown module
(e.g. index.php?module=invalid) would end up in an empty response and a
message in the error log:

PHP Fatal error:  Uncaught Error: Call to undefined function isCLIMode()
in .../inc/exceptions.php:119

Now it returns a proper "Assertion failed" page.

4 years agoimplement the zebra TR pattern with CSS, pt. 5
Denis Ovsienko [Fri, 30 Dec 2016 17:36:27 +0000 (17:36 +0000)] 
implement the zebra TR pattern with CSS, pt. 5

* renderSearchResults(): switch to the new classes

4 years agorenderIPAddress(): remove an unused global
Denis Ovsienko [Fri, 30 Dec 2016 16:33:20 +0000 (16:33 +0000)] 
renderIPAddress(): remove an unused global

4 years agorefine some age formatting code
Denis Ovsienko [Tue, 6 Dec 2016 18:36:22 +0000 (18:36 +0000)] 
refine some age formatting code

The function formatAge() used to derive the amount of seconds from
time() and to format that as text. Move the main body of the code
involved to a new function, formatAgeSeconds(), which accepts the
amount of seconds as a parameter, such that the function is now pure.
Fixup the code to return "min" for minutes in all cases. Leave the old
function name as an alias for formatAgeTimestamp(), which calls time()
and implements the old semantics. Add some tests.

4 years agogenericAssertion(): add the "decimal0" variant
Denis Ovsienko [Mon, 28 Nov 2016 12:31:48 +0000 (12:31 +0000)] 
genericAssertion(): add the "decimal0" variant

4 years agorenderDataIntegrityReport(): fixup some alignment
Denis Ovsienko [Wed, 28 Dec 2016 21:42:45 +0000 (21:42 +0000)] 
renderDataIntegrityReport(): fixup some alignment

Align numeric columns to the right for readability.

4 years agoremove a useless comment
Denis Ovsienko [Wed, 28 Dec 2016 21:28:08 +0000 (21:28 +0000)] 
remove a useless comment

3.26. A comment shouldn't restate the obvious.

4 years agoAdded New Cisco Routers and Switches (#188)
kadams12 [Sun, 18 Dec 2016 12:39:11 +0000 (07:39 -0500)] 
Added New Cisco Routers and Switches (#188)

(squashed for clarity)
Added Cisco 4000 series ISR routers.
Added Cisco 3650 series switches.
Added missing 3850 series switches.
Added missing Catalyst 4510R+E

4 years agosorting of Dell PowerVault entries 189/head
HBrowne [Thu, 15 Dec 2016 16:42:21 +0000 (16:42 +0000)] 
sorting of Dell PowerVault entries

Added %GPASS% to several Dell PowerVault entries for sorting purposes

4 years agodo not export .travis.yml
Denis Ovsienko [Fri, 9 Dec 2016 21:45:47 +0000 (21:45 +0000)] 
do not export .travis.yml

4 years agoadd support for double quotes in the search string
Denis Ovsienko [Tue, 6 Dec 2016 16:28:36 +0000 (16:28 +0000)] 
add support for double quotes in the search string

Make it possible to search for substrings that include space(s), for
example, searching for "mail server" (with the quotes) will no longer
return those records that contain only "mail" or only "server" or "mail
backup server". However, the query will still match "e-mail server" as
before. Add some tests.

* parseSearchTerms(): a new function to implement the syntax more
  complex than possible with just explode()
* getSearchResultByField(): use the above
* searchHandler(): ditto

4 years agoshowPathAndSearch(): put HTML escaping right
Denis Ovsienko [Tue, 6 Dec 2016 12:03:44 +0000 (12:03 +0000)] 
showPathAndSearch(): put HTML escaping right

Instead of calling htmlspecialchars() on the data from $_REQUEST, which
has already been escaped, use the normal means to access and escape the
request data. This fixes " and similar entities in the search
INPUT. Fixup a helper function to use $sic too while at it.

5 years agoSNMP sync support for Huawei CE5850-HI
Alexey Andriyanov [Thu, 24 Nov 2016 10:30:17 +0000 (13:30 +0300)] 
SNMP sync support for Huawei CE5850-HI

5 years agofixup zebra table markup after commit e2b4528
Denis Ovsienko [Wed, 23 Nov 2016 23:34:03 +0000 (23:34 +0000)] 
fixup zebra table markup after commit e2b4528

The recent change to renderTableViewer() had a side effect in that the
newly added THEAD element numbered its TRs from 1 and the subsequent
TBODY element numbered its TRs from 1 (once again) making the resulting
table markup incorrect at the top.

Solve this by specifying the "zebra" and "zebra0" classes to work within
TBODY only. This way all the existing code that keeps all TRs in the
implicit TBODY continues to work as before and the code that puts any
header TRs into a THEAD can just use the "zebra0" class for the table.
Update renderTableViewer() to do exactly that and be slightly simpler.

5 years agofix database authentication after commit 07a10e0
Denis Ovsienko [Wed, 23 Nov 2016 12:16:34 +0000 (12:16 +0000)] 
fix database authentication after commit 07a10e0

That change had broken the database (default) authentication source:

Configuration error
$LDAP_options has not been defined (see secret.php)

In authenticate() move the checks common to both LDAP and database
sources into a helper function assertHTTPCredentialsReceived() and use a
separate case block for each of the sources for clarity.

With those changes made the LDAP configuration check still remains done
after the credentials presence check to preserve the behaviour
established a long time ago.

5 years agogetVlanRow: fix NotFound error handling
Alexey Andriyanov [Tue, 22 Nov 2016 07:21:19 +0000 (10:21 +0300)] 
getVlanRow: fix NotFound error handling

Fixes: 4a4f2614

5 years agorestore LDAP cache cleanup as a CLI script
Denis Ovsienko [Sat, 5 Nov 2016 15:17:36 +0000 (15:17 +0000)] 
restore LDAP cache cleanup as a CLI script

* constructLDAPOptions(): factor out of authenticated_via_ldap() (see
  also commit 88a9274) and add a check
* authenticate(): update to call the above
* cleanup_ldap_cache.php: a new wrapper script for discardLDAPCache()

5 years agoFixed a bug introduced in 489f843c2abdf5592cdfac8ecfc43465a6b64697
Garry Shtern [Wed, 2 Nov 2016 14:44:16 +0000 (09:44 -0500)] 
Fixed a bug introduced in 489f843c2abdf5592cdfac8ecfc43465a6b64697

5 years agodisable cleaning up expired LDAP cache rows
Alexey Andriyanov [Wed, 2 Nov 2016 10:59:43 +0000 (13:59 +0300)] 
disable cleaning up expired LDAP cache rows

This clean-up was causing even successful cache lookup request to wait
until all the locked rows are released. In case when LDAP service
does not respond sometimes, this cleaning-up code was causing every
logged-in request to wait until ldap connection attempt times out.

It would be better to not clear expired cache rows at all.

5 years agovrpReadLLDPStatus: support VRP V200R008+ (part2)
Alexey Andriyanov [Mon, 31 Oct 2016 13:01:14 +0000 (16:01 +0300)] 
vrpReadLLDPStatus: support VRP V200R008+ (part2)

This is an addition to commit 952dd6
Support new if-id type names

5 years agovrpReadLLDPStatus: support VRP V200R008+
Alexey Andriyanov [Mon, 31 Oct 2016 12:46:41 +0000 (15:46 +0300)] 
vrpReadLLDPStatus: support VRP V200R008+

Interface subtype 'local' is now printed as 'Locally assigned'

5 years agoadding processors and switch for Ubiquiti 184/head
Joe Passavanti [Sun, 30 Oct 2016 18:23:14 +0000 (11:23 -0700)] 
adding processors and switch for Ubiquiti

specifically model ES-48-LITE