racktables
4 years agoMerge branch 'maintenance-0.20.x' into yandex-prod
Alexey Andriyanov [Tue, 29 Mar 2016 15:10:43 +0000 (18:10 +0300)] 
Merge branch 'maintenance-0.20.x' into yandex-prod

4 years agoRevert "refine a few assertions to test for 'inet4'"
Alexey Andriyanov [Tue, 29 Mar 2016 14:39:34 +0000 (17:39 +0300)] 
Revert "refine a few assertions to test for 'inet4'"

This reverts commit 27ed1188b2c7a0685215c9df3638abd9155200ae.
Those functions are IPv6-aware.

4 years agoRevert "refine a few assertions to test for 'inet4'"
Alexey Andriyanov [Tue, 29 Mar 2016 14:39:34 +0000 (17:39 +0300)] 
Revert "refine a few assertions to test for 'inet4'"

This reverts commit 27ed1188b2c7a0685215c9df3638abd9155200ae.
Those functions are IPv6-aware.

4 years agoempty() isn't always the best tool, pt. 2
Denis Ovsienko [Tue, 29 Mar 2016 11:40:02 +0000 (12:40 +0100)] 
empty() isn't always the best tool, pt. 2

Use count() to clarify the argument is an array.

* renderVLANInfo()
* formatVLANPackDiff()
* renderIPForObject()

4 years agorenderEditVlan(): simplify some code
Denis Ovsienko [Tue, 29 Mar 2016 11:30:02 +0000 (12:30 +0100)] 
renderEditVlan(): simplify some code

4 years agoinit_database_static(): remove a useless test
Denis Ovsienko [Tue, 29 Mar 2016 11:08:09 +0000 (12:08 +0100)] 
init_database_static(): remove a useless test

Since get_pseudo_file() was switched to return an array instead of plain
text there should normally be no empty elements in the array. But if
there is a bug, don't hide it and just let PDO fail the normal way.

4 years agoempty() isn't always the best tool, pt. 1
Denis Ovsienko [Mon, 28 Mar 2016 14:46:54 +0000 (15:46 +0100)] 
empty() isn't always the best tool, pt. 1

To test for an empty string it does not require a function.

* updateIPNameAJAX()
* commitAddPort()
* commitUpdatePort()
* getConfiguredQuickLinks()
* formatPortLink()

4 years agoupdateAddress(): simplify a boolean expression
Denis Ovsienko [Sun, 27 Mar 2016 19:21:06 +0000 (20:21 +0100)] 
updateAddress(): simplify a boolean expression

4 years agotests: cover matchVLANFilter() and filterVLANList()
Denis Ovsienko [Sat, 26 Mar 2016 18:19:59 +0000 (18:19 +0000)] 
tests: cover matchVLANFilter() and filterVLANList()

4 years agotests: cover goodModeForVSTRole()
Denis Ovsienko [Fri, 25 Mar 2016 19:12:59 +0000 (19:12 +0000)] 
tests: cover goodModeForVSTRole()

4 years agosimplify trigger_8021q_configured()
Denis Ovsienko [Thu, 24 Mar 2016 09:19:50 +0000 (09:19 +0000)] 
simplify trigger_8021q_configured()

4 years agouse "&&" and "||" instead of "and" and "or"
Denis Ovsienko [Wed, 23 Mar 2016 21:56:32 +0000 (21:56 +0000)] 
use "&&" and "||" instead of "and" and "or"

This change prevents unexpected side effects, that, for instance, used
to require two workarounds in iptree_markup_collapsion() and one in
transformRequestData(). The root cause of the problem is that "and" and
"or" are standalone operators: though their associativity is the same as
that of "&&" and "||", the order of precedence is not just different but
is lower than that of "=". The code style article now explains this.

* syncdomain.php
* getNetUsageAJAX()
* authenticate()
* permitted()
* gotClearanceForTagChain()
* authenticated_via_ldap()
* queryLDAPServer()
* RackCodeParser::accept()
* RackCodeParser::un_expr()
* checkAutotagName()
* findCtxModWarnings()
* listCells()
* fillNetKids()
* amplifyCell()
* commitLinkEntities()
* commitUpdateEntityLink()
* updateAddress()
* generateEntityAutoTags()
* createIPv4Prefix()
* newPortForwarding()
* getDomainVLANs()
* getDomainVLANList()
* upd8021QPort()
* setConfigVar()
* setUserConfigVar()
* xos12ReadLLDPStatus()
* xos12ReadInterfaceStatus()
* vrpReadLLDPStatus()
* ftos8ReadLLDPStatus()
* eos4ReadLLDPStatus()
* ros11ReadLLDPStatus()
* jun10TranslatePushQueue()
* jun10Read8021QConfig()
* ftos8ReadInterfaceStatus()
* eos4ReadInterfaceStatus()
* ucsReadInventory()
* isInnoDBSupported()
* platform_is_ok()
* stringTrace()
* assertUIntArg()
* assertStringArg()
* assertBoolArg()
* genericAssertion()
* rectHeight()
* highlightObject()
* ip4_mask()
* ip6_mask()
* l2addressForDatabase()
* sortTokenize()
* pokeNode()
* peekNode()
* addTraceToNodes()
* redirectIfNecessary()
* getObjectiveTagTree()
* getCellFilter()
* IPNetworkCmp()
* iptree_fill()
* ip_next()
* ip_prev()
* treeApplyFunc()
* getTerminalNetworks()
* iptree_markup_collapsion()
* getPortListPrefs()
* getUnlinkedPortTypeOptions()
* groupIntsToRanges()
* array_values_same()
* buildVLANFilter()
* matchVLANFilter()
* generate8021QDeployOps()
* filter8021QChangeRequests()
* getEmployedVlans()
* get8021QSyncOptions()
* exec8021QDeploy()
* saveDownlinksReverb()
* initiateUplinksReverb()
* recalc8021QPorts()
* authorize8021QChangeRequests()
* compareDecomposedPortNames()
* searchEntitiesByText()
* buildSearchRedirectURL()
* setMessage()
* isEthernetPort()
* getConfigVar()
* getObjectTypeChangeOptions()
* apply8021qChangeRequest()
* fillIPNetsCorrelation()
* fillIPSpareListBstr()
* isIPNetworkEmpty()
* listConstraint()
* checkTypeAndAttribute()
* init.php
* install.php
* not_already_installed()
* init_config()
* get_process_owner()
* check_config_access()
* init_database_dynamic()
* render8021QOrderForm()
* renderVLANDomainListEditor()
* renderVLANDomainVLANList()
* renderObject8021QPorts()
* getAccessPortControlCode()
* renderTrunkPortControls()
* renderVLANInfo()
* renderObject8021QSync()
* renderObject8021QSyncPreview()
* renderConfigMainpage()
* renderTagRowForEditor()
* printNiftySelect()
* transformRequestData()
* getRenderedIPv4NetCapacity()
* serializeTags()
* printTagTRs()
* renderEntitySummary()
* niftyString()
* showLogoutURL()
* renderRackspace()
* renderRow()
* printObjectDetailsForRenderRack()
* renderEditRackForm()
* renderObject()
* showMessageOrError()
* renderRackSpaceForObject()
* renderIPSpaceRecords()
* renderIPSpace()
* renderIPNetwork()
* renderIPAddress()
* renderIPAddressProperties()
* renderNATv4ForObject()
* renderLocationPage()
* renderEditLocationForm()
* renderLivePTR()
* buildTagCheckboxRows()
* renderCellFilterPortlet()
* renderFile()
* renderFilesPortlet()
* printIPNetInfoTDs()
* renderCell()
* getFilePreviewCode()
* renderDiscoveredNeighbors()
* switchportInfoJS()
* addIPAllocation()
* processGridForm()
* updateObjectAttributes()
* addLotOfObjects()
* save8021QPorts()
* updVSTRule()
* importDPData()
* cleanupUCS()
* getOpspec()
* buildOpspecColumns()
* findSparePorts()
* handlePopupPortLink()
* detectDeviceBreed()
* prepareRealServersTable()
* SLBTriplet::getTriplets()
* MacroParser::addMacro()
* addRStoRSPool()
* commitUpdateRS()
* doSwitchSNMPmining()
* createTrueColorOrThrow()
* renderProgressBar4Image()
* renderImagePreview()
* proxyStaticURI()
* trigger_liveports()
* trigger_object_8021qorder()
* trigger_8021q_configured()
* trigger_anyDP()
* triggerCactiGraphs()
* triggerMuninGraphs()
* getDBUpgradePath()
* renderUpgraderHTML()
* index.php

4 years agorefine getDomainVLANs()
Denis Ovsienko [Tue, 22 Mar 2016 23:28:17 +0000 (23:28 +0000)] 
refine getDomainVLANs()

Assign $self at top and dismiss a variable.

4 years agorenderProgressBarImage(): use array_fetch()
Denis Ovsienko [Mon, 21 Mar 2016 19:57:57 +0000 (19:57 +0000)] 
renderProgressBarImage(): use array_fetch()

4 years agoprepareNavigation(): use array_fetch()
Denis Ovsienko [Sun, 20 Mar 2016 14:00:52 +0000 (14:00 +0000)] 
prepareNavigation(): use array_fetch()

4 years agosaveScript(): refine error handling
Denis Ovsienko [Sat, 19 Mar 2016 19:58:25 +0000 (19:58 +0000)] 
saveScript(): refine error handling

See also commit 0a4f411.

4 years agotests: cover validTagName()
Denis Ovsienko [Fri, 18 Mar 2016 18:17:32 +0000 (18:17 +0000)] 
tests: cover validTagName()

4 years agodecrease direct use of $_REQUEST and $sic, pt. 18
Denis Ovsienko [Fri, 18 Mar 2016 17:46:24 +0000 (17:46 +0000)] 
decrease direct use of $_REQUEST and $sic, pt. 18

* dispatchImageRequest()

4 years agosplitNetworkByMask(): fixup formatting
Denis Ovsienko [Fri, 18 Mar 2016 17:33:49 +0000 (17:33 +0000)] 
splitNetworkByMask(): fixup formatting

4 years agotest for empty strings w/o strlen(), pt. 8
Denis Ovsienko [Fri, 18 Mar 2016 10:03:11 +0000 (10:03 +0000)] 
test for empty strings w/o strlen(), pt. 8

* authenticate()
* permitted()
* queryLDAPServer()
* index.php

4 years agodetectDeviceBreed: better detection of 'jun10'
Alexey Andriyanov [Thu, 17 Mar 2016 15:45:56 +0000 (18:45 +0300)] 
detectDeviceBreed: better detection of 'jun10'

4 years agotests: add express.sh and use it in Travis CI
Denis Ovsienko [Thu, 17 Mar 2016 13:54:27 +0000 (13:54 +0000)] 
tests: add express.sh and use it in Travis CI

The script provides a convenient way of running the same set of tests
both in Travis CI and in a working copy. Add per-file tests using the
PHP interpreter.

4 years agorefine getLocationTrail()
Denis Ovsienko [Thu, 17 Mar 2016 11:58:30 +0000 (11:58 +0000)] 
refine getLocationTrail()

Use implode() and call listCells() only when the static array is empty.

4 years agoloadUserConfigCache(): refine error handling
Denis Ovsienko [Thu, 17 Mar 2016 10:15:07 +0000 (10:15 +0000)] 
loadUserConfigCache(): refine error handling

Don't specify a default value as in this case missing argument is an
error and there is no gain in suppressing the PHP warning. Explain the
exception.

4 years agotest for empty strings w/o strlen(), pt. 7
Denis Ovsienko [Thu, 17 Mar 2016 10:08:51 +0000 (10:08 +0000)] 
test for empty strings w/o strlen(), pt. 7

* loadUserConfigCache()
* getRenderedAlloc()
* renderEditRowForm()
* printObjectDetailsForRenderRack()
* renderEditObjectForm()
* renderEditRackForm()
* renderRackInfoPortlet()
* renderObject()
* renderPortsForObject()
* renderIPNetwork()
* renderIPAddress()
* renderIPAddressProperties()
* renderNATv4ForObject()
* renderEditLocationForm()
* renderLivePTR()
* buildTagCheckboxRows()
* renderCellFilterPortlet()
* renderFileSummary()
* printIPNetInfoTDs()
* renderCell()
* renderRouterCell()
* showTabs()
* dynamic_title_decoder_throwing()
* renderDiscoveredNeighbors()
* formatIfTypeVariants()
* formatPortReservation()

4 years agoChangelog line for 2ca58c
Alexey Andriyanov [Thu, 17 Mar 2016 09:27:34 +0000 (12:27 +0300)] 
Changelog line for 2ca58c

4 years agoMerge pull request #148 from dmage/maintenance-0.20.x
Alexey Andriyanov [Thu, 17 Mar 2016 09:22:53 +0000 (12:22 +0300)] 
Merge pull request #148 from dmage/maintenance-0.20.x

Use Cmd+Click to inverse tag selection on OS X

4 years agoTravis CI: also test syncdomain.php
Denis Ovsienko [Wed, 16 Mar 2016 22:23:39 +0000 (22:23 +0000)] 
Travis CI: also test syncdomain.php

4 years agosyncdomain.php: make --help a valid option
Denis Ovsienko [Wed, 16 Mar 2016 22:15:27 +0000 (22:15 +0000)] 
syncdomain.php: make --help a valid option

This way it exits with the return code 0.

4 years agoUse Cmd+Click to inverse tag selection on OS X 148/head
Oleg Bulatov [Wed, 16 Mar 2016 17:45:03 +0000 (20:45 +0300)] 
Use Cmd+Click to inverse tag selection on OS X

Signed-off-by: Oleg Bulatov <dmage@yandex-team.ru>
4 years agoNexus 7700 models added into dictionary
Alexey Andriyanov [Wed, 16 Mar 2016 14:38:09 +0000 (17:38 +0300)] 
Nexus 7700 models added into dictionary

4 years agotest for empty strings w/o strlen(), pt. 6
Denis Ovsienko [Wed, 16 Mar 2016 09:55:55 +0000 (09:55 +0000)] 
test for empty strings w/o strlen(), pt. 6

* renderObject8021QPorts()
* renderVLANInfo()
* renderObject8021QSyncPreview()
* getImageHREF()
* serializeTags()
* niftyString()
* makeIPAllocLink()
* queryTerminal()
* callScript()
* getUpgradeBatch()
* getDatabaseVersion()
* showUpgradeError()
* renderUpgraderHTML()

4 years agodecrease direct use of $_REQUEST and $sic, pt. 17
Denis Ovsienko [Tue, 15 Mar 2016 16:14:10 +0000 (16:14 +0000)] 
decrease direct use of $_REQUEST and $sic, pt. 17

* addRow()
* updateRack()
* addObjectlog()

4 years agorefine more SQL queries
Denis Ovsienko [Tue, 15 Mar 2016 12:31:34 +0000 (12:31 +0000)] 
refine more SQL queries

Request specific columns like in commit af13d78.

* SLBTriplet::getTriplets()
* addSLBPortLink()
* addSLBIPLink()

4 years agotests: cover ip_get_arpa()
Denis Ovsienko [Tue, 15 Mar 2016 10:32:18 +0000 (10:32 +0000)] 
tests: cover ip_get_arpa()

4 years agotest for empty strings w/o strlen(), pt. 5
Denis Ovsienko [Tue, 15 Mar 2016 07:55:00 +0000 (07:55 +0000)] 
test for empty strings w/o strlen(), pt. 5

* MacroParser::expand()
* addRStoRSPool()
* commitUpdateRS()
* commitUpdateVS()
* concatConfig()

4 years agoros11TranslatePushQueue(): fix Marvell ROS as well
Denis Ovsienko [Mon, 14 Mar 2016 17:22:35 +0000 (17:22 +0000)] 
ros11TranslatePushQueue(): fix Marvell ROS as well

That had been copied from the JunOS code (where it applies) too.

4 years agoeos4TranslatePushQueue: vlan removing from Arista
Alexey Andriyanov [Mon, 14 Mar 2016 16:21:49 +0000 (19:21 +0300)] 
eos4TranslatePushQueue: vlan removing from Arista

A vlan was removed from switch only if it was named. Despite the name
check, it was still removed using the VID, so this check seems
completely useless. Removed it.

4 years agorectify makeWhereSQL()
Denis Ovsienko [Mon, 14 Mar 2016 10:58:23 +0000 (10:58 +0000)] 
rectify makeWhereSQL()

Use implode(), validate input arguments and don't prepend the result
with two extra spaces. Update the tests.

4 years agotests: cover makeWhereSQL()
Denis Ovsienko [Mon, 14 Mar 2016 10:26:53 +0000 (10:26 +0000)] 
tests: cover makeWhereSQL()

4 years agotest for empty strings w/o strlen(), pt. 4
Denis Ovsienko [Sun, 13 Mar 2016 18:27:10 +0000 (18:27 +0000)] 
test for empty strings w/o strlen(), pt. 4

* formatLoggedSpan()
* ios12PickSwitchportCommand()
* fdry5PickInterfaceSubcommand()

4 years agotests: cover 3 script functions
Denis Ovsienko [Sun, 13 Mar 2016 14:35:43 +0000 (14:35 +0000)] 
tests: cover 3 script functions

* saveScript()
* loadScript()
* deleteScript()

4 years agotest for empty strings w/o strlen(), pt. 3
Denis Ovsienko [Sat, 12 Mar 2016 20:19:48 +0000 (20:19 +0000)] 
test for empty strings w/o strlen(), pt. 3

* assertStringArg()
* assertBoolArg()
* findAllEndpoints()
* extractLayout()
* redirectIfNecessary()
* getCellFilter()
* treeApplyFunc()
* considerGivenConstraint()
* scanRealmByText()
* serializeVLANPack()
* getRackCode()
* guessTableStructure()
* universalOpHandler()
* listConstraint()
* formatEntityName()
* getMgmtProtosConfig()

4 years agofixup a few more plurals
Denis Ovsienko [Fri, 11 Mar 2016 14:16:28 +0000 (14:16 +0000)] 
fixup a few more plurals

* showMessageOrError()

4 years agoaddMultiPorts(): fix a PHP warning
Denis Ovsienko [Fri, 11 Mar 2016 14:11:56 +0000 (14:11 +0000)] 
addMultiPorts(): fix a PHP warning

PHP Warning:  Missing argument 7 for commitUpdatePort(), called in
/usr/local/racktables/wwwroot/inc/ophandlers.php on line 935

4 years agouse mkCellA() even more
Denis Ovsienko [Fri, 11 Mar 2016 13:31:49 +0000 (13:31 +0000)] 
use mkCellA() even more

This is another follow-up to commit 6d8424f.

* renderDiscoveredNeighbors()
* addMultipleObjects()

4 years agorectify adding of new objects
Denis Ovsienko [Fri, 11 Mar 2016 11:07:05 +0000 (11:07 +0000)] 
rectify adding of new objects

Update renderAddMultipleObjectsForm() supply and extra form parameter as
MASSCOUNT may be different when the form is generated and when it is
processed. Update addMultipleObjects() to use that and dismiss some
unnecessary code.

4 years agotest for empty strings w/o strlen(), pt. 2
Denis Ovsienko [Fri, 11 Mar 2016 10:23:38 +0000 (10:23 +0000)] 
test for empty strings w/o strlen(), pt. 2

* addPortForwarding()
* addMultiPorts()
* addIPAllocation()
* updateUser()
* addLotOfObjects()
* addRealServers()
* renderVS()
* getPopupSLBConfig()
* updateStickerForCell()
* doSwitchSNMPmining()
* doPDUSNMPmining()

4 years agoaddMultiPorts(): handle invalid input better
Denis Ovsienko [Thu, 10 Mar 2016 18:34:24 +0000 (18:34 +0000)] 
addMultiPorts(): handle invalid input better

When some of the lines in the multi-line input have format errors,
instead of stopping the processing and displaying an exception page
just show a standard one-line message for each such line.

4 years agotests: cover serializeVLANPack()
Denis Ovsienko [Thu, 10 Mar 2016 16:22:35 +0000 (16:22 +0000)] 
tests: cover serializeVLANPack()

4 years agotests: update README and convert to Markdown
Denis Ovsienko [Thu, 10 Mar 2016 11:10:12 +0000 (11:10 +0000)] 
tests: update README and convert to Markdown

4 years agotest for empty strings w/o strlen(), pt. 1
Denis Ovsienko [Thu, 10 Mar 2016 10:52:22 +0000 (10:52 +0000)] 
test for empty strings w/o strlen(), pt. 1

* commitUpdateObject()
* getRackspaceStats()
* generateEntityAutoTags()
* saveScript()
* deleteScript()
* init.php
* renderSLBEntityCell()
* renderRSPool()
* renderRealServerList()
* renderVirtualService()

4 years agodecrease direct use of $_REQUEST and $sic, pt. 16
Denis Ovsienko [Wed, 9 Mar 2016 15:21:53 +0000 (15:21 +0000)] 
decrease direct use of $_REQUEST and $sic, pt. 16

* getPortInfoAJAX()
* index.php

4 years agodecrease direct use of $_REQUEST and $sic, pt. 15
Denis Ovsienko [Tue, 8 Mar 2016 09:51:06 +0000 (09:51 +0000)] 
decrease direct use of $_REQUEST and $sic, pt. 15

* updateIPNameAJAX()
* updateIPCommentAJAX()
* updateCableIdAJAX()

4 years agotests: cover mergeTagChains()
Denis Ovsienko [Mon, 7 Mar 2016 18:50:27 +0000 (18:50 +0000)] 
tests: cover mergeTagChains()

4 years agoprintNiftySelect(): dismiss an unused parameter
Denis Ovsienko [Mon, 7 Mar 2016 17:50:23 +0000 (17:50 +0000)] 
printNiftySelect(): dismiss an unused parameter

4 years agoimportDPData(): amend exception class
Denis Ovsienko [Mon, 7 Mar 2016 17:18:08 +0000 (17:18 +0000)] 
importDPData(): amend exception class

The data in this case comes from the HTTP request hence use IRAE to
signal malformed input.

4 years agodecrease direct use of $_REQUEST and $sic, pt. 14
Denis Ovsienko [Mon, 7 Mar 2016 17:16:37 +0000 (17:16 +0000)] 
decrease direct use of $_REQUEST and $sic, pt. 14

* updatePortRsvAJAX()
* importDPData()
* buildOpspecColumns()

4 years agonextMACAddress(): add input validation
Denis Ovsienko [Sun, 6 Mar 2016 20:51:32 +0000 (20:51 +0000)] 
nextMACAddress(): add input validation

Use a PCRE of its own as RE_L2_IFCFG matches a wider class of strings.
Add more tests.

4 years agomove processGridForm() to where it belongs
Denis Ovsienko [Sat, 5 Mar 2016 21:51:12 +0000 (21:51 +0000)] 
move processGridForm() to where it belongs

4 years agotests: cover nextMACAddress()
Denis Ovsienko [Sat, 5 Mar 2016 21:18:46 +0000 (21:18 +0000)] 
tests: cover nextMACAddress()

4 years agotests: cover l2addressForDatabase()
Denis Ovsienko [Fri, 4 Mar 2016 17:05:46 +0000 (17:05 +0000)] 
tests: cover l2addressForDatabase()

4 years agotests: cover ip4_mask() and ip6_mask()
Denis Ovsienko [Fri, 4 Mar 2016 16:33:09 +0000 (16:33 +0000)] 
tests: cover ip4_mask() and ip6_mask()

4 years agotests: one more for HTTPDateToUnixTime()
Denis Ovsienko [Fri, 4 Mar 2016 16:27:05 +0000 (16:27 +0000)] 
tests: one more for HTTPDateToUnixTime()

4 years agopunctuation
Denis Ovsienko [Fri, 4 Mar 2016 10:00:26 +0000 (10:00 +0000)] 
punctuation

4 years agodecrease direct use of $_REQUEST and $sic, pt. 13
Denis Ovsienko [Fri, 4 Mar 2016 08:08:56 +0000 (08:08 +0000)] 
decrease direct use of $_REQUEST and $sic, pt. 13

* resolve8021QConflicts()

4 years agosuppress more unnecessary arguments
Denis Ovsienko [Thu, 3 Mar 2016 10:42:51 +0000 (10:42 +0000)] 
suppress more unnecessary arguments

4 years agodecrease direct use of $_REQUEST and $sic, pt. 12
Denis Ovsienko [Thu, 3 Mar 2016 10:13:32 +0000 (10:13 +0000)] 
decrease direct use of $_REQUEST and $sic, pt. 12

* querySNMPData()
* addOIFCompatPack()
* delOIFCompatPack()
* del8021QOrder()
* unlinkPort()
* clearVlan()
* deleteVlan()

4 years agofixup a few plurals
Denis Ovsienko [Thu, 3 Mar 2016 09:25:27 +0000 (09:25 +0000)] 
fixup a few plurals

* renderVLANDomainVLANList()
* renderEditVlan()
* renderPortsForObject()
* clearVlan()
* deleteVlan()
* renameObjectPorts()
* renderEditRSPool()
* renderEditVService()
* renderEditVS()

4 years agoadd a missing licensing header
Denis Ovsienko [Thu, 3 Mar 2016 09:05:14 +0000 (09:05 +0000)] 
add a missing licensing header

4 years agofactor interface-8021q.php out
Denis Ovsienko [Wed, 2 Mar 2016 21:54:33 +0000 (21:54 +0000)] 
factor interface-8021q.php out

Move interface functions below to a feature-specific file:

* render8021QOrderForm()
* render8021QStatus()
* renderVLANDomainListEditor()
* renderVLANDomain()
* renderVLANDomainVLANList()
* get8021QPortTrClass()
* renderObject8021QPorts()
* getAccessPortControlCode()
* getTrunkPortCursorCode()
* renderTrunkPortControls()
* renderVLANInfo()
* renderVLANIPLinks()
* renderObject8021QSync()
* renderObject8021QSyncSchedule()
* renderObject8021QSyncPreview()
* renderObject8021QSyncPorts()
* renderVSTListEditor()
* renderVSTRules()
* renderVST()
* renderVSTRulesEditor()
* renderDeployQueue()
* formatVLANPackDiff()
* renderEditVlan()

4 years agorefine a couple SQL queries
Denis Ovsienko [Wed, 2 Mar 2016 12:56:30 +0000 (12:56 +0000)] 
refine a couple SQL queries

Use proper capitalization and request specific columns.

* fetchIPv4AddressNetworkRow()
* fetchIPv6AddressNetworkRow()

4 years agodecrease direct use of $_REQUEST and $sic, pt. 11
Denis Ovsienko [Wed, 2 Mar 2016 08:13:12 +0000 (08:13 +0000)] 
decrease direct use of $_REQUEST and $sic, pt. 11

* addLocation()
* deleteRack()
* cleanRack()
* cloneRSPool()

4 years agorenderEditRSPool(): suppress unnecessary arguments
Denis Ovsienko [Tue, 1 Mar 2016 22:48:22 +0000 (22:48 +0000)] 
renderEditRSPool(): suppress unnecessary arguments

No need to repeat what getOpLink() already does anyway.

4 years agoclarify the search query error message
Denis Ovsienko [Tue, 1 Mar 2016 08:11:21 +0000 (08:11 +0000)] 
clarify the search query error message

Don't throw an exception in searchHandler() as this function is not an
ophandler and there's no special handling for it besides the last-resort
exception trap, which prints only a minimalistic page. Instead handle
the situation locally and present the user with a standard message bar
on the main page.

4 years agorefine exception class in newPortForwarding()
Denis Ovsienko [Mon, 29 Feb 2016 10:11:44 +0000 (10:11 +0000)] 
refine exception class in newPortForwarding()

Throw InvalidArgException and modify addPortForwarding() to convert to
InvalidRequestArgException.

4 years agosimplify addLotOfObjects() further
Denis Ovsienko [Sun, 28 Feb 2016 15:06:43 +0000 (15:06 +0000)] 
simplify addLotOfObjects() further

Omit unnecessary "else" after "return" and unnecessary "continue" at the
cycle end, use mkCellA(), reword an error message.

4 years agofactor TEXTAREA input filtering out
Denis Ovsienko [Sun, 28 Feb 2016 14:37:09 +0000 (14:37 +0000)] 
factor TEXTAREA input filtering out

Replace some of the earliest bits of code with a much cleaner function.
Add some tests.

* textareaCooked(): new function
* addMultiPorts(): update
* addLotOfObjects(): update
* addRack(): update

4 years agotests: cover iosParseVLANString()
Denis Ovsienko [Sat, 27 Feb 2016 15:38:40 +0000 (15:38 +0000)] 
tests: cover iosParseVLANString()

4 years agotests: cover listToRanges()
Denis Ovsienko [Sat, 27 Feb 2016 15:20:13 +0000 (15:20 +0000)] 
tests: cover listToRanges()

4 years agotests: cover buildVLANFilter()
Denis Ovsienko [Sat, 27 Feb 2016 14:53:42 +0000 (14:53 +0000)] 
tests: cover buildVLANFilter()

4 years agoupdate a comment for buildVLANFilter()
Denis Ovsienko [Sat, 27 Feb 2016 10:26:08 +0000 (10:26 +0000)] 
update a comment for buildVLANFilter()

4 years agodecrease direct use of $_REQUEST and $sic, pt. 10
Denis Ovsienko [Sat, 27 Feb 2016 09:29:21 +0000 (09:29 +0000)] 
decrease direct use of $_REQUEST and $sic, pt. 10

* save8021QPorts()

4 years agorectify the code for rack adding
Denis Ovsienko [Fri, 26 Feb 2016 20:52:00 +0000 (20:52 +0000)] 
rectify the code for rack adding

* renderNewRackForm(): update to signal the request origin with just one
  argument and make it mandatory
* addRack(): reflect the change above, decrease direct use of $_REQUEST,
  clean TEXTAREA processing up, use mkCellA() in status messages

4 years agoadd a Travis CI configuration file
Denis Ovsienko [Thu, 25 Feb 2016 21:23:30 +0000 (21:23 +0000)] 
add a Travis CI configuration file

4 years agoadd type guards to array_values_same()
Denis Ovsienko [Thu, 25 Feb 2016 12:00:52 +0000 (12:00 +0000)] 
add type guards to array_values_same()

Unless both arguments to array_diff() are arrays, the function returns
an empty array as if the arguments were arrays and the first one was a
subset of the second. In this case (though there would be a PHP
warning) array_values_same() would return TRUE to indicate no
differences between the arguments.

Add a few tests.

4 years agotests: make the IAE test n-ary
Denis Ovsienko [Thu, 25 Feb 2016 10:59:19 +0000 (10:59 +0000)] 
tests: make the IAE test n-ary

This avoids the hassle of maintaining a separate test/provider method
pair for every value of n.

4 years agorefine a few assertions to test for 'inet4'
Denis Ovsienko [Thu, 25 Feb 2016 08:01:58 +0000 (08:01 +0000)] 
refine a few assertions to test for 'inet4'

In the functions below the assertions would be satisfied with an either
IPv4 or IPv6 address whereas those functions are strictly IPv4-specific.
Nail it down to IPv4.

* addRealServer()
* addVService()
* updateRealServer()
* updateVService()

4 years agorenderRackspaceRowEditor(): add a missing TD
Denis Ovsienko [Wed, 24 Feb 2016 20:17:07 +0000 (20:17 +0000)] 
renderRackspaceRowEditor(): add a missing TD

4 years agodecrease direct use of $_REQUEST and $sic, pt. 9
Denis Ovsienko [Wed, 24 Feb 2016 10:29:22 +0000 (10:29 +0000)] 
decrease direct use of $_REQUEST and $sic, pt. 9

* updateObjectAllocation()
* save8021QPorts()

4 years agorectify acceptable8021QConfig()
Denis Ovsienko [Wed, 24 Feb 2016 09:46:35 +0000 (09:46 +0000)] 
rectify acceptable8021QConfig()

Fix the 'trunk' case to actually look into 'native' and 'allowed'. This
provides better error detection for manual 802.1Q synchronization. Add
some tests.

4 years agoupdate a few functions to use isCheckSet()
Denis Ovsienko [Wed, 24 Feb 2016 08:15:42 +0000 (08:15 +0000)] 
update a few functions to use isCheckSet()

* processGridForm()
* mergeGridFormToRack()
* updateLocation()

4 years agorenderEditLocationForm(): add a LABEL
Denis Ovsienko [Tue, 23 Feb 2016 22:47:22 +0000 (22:47 +0000)] 
renderEditLocationForm(): add a LABEL

4 years agoChangelog line for commit d3dd017a
Alexey Andriyanov [Tue, 23 Feb 2016 20:40:09 +0000 (23:40 +0300)] 
Changelog line for commit d3dd017a

4 years agofix LLDP info for Cisco IOS in cases when remote name is too long:
Boris Lytochkin [Tue, 23 Feb 2016 20:31:42 +0000 (23:31 +0300)] 
fix LLDP info for Cisco IOS in cases when remote name is too long:
 separate known interface names from remote names

4 years agodecrease direct use of $_REQUEST and $sic, pt. 7
Denis Ovsienko [Tue, 23 Feb 2016 17:57:42 +0000 (17:57 +0000)] 
decrease direct use of $_REQUEST and $sic, pt. 7

* addPortForObject()
* addRack()

4 years agofix a PHP warning after commit 19f4c98
Denis Ovsienko [Mon, 22 Feb 2016 22:08:37 +0000 (22:08 +0000)] 
fix a PHP warning after commit 19f4c98

"Missing argument 3 for array_fetch()..."

* setConfigVar()
* setUserConfigVar()
* resetUserConfigVar()

4 years agodecrease direct use of $_REQUEST and $sic, pt. 6
Denis Ovsienko [Mon, 22 Feb 2016 10:32:31 +0000 (10:32 +0000)] 
decrease direct use of $_REQUEST and $sic, pt. 6

* addPortForwarding()
* delPortForwarding()
* updPortForwarding()

4 years agofactor NATv4 protocol options out
Denis Ovsienko [Mon, 22 Feb 2016 10:16:03 +0000 (10:16 +0000)] 
factor NATv4 protocol options out

$natv4_proto: a global list of NATv4 protocol options
renderNATv4ForObject(): feed the new list into printSelect()
genericAssertion(): add a new 'enum/natv4proto' assertion type

4 years agonewPortForwarding(): clarify error messages
Denis Ovsienko [Mon, 22 Feb 2016 10:03:01 +0000 (10:03 +0000)] 
newPortForwarding(): clarify error messages

Was: "Argument 'remoteip_bin' of value is invalid (Non-existent ip)."
Now: "Argument 'remoteip_bin' of value '192.168.0.1' is invalid (address
does not belong to a known network)."