Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

* add ability to add multiple ip addresses to objects using pattern x… #187

Open
wants to merge 139 commits into
base: maintenance-0.20.x
Choose a base branch
from
Open

Commits on Nov 28, 2016

  1. * add ability to add multiple ip addresses to objects using pattern x…

    ….x.x.x-x
    pumamd committed Nov 28, 2016
    Configuration menu
    Copy the full SHA
    e316717 View commit details
    Browse the repository at this point in the history

Commits on May 18, 2017

  1. Configuration menu
    Copy the full SHA
    832453d View commit details
    Browse the repository at this point in the history
  2. display MySQL warnings in debug mode

    This optional means of debugging can provide a feedback loop when the
    strict SQL mode is not enabled.
    
    * collectMySQLWarnings(): new function to buffer the warnings
    * usePreparedInsertBlade(): amend to call the above
    * usePreparedDeleteBlade(): idem
    * usePreparedUpdateBlade(): idem
    * showMySQLWarnings(): new function to display the buffer
    * index.php: call the above in the "redirect" case
    infrastation committed May 18, 2017
    Configuration menu
    Copy the full SHA
    1acbe86 View commit details
    Browse the repository at this point in the history
  3. Configuration menu
    Copy the full SHA
    710bb27 View commit details
    Browse the repository at this point in the history

Commits on May 19, 2017

  1. suppress some more unnecessary default values

    Amend respective test to fail the right way.
    
    * usePreparedDeleteBlade()
    * usePreparedUpdateBlade()
    infrastation committed May 19, 2017
    Configuration menu
    Copy the full SHA
    83ea38a View commit details
    Browse the repository at this point in the history
  2. Configuration menu
    Copy the full SHA
    ef82cfc View commit details
    Browse the repository at this point in the history
  3. Configuration menu
    Copy the full SHA
    2d07e59 View commit details
    Browse the repository at this point in the history
  4. set Port.label to NULL instead of an empty string

    This is how it was originally intended (also update the sample dataset).
    
    * commitAddPortReal(): use nullIfEmptyStr()
    * commitUpdatePortReal(): idem
    * upgrade.php: queue an UPDATE for 0.21.0
    infrastation committed May 19, 2017
    Configuration menu
    Copy the full SHA
    e984d86 View commit details
    Browse the repository at this point in the history
  5. simplify a few functions

    * lastInsertID(): use PDOStatement::fetchColumn()
    * getIPv4Stats(): idem
    * getIPv6Stats(): idem
    * getRackspaceStats(): idem
    * sortPortList(): use array_fetch()
    infrastation committed May 19, 2017
    Configuration menu
    Copy the full SHA
    07d22ce View commit details
    Browse the repository at this point in the history

Commits on May 23, 2017

  1. refine renderPortsForObject()

    Convert a repeated code block to a function, fixup a TD alignment,
    simplify portlet rendering, do not show the multiport form if
    permissions would not allow to submit.
    infrastation committed May 23, 2017
    Configuration menu
    Copy the full SHA
    70c0cb0 View commit details
    Browse the repository at this point in the history
  2. Configuration menu
    Copy the full SHA
    8844171 View commit details
    Browse the repository at this point in the history
  3. Configuration menu
    Copy the full SHA
    bb216c1 View commit details
    Browse the repository at this point in the history

Commits on May 24, 2017

  1. Configuration menu
    Copy the full SHA
    ecd0c5a View commit details
    Browse the repository at this point in the history
  2. better display objects that have no common name

    Address a long-standing glitch: when a port on the currently displayed
    object was (or was suggested to be) linked to a port of an object that
    had no name, the displayed remote object name would be an empty string.
    This change makes the interface display a standard substitute instead,
    which among other things makes the remote object hyperlink clickable.
    
    * fetchPortList(): add remote object type ID to the result columns
    * renderObjectPortRow(): make use of formatObjectDisplayedName()
    * renderPortsForObject(): idem
    * findSparePorts(): all of the above
    infrastation committed May 24, 2017
    Configuration menu
    Copy the full SHA
    f4d00fa View commit details
    Browse the repository at this point in the history

Commits on May 25, 2017

  1. Configuration menu
    Copy the full SHA
    a637466 View commit details
    Browse the repository at this point in the history
  2. upgrade CodeMirror from 3.24 to 5.26.0

    For simpler maintenance the RackTables-specific CSS modifications now
    reside in css/codemirror/rackcode.css. Do not include the CSS, HTML,
    JavaScript, PHP and SQL CodeMirror tokenizers anymore as they had not
    proved to be useful.
    infrastation committed May 25, 2017
    Configuration menu
    Copy the full SHA
    d765a3d View commit details
    Browse the repository at this point in the history

Commits on May 26, 2017

  1. remove remaining stray props of CodePress

    This completes the changes done in commit cf5da67.
    
    * renderRackCodeEditor()
    * renderTextEditor()
    infrastation committed May 26, 2017
    Configuration menu
    Copy the full SHA
    03102e0 View commit details
    Browse the repository at this point in the history
  2. improve CodeMirror integration

    Reimplement the RackCode language mode in rackcode.js using simpler
    JavaScript code and define a standalone "rackcode" theme in rackcode.css
    instead of overriding the default theme. In renderRackCodeEditor() pass
    more properties to CodeMirror constructor and make minor HTML fixups.
    In renderRackCodeViewer() rewrite the code to use CodeMirror in read-only
    mode and to scroll to requested line on request. Amend the URL format in
    refRCLineno() respectively.
    infrastation committed May 26, 2017
    Configuration menu
    Copy the full SHA
    5ceaa17 View commit details
    Browse the repository at this point in the history

Commits on May 30, 2017

  1. fix a typo in README.md

    infrastation committed May 30, 2017
    Configuration menu
    Copy the full SHA
    35d895b View commit details
    Browse the repository at this point in the history

Commits on Jun 2, 2017

  1. replace a couple default values with explicit ones

    There is no reason to specify a default value for $input_name in
    printTagsPickerInput() and printTagsPickerUl() so long as
    printTagsPicker() is the only function that calls those functions.
    infrastation committed Jun 2, 2017
    Configuration menu
    Copy the full SHA
    6cf6a09 View commit details
    Browse the repository at this point in the history
  2. Configuration menu
    Copy the full SHA
    837ad4a View commit details
    Browse the repository at this point in the history

Commits on Jun 6, 2017

  1. refine delivery of rack thumb images

    A read-only RackTables instance would display an error image instead of
    the thumbnail image for any rack that has invalidated thumbnail cache.
    This change makes it deliver the thumbnail even if the attempted cache
    update failed because of insufficient database permissions.
    
    * RTDBTableAccessDenied: a new exception class
    * convertPDOException(): add a respective case block for the error code
    * dispatchMiniRackThumbRequest(): use the above for its REPLACE and
      update the comment
    infrastation committed Jun 6, 2017
    Configuration menu
    Copy the full SHA
    6eb70f0 View commit details
    Browse the repository at this point in the history
  2. Configuration menu
    Copy the full SHA
    336e7e6 View commit details
    Browse the repository at this point in the history

Commits on Jun 16, 2017

  1. Configuration menu
    Copy the full SHA
    20e1804 View commit details
    Browse the repository at this point in the history
  2. cover comments too in IPv4 search (Mantis#1773)

    * getIPv4PrefixSearchResult()
    fstuck37 authored and infrastation committed Jun 16, 2017
    Configuration menu
    Copy the full SHA
    ed4484b View commit details
    Browse the repository at this point in the history
  3. improve the previous change

    Do the same for IPv6 and make a ChangeLog entry.
    
    * getIPv4PrefixSearchResult()
    * getIPv6PrefixSearchResult()
    infrastation committed Jun 16, 2017
    Configuration menu
    Copy the full SHA
    cf72025 View commit details
    Browse the repository at this point in the history
  4. spell a public class method as public

    Keep it consistent with the other declarations in the file.
    infrastation committed Jun 16, 2017
    Configuration menu
    Copy the full SHA
    0a7ffbe View commit details
    Browse the repository at this point in the history
  5. decrease direct use of $_REQUEST and $sic, pt. 20

    * updateObjectAttributes()
    infrastation committed Jun 16, 2017
    Configuration menu
    Copy the full SHA
    8bdd76e View commit details
    Browse the repository at this point in the history
  6. make the object properties form more user-friendly

    updateObjectAttributes() used to feed each new attribute value to MySQL
    connection and let it raise an exception for an invalid input. The
    exception would be dispatched as a hard error with the MySQL error
    codes and a stack trace page.
    
    Improve this by making calls to genericAssertion() as required and
    converting any resulting IRAE exceptions to a human-readable form.
    
    Add helper methods getValue() and getReason() to InvalidArgException.
    infrastation committed Jun 16, 2017
    Configuration menu
    Copy the full SHA
    dfc8176 View commit details
    Browse the repository at this point in the history

Commits on Jun 20, 2017

  1. printPDOException(): refine some text

    In this context the class name is always PDOException.
    infrastation committed Jun 20, 2017
    Configuration menu
    Copy the full SHA
    b4fb59f View commit details
    Browse the repository at this point in the history

Commits on Jun 23, 2017

  1. refine displaying of attributes

    formatAttributeValue() was initially purposed for objects and when it
    yielded a hyperlink it would hard-code "page=depot" into it. When the
    function was later reused for racks, rows and locations, this logic
    didn't deliver working URLs.
    
    Add necessary checks such that this feature only tries to work when it
    can work, add a date format mouse hint, add minimal reporting of RackCode
    parsing errors and move some code around for clarity.
    
    Modify the functions below as required:
    * renderRow()
    * renderRackInfoPortlet()
    * renderObject()
    * renderSearchResults()
    * renderLocationPage()
    infrastation committed Jun 23, 2017
    Configuration menu
    Copy the full SHA
    5b90820 View commit details
    Browse the repository at this point in the history
  2. refine editing of attributes

    It used to be possible to map "date" attributes to racks, rows and
    locations, but the properties editor would not know how to handle
    those attributes in particular and would not make permission checks
    correctly in general.
    
    This change addresses those issues by replacing four similar code
    blocks with one new function that can handle all types of attributes
    for all types of objects and makes necessary permission checks.
    
    * renderEditAttributeTRs(): a new universal function
    * renderEditRowForm(): use the new function instead of custom local code
    * renderEditObjectForm(): idem
    * renderEditRackForm(): idem
    * renderEditLocationForm(): idem
    * updateObjectAttributes(): update request argument checks to match
      what the current implementation puts into the form
    infrastation committed Jun 23, 2017
    Configuration menu
    Copy the full SHA
    5ff78af View commit details
    Browse the repository at this point in the history
  3. don't call getConfigVar('EXT_IPV4_VIEW') too often

    Specifically, not inside foreach.
    
    * renderObject()
    * renderIPForObject()
    infrastation committed Jun 23, 2017
    Configuration menu
    Copy the full SHA
    e9446e3 View commit details
    Browse the repository at this point in the history

Commits on Jun 27, 2017

  1. renderObject(): make rackspace portlet conditional

    Original idea by Lucas Aimaretto.
    infrastation committed Jun 27, 2017
    Configuration menu
    Copy the full SHA
    3a24387 View commit details
    Browse the repository at this point in the history

Commits on Jul 2, 2017

  1. Configuration menu
    Copy the full SHA
    1c48fd7 View commit details
    Browse the repository at this point in the history

Commits on Jul 3, 2017

  1. Added link to SDK in error

    Added link to SDK project page in error message when python package is not installed.
    bpothier authored and infrastation committed Jul 3, 2017
    Configuration menu
    Copy the full SHA
    f686aa8 View commit details
    Browse the repository at this point in the history

Commits on Jul 4, 2017

  1. scanIPSpace: optimize SQL for fetching last log

    Use the same WHERE filter in subquery. Changed functions:
    - scanIPv4Space
    - scanIPv6Space
    andriyanov authored and infrastation committed Jul 4, 2017
    Configuration menu
    Copy the full SHA
    e28c58a View commit details
    Browse the repository at this point in the history

Commits on Jul 6, 2017

  1. Configuration menu
    Copy the full SHA
    0238500 View commit details
    Browse the repository at this point in the history
  2. Configuration menu
    Copy the full SHA
    3c01397 View commit details
    Browse the repository at this point in the history
  3. refine some code in markBestSpan()

    Remove an unused global, declare arrays before the first use, use foreach
    instead of hard-coded index range, spell comparison with zero, eliminate
    a redundant variable and use array_search().
    infrastation committed Jul 6, 2017
    Configuration menu
    Copy the full SHA
    655da69 View commit details
    Browse the repository at this point in the history

Commits on Jul 7, 2017

  1. simplify rackModificationPermitted()

    Don't do the work permitted() already does internally and clarify control
    flow. This eliminates two variables.
    infrastation committed Jul 7, 2017
    Configuration menu
    Copy the full SHA
    c910f77 View commit details
    Browse the repository at this point in the history
  2. refine some table formatting

    * renderRackspaceRowEditor()
    * renderRackSortForm()
    infrastation committed Jul 7, 2017
    Configuration menu
    Copy the full SHA
    34f5d4e View commit details
    Browse the repository at this point in the history
  3. Configuration menu
    Copy the full SHA
    a688bfd View commit details
    Browse the repository at this point in the history
  4. refine a couple error messages

    * proxyCactiRequest()
    * proxyMuninRequest()
    infrastation committed Jul 7, 2017
    Configuration menu
    Copy the full SHA
    3f047ad View commit details
    Browse the repository at this point in the history
  5. put usort_portlist() right (GH #199)

    The input to sortPortList() is an array of arrays, if it is an array of
    anything else the function (since commit 07d22ce) will use array_fetch()
    on the elements anyway, causing issues downstream. Vladimir Sukhonosov
    had reported numerous PHP warnings in this regard.
    
    Fix usort_portlist() to feed proper argument into sortPortList().
    infrastation committed Jul 7, 2017
    Configuration menu
    Copy the full SHA
    37095aa View commit details
    Browse the repository at this point in the history
  6. check argument type in array_fetch()

    If the argument is not an array, it is a bug in the code as arguments to
    that function come from other functions, not directly from user input.
    Raise an exception before the broken code makes any [more] damage. Add
    more tests.
    infrastation committed Jul 7, 2017
    Configuration menu
    Copy the full SHA
    d2ae1e0 View commit details
    Browse the repository at this point in the history

Commits on Jul 10, 2017

  1. Configuration menu
    Copy the full SHA
    d4efef5 View commit details
    Browse the repository at this point in the history

Commits on Jul 13, 2017

  1. Configuration menu
    Copy the full SHA
    c7be1b9 View commit details
    Browse the repository at this point in the history
  2. Configuration menu
    Copy the full SHA
    475f4da View commit details
    Browse the repository at this point in the history
  3. omit the PHP closing tag at EOF in all PHP files

    "If a file is pure PHP code, it is preferable to omit the PHP closing tag
    at the end of the file. This prevents accidental whitespace or new lines
    being added after the PHP closing tag, which may cause unwanted effects
    because PHP will start output buffering when there is no intention from
    the programmer to send any output at that point in the script."
    -- PHP manual
    infrastation committed Jul 13, 2017
    Configuration menu
    Copy the full SHA
    f48482e View commit details
    Browse the repository at this point in the history
  4. Configuration menu
    Copy the full SHA
    f5b9c21 View commit details
    Browse the repository at this point in the history
  5. RTSNMPDevice: handle SNMP versions stricter

    There is no gain in assuming that if SNMP version is not 1, not 2 and
    not 3, it means it is 1. Keep it simple.
    infrastation committed Jul 13, 2017
    Configuration menu
    Copy the full SHA
    2864fb8 View commit details
    Browse the repository at this point in the history

Commits on Jul 14, 2017

  1. only use the PHP opening tag once per file

    There used to be a few code blocks that switched PHP interpreting on and
    off with PHP tags, convert those to use either heredoc or plain echo as
    that is the usual syntax for this purpose elsewhere in the code. Fixup
    some indentation while at it.
    
    * renderInstallerHTML()
    * renderInterfaceHTML()
    * renderIndex()
    * dragon()
    * renderSNMPPortFinder()
    * renderPopupHTML()
    * printStatic404()
    * renderUpgraderHTML()
    infrastation committed Jul 14, 2017
    Configuration menu
    Copy the full SHA
    1cfcac1 View commit details
    Browse the repository at this point in the history

Commits on Jul 17, 2017

  1. detect and handle an internal error properly

    In fetchAttrsForObjects() throw an exception on an unknown attribute
    type as that situation cannot have a reasonable default workaround.
    infrastation committed Jul 17, 2017
    Configuration menu
    Copy the full SHA
    3b4c094 View commit details
    Browse the repository at this point in the history
  2. fix isInteger() and add some tests

    is_numeric() can test numeric strings but it accepts floats as well
    because that's the way it is defined to work; is_int() tests for an
    integer. Combine those two to make isInteger() really do what it claims.
    infrastation committed Jul 17, 2017
    Configuration menu
    Copy the full SHA
    0f5c598 View commit details
    Browse the repository at this point in the history
  3. Configuration menu
    Copy the full SHA
    06d7052 View commit details
    Browse the repository at this point in the history
  4. Configuration menu
    Copy the full SHA
    df611f3 View commit details
    Browse the repository at this point in the history
  5. use BLOB to store rack thumbnail images

    The contents of RackThumbnail.thumb_data used to be Base64-encoded but
    the column itself does not require it as it is a BLOB so dismiss the
    encoding and just store and read the image as it is. Delete all rows
    from RackThumbnail.
    
    * loadThumbCache(): rename to loadRackThumbCache()
    * saveRackThumbCache(): new helper function for consistency
    * dispatchMiniRackThumbRequest(): update to use the above
    infrastation committed Jul 17, 2017
    Configuration menu
    Copy the full SHA
    01cbc42 View commit details
    Browse the repository at this point in the history

Commits on Jul 18, 2017

  1. make more unsigned integer check fixups

    * isUnsignedInteger(): a new helper function that better matches the
      problem space than isInteger(), with tests
    * assertUIntArg(): simplify by using the above
    * setConfigVar(): the function would mistakenly accept float values for
      "uint" configuration variables, fix the check
    * setUserConfigVar(): idem
    infrastation committed Jul 18, 2017
    Configuration menu
    Copy the full SHA
    db8d58a View commit details
    Browse the repository at this point in the history
  2. Configuration menu
    Copy the full SHA
    d8f3e96 View commit details
    Browse the repository at this point in the history
  3. add colored tags

    This add colors to object depot, rack diagram, rack thumbnails and IPSpace.
    The color depends on the tags assigned to an entity.
    Each tag could be assigned one color. Multiple colors are displayed as a sharp gradient.
    
    * listCells(), spotEntity(), getTagList(), commitUpdateTag(),
      renderTagRowForViewer(), printObjectDetailsForRenderRack(), renderRack(),
      renderDepot(), renderIPNetwork(), buildTagCheckboxRows(), updateTag(),
      printRackThumbImage(), renderTagTreeEditor(), enableTagsPicker(),
      getTagClassName(): add color
    * objstyle_cache, color: new global variable
    * isHTMLColor(), getColorSelect(), assertHTMLColorArg(),
      colorHex2Rgb(), getObjectClass(), setEntityColors(), destroyTag(),
      coloredObject(): new function
    * genericAssertion(): add types "htmlcolor" and "htmlcolor0"
    * rebuildTagChainForEntity(): clear RackThumbs on color change
    * JS generateTagList(): add color class
    Maik Ehinger authored and infrastation committed Jul 18, 2017
    Configuration menu
    Copy the full SHA
    25526a9 View commit details
    Browse the repository at this point in the history

Commits on Jul 19, 2017

  1. Configuration menu
    Copy the full SHA
    a7c7af6 View commit details
    Browse the repository at this point in the history
  2. refine the SQL column type for tag colour

    MySQL char(6) can contain any string including a hex notation of a 24-bit
    RGB colour. With this storage type the PHP code should check if the value
    is valid every time it reads the column, and if the value is invalid
    there is no good way to deal with it as the invalid value could have been
    stored a long time ago and it could be caused by a bug in a
    non-interactive script so there is nowhere to put the blame.
    
    Based on the prior experience it is better to eliminate this place for an
    error earliest possible, do this by switching to an unsigned 24-bit
    integer type in the MySQL table, this way any non-NULL value stored in
    the column is always valid and any attempt to store an invalid value will
    fail at one or another level immediately so there is a feedback loop now.
    
    * get_pseudo_file(): update CREATE TABLE
    * upgrade.php: modify ALTER TABLE
    * getTagList(): amend SELECT to convert to hex at server side
    * commitUpdateTag(): amend column conversion
    * $opspec_list: refine declarations for tagtree-edit-createTag
    * isHTMLColor(): reduce to a small unary function and add tests
    * HTMLColorForDatabase(): new converter function with tests
    * HTMLColorFromDatabase(): idem
    * assertHTMLColorArg(): simplify and merge into genericAssertion()
    infrastation committed Jul 19, 2017
    Configuration menu
    Copy the full SHA
    f7686eb View commit details
    Browse the repository at this point in the history
  3. isInteger(): add helper code around is_numeric()

    The previous commit passed the tests on PHP 7 but not on PHP 5 due to the
    difference in is_numeric(). Make it work the same on both PHP versions
    and add some more tests.
    infrastation committed Jul 19, 2017
    Configuration menu
    Copy the full SHA
    6f3dfa8 View commit details
    Browse the repository at this point in the history
  4. make some code style fixups

    * rebuildTagChainForEntity()
    * setEntityColors()
    * buildTagCheckboxRows()
    * coloredObject()
    infrastation committed Jul 19, 2017
    Configuration menu
    Copy the full SHA
    1c09455 View commit details
    Browse the repository at this point in the history
  5. fixup indentation

    adoom42 authored and infrastation committed Jul 19, 2017
    Configuration menu
    Copy the full SHA
    fa389d0 View commit details
    Browse the repository at this point in the history

Commits on Jul 20, 2017

  1. Configuration menu
    Copy the full SHA
    0f13d32 View commit details
    Browse the repository at this point in the history
  2. refine NATv4 address selector popup

    * getAllIPv4Allocations(): fetch one more column and fixup SQL formatting
    * renderPopupIPv4Selector(): improve formatting like in commit f4d00fa
    * sortTokenize(): don't call count() more often than required, use
      isUnsignedInteger() and numCompare()
    infrastation committed Jul 20, 2017
    Configuration menu
    Copy the full SHA
    21c8b04 View commit details
    Browse the repository at this point in the history
  3. makeWhereSQL(): do not specify a default value

    All arguments to this function are mandatory, also amend the tests.
    infrastation committed Jul 20, 2017
    Configuration menu
    Copy the full SHA
    36e3ad3 View commit details
    Browse the repository at this point in the history
  4. rename syncObjectPorts() to replaceObjectPorts()

    This way the code in doSwitchSNMPmining() and doPDUSNMPmining() is much
    easier to understand.
    infrastation committed Jul 20, 2017
    Configuration menu
    Copy the full SHA
    5580b16 View commit details
    Browse the repository at this point in the history
  5. colorHex2Rgb(): try a different RGB math

    This should fix the color SELECT in some browsers.
    Maik Ehinger authored and infrastation committed Jul 20, 2017
    Configuration menu
    Copy the full SHA
    213ea1e View commit details
    Browse the repository at this point in the history
  6. renderTagRowForViewer(): fixup some markup

    In the tag tree viewer apply tag class to the tag name only rather than
    to the whole TR, this is consistent with the tag filter portlet and does
    not conflict with the viewer sometimes using the TR to signal additional
    information (a warning or not assignable) about the tag.
    infrastation committed Jul 20, 2017
    Configuration menu
    Copy the full SHA
    4fd21be View commit details
    Browse the repository at this point in the history
  7. colorHex2Rgb(): round floats to integers

    Firefox accepted "rgb(127.5,127.5,255)" but Chrome [properly] didn't:
    
    "The format of an RGB value in the functional notation is 'rgb(' followed
    by a comma-separated list of three numerical values (either three integer
    values or three percentage values) followed by ')'." -- CSS spec
    
    Add some tests.
    infrastation committed Jul 20, 2017
    Configuration menu
    Copy the full SHA
    c3fe089 View commit details
    Browse the repository at this point in the history
  8. Added extra hooks to commitUpdateObject() (#204)

    ...to give plugin devs more options to interact.
    jeroenvermeulen authored and infrastation committed Jul 20, 2017
    Configuration menu
    Copy the full SHA
    1c117bd View commit details
    Browse the repository at this point in the history
  9. Configuration menu
    Copy the full SHA
    cf940ca View commit details
    Browse the repository at this point in the history

Commits on Jul 23, 2017

  1. Configuration menu
    Copy the full SHA
    ffccae6 View commit details
    Browse the repository at this point in the history

Commits on Jul 24, 2017

  1. fixup some PHP lettercase

    * string_insert_hrefs()
    * email_regex_simple()
    * getOptionTree()
    * setEntityColors()
    * renderRackSortForm()
    * printRackThumbImage()
    infrastation committed Jul 24, 2017
    Configuration menu
    Copy the full SHA
    1d44a1e View commit details
    Browse the repository at this point in the history
  2. Configuration menu
    Copy the full SHA
    8dd68ee View commit details
    Browse the repository at this point in the history
  3. Added extra hooks to renderIPv4NetworkAddresses and renderIPv6Network…

    …Addresses
    
    to allow plugin devs to extend/change the functionality of the IP list.
    Jeroen Vermeulen authored and infrastation committed Jul 24, 2017
    Configuration menu
    Copy the full SHA
    5731b2c View commit details
    Browse the repository at this point in the history
  4. Configuration menu
    Copy the full SHA
    97d8533 View commit details
    Browse the repository at this point in the history
  5. Configuration menu
    Copy the full SHA
    c2a49f7 View commit details
    Browse the repository at this point in the history

Commits on Jul 25, 2017

  1. use a CSS class for L2 addresses

    * pi.css
    * renderDataIntegrityReport()
    * renderObjectPortRow()
    infrastation committed Jul 25, 2017
    Configuration menu
    Copy the full SHA
    bba495f View commit details
    Browse the repository at this point in the history
  2. renderDataIntegrityReport(): simplify some code

    Switch some tables from hard-coded HTML to renderTableViewer().
    infrastation committed Jul 25, 2017
    Configuration menu
    Copy the full SHA
    66eece6 View commit details
    Browse the repository at this point in the history

Commits on Jul 27, 2017

  1. improve travis_setup_mysql.sh

    With this change the script does not require the RackTables top
    directory to be the current working directory anymore. Also it runs the
    last query as root to avoid the password warning -- the next stages will
    find it out anyway whether MySQL credentials work as expected.
    infrastation committed Jul 27, 2017
    Configuration menu
    Copy the full SHA
    d0d43dc View commit details
    Browse the repository at this point in the history

Commits on Jul 29, 2017

  1. refactor plugin architecture

    move cacti and munin code into plugins
    adoom42 committed Jul 29, 2017
    Configuration menu
    Copy the full SHA
    011df35 View commit details
    Browse the repository at this point in the history

Commits on Jul 30, 2017

  1. refine the new plugins code a bit

    * getPlugins(): don't use "SELECT *"
    * getPlugin(): idem
    * formatPluginState(): use array_fetch()
    * renderPluginConfig(): use renderTableViewer()
    * renderPluginEditor(): idem and use "&&"
    * installPlugin(): use the assertion result instead of a global
    * uninstallPlugin(): idem
    * upgradePlugin(): idem
    
    Remove the PHP closing tag from the new PHP files.
    infrastation committed Jul 30, 2017
    Configuration menu
    Copy the full SHA
    174084c View commit details
    Browse the repository at this point in the history
  2. Configuration menu
    Copy the full SHA
    28d3bb4 View commit details
    Browse the repository at this point in the history
  3. Configuration menu
    Copy the full SHA
    ad847bd View commit details
    Browse the repository at this point in the history

Commits on Jul 31, 2017

  1. renderPluginEditor(): add permission checks

    Only show individual controls and the warning when respective permission
    check would allow the action. This way what the user sees is much likely
    to be what they can use.
    infrastation committed Jul 31, 2017
    Configuration menu
    Copy the full SHA
    c8c64b1 View commit details
    Browse the repository at this point in the history
  2. implement a new "dateonly" assertion type

    * SQLDateFromDateStr(): new function with tests
    * genericAssertion(): add respective case blocks
    * resetUIConfig(): amend as necessary
    * install.php: idem
    * upgrade.php: idem
    infrastation committed Jul 31, 2017
    Configuration menu
    Copy the full SHA
    22d3f0f View commit details
    Browse the repository at this point in the history
  3. cmpSQLDates(): new function with tests

    This is a new helper function, the current code base does not use it
    right now but it may come handy later.
    infrastation committed Jul 31, 2017
    Configuration menu
    Copy the full SHA
    f159c46 View commit details
    Browse the repository at this point in the history
  4. improve renderDataIntegrityReport() a little more

    In the triggers section add the entries below to the list of known
    triggers and compare the list with the items in the schema both ways.
    Use renderTableViewer() to display the difference.
    
    * EntityLink-before-insert
    * EntityLink-before-update
    
    In the foreign keys section make a similar change and amend the new
    plugins to return their lists of FKs in the new format.
    
    * RackThumbnail-FK-rack_id
    * VLANDomain-FK-group_id
    infrastation committed Jul 31, 2017
    Configuration menu
    Copy the full SHA
    f24df83 View commit details
    Browse the repository at this point in the history

Commits on Aug 1, 2017

  1. simplify some more functions

    * renderSimpleTableWithOriginViewer(): use renderTableViewer()
    * renderPortOIFViewer(): idem
    * renderChapter(): idem and clean ref. counter processing up
    infrastation committed Aug 1, 2017
    Configuration menu
    Copy the full SHA
    94826ae View commit details
    Browse the repository at this point in the history
  2. simplify SQL in loadRackThumbCache()

    RackThumbnail.thumb_data is not intended to be NULL, in the unlikely
    case it is NULL just let the bug propagate and become visible elsewhere
    so it can be fixed.
    infrastation committed Aug 1, 2017
    Configuration menu
    Copy the full SHA
    1019f70 View commit details
    Browse the repository at this point in the history
  3. Configuration menu
    Copy the full SHA
    f0fe0da View commit details
    Browse the repository at this point in the history

Commits on Aug 2, 2017

  1. Configuration menu
    Copy the full SHA
    4c5f6ef View commit details
    Browse the repository at this point in the history
  2. refine setEntityColors()

    Use in_array() instead of array_key_exists() to make the check actually
    work. Do not return any result as it is wasted anyway. Eliminate a
    temporary variable.
    infrastation committed Aug 2, 2017
    Configuration menu
    Copy the full SHA
    c0d0c56 View commit details
    Browse the repository at this point in the history
  3. tests: improve TagFunctionsTest

    Move all read-only tests into one method to avoid duplicating the class
    fixtures. Supply an array argument to usePreparedDeleteBlade() to make
    use of SQL IN(). Assign some colours to the fixture tags and add a basic
    read-only test to cover setEntityColors().
    infrastation committed Aug 2, 2017
    Configuration menu
    Copy the full SHA
    a433b26 View commit details
    Browse the repository at this point in the history
  4. fixup rack thumb colours processing

    Make the state code in coloredObject() a mandatory parameter and update
    printRackThumbImage() to make sure it is always properly set. This
    restores the colour-based highlighting for objects that don't have any
    colours associated through assigned tags. Reduce the footprint of the
    colour list argument. Prune and rearrange some code for clarity.
    infrastation committed Aug 2, 2017
    Configuration menu
    Copy the full SHA
    3c1e6a8 View commit details
    Browse the repository at this point in the history

Commits on Aug 3, 2017

  1. tests: add support for PHPUnit 6

    Change all RackTables test case classes to extend RTTestCase. Have two
    PHPUnit bootstrap files to declare the new intermediate class two
    different ways: one for versions 4 & 5 and another for version 6 (the
    common part is in its own file and there is a symlink to default to
    versions 4 & 5 when PHPUnit is run from the command line). In express.sh
    auto-detect PHPUnit version and use respective bootstrap file.
    infrastation committed Aug 3, 2017
    Configuration menu
    Copy the full SHA
    9448907 View commit details
    Browse the repository at this point in the history
  2. Travis CI: add PHPUnit 6 to the build matrix

    Add PHP 7.0 and 7.1, which come with PHPUnit 6. Allow 7.1 job to fail as
    RackTables still has known issues with it.
    infrastation committed Aug 3, 2017
    Configuration menu
    Copy the full SHA
    352bbb3 View commit details
    Browse the repository at this point in the history
  3. tests: refine PortTriggerTest

    Update the comment and address the following feedback from PHPUnit 6:
    
    There were 2 risky tests:
    1) PortTriggerTest::testUniqueMacAddSame
    This test did not perform any assertions
    2) PortTriggerTest::testUniqueMacUpdateSame
    This test did not perform any assertions
    infrastation committed Aug 3, 2017
    Configuration menu
    Copy the full SHA
    f82e096 View commit details
    Browse the repository at this point in the history
  4. tests: refine RenderDepotTest

    Add an error message and fixup code style.
    infrastation committed Aug 3, 2017
    Configuration menu
    Copy the full SHA
    e5c54d4 View commit details
    Browse the repository at this point in the history

Commits on Aug 4, 2017

  1. refine DELETE in commitUpdateTag()

    Also update the global tag list to keep it consistent.
    infrastation committed Aug 4, 2017
    Configuration menu
    Copy the full SHA
    50712c6 View commit details
    Browse the repository at this point in the history
  2. generate rack thumbs independently of the headers

    Move the thumbnail content caching code from
    dispatchMiniRackThumbRequest() to a new function,
    getCachedMiniRackThumbImage(), which can be called more than once per
    HTTP request or from a CLI script.
    infrastation committed Aug 4, 2017
    Configuration menu
    Copy the full SHA
    f903908 View commit details
    Browse the repository at this point in the history
  3. tests: improve RackspaceFunctionsTest

    Share the row fixture among the tests and add basic tests for rack
    thumbnails.
    infrastation committed Aug 4, 2017
    Configuration menu
    Copy the full SHA
    162fc31 View commit details
    Browse the repository at this point in the history

Commits on Aug 6, 2017

  1. tests: allow to override PHPUnit binary name

    In Fedora 26 PHPUnit version 6 is available as the package "phpunit6",
    which provides the binary "phpunit6". Make the changes to express.sh to
    enable a custom PHPUnit binary like below:
    
    $ PHPUNIT=phpunit6 ./tests/express.sh
    infrastation committed Aug 6, 2017
    Configuration menu
    Copy the full SHA
    494e426 View commit details
    Browse the repository at this point in the history

Commits on Aug 7, 2017

  1. Configuration menu
    Copy the full SHA
    66b176b View commit details
    Browse the repository at this point in the history
  2. tests: refine the rack thumbnails test

    When loading the image two times, test that the values are equal.
    infrastation committed Aug 7, 2017
    Configuration menu
    Copy the full SHA
    edb0cf6 View commit details
    Browse the repository at this point in the history

Commits on Aug 8, 2017

  1. use quoting for some schema object names

    The conceptual purpose of usePreparedDeleteBlade() is to delete a
    specific, well-defined set of rows from a table. However, Maik Ehinger in
    his tag colour code had pointed it out that a hack allowed to delete all
    rows from a table like this:
    
    usePreparedDeleteBlade ('TableName', array ('1' => '1'));
    
    Enforce the originally intended semantics in usePreparedDeleteBlade() and
    update the other two SQL helper functions for consistency. Update
    existing tests and add new tests.
    
    * assertListOfColumnNames(): new function to test if the list items look
      reasonably similar to SQL column names
    * makeSetSQL(): replace the previously existing test, which produced a
      generic message, with the new function; escape SQL columns names and
    	add some spacing for readability
    * makeWhereSQL(): idem
    * usePreparedInsertBlade(): escape the table name and switch to
      INSERT ... SET syntax to reuse the code in makeSetSQL()
    * usePreparedDeleteBlade(): leave the previously existing test, which
      produces a specific message, before the new test; escape the table name
    * usePreparedUpdateBlade(): idem
    infrastation committed Aug 8, 2017
    Configuration menu
    Copy the full SHA
    756009b View commit details
    Browse the repository at this point in the history
  2. specify a secondary class around the tag selector

    This provides a temporary means for some users to hide the TD that
    contains the tag selector in their RackTables installation. See the
    discussion on racktables-users by Gerardo Ferreyra and Helen Browne.
    
    * renderRackspace()
    * renderDepot()
    * renderIPSpace()
    * renderCellList()
    infrastation committed Aug 8, 2017
    Configuration menu
    Copy the full SHA
    d4e27fe View commit details
    Browse the repository at this point in the history

Commits on Aug 9, 2017

  1. fix deleting of tags after commit 756009b

    The call to usePreparedDeleteBlade() in destroyTag() [expectedly] started
    to trigger an exception. However, that call didn't do any useful work
    in the first place because a foreign key does not allow to delete a row
    from TagTree if there are any dependent rows in TagStorage, this way if a
    tag can be deleted it means it is not assigned to any rack or object and
    hence its colour does not make any difference to any rack thumbnail.
    
    Without the call that truncates RackThumbnail destroyTag() has no purpose
    anymore so delete it and leave the $opspec_list declaration to do the job
    through tableHandler() as before.
    infrastation committed Aug 9, 2017
    Configuration menu
    Copy the full SHA
    272e0a2 View commit details
    Browse the repository at this point in the history
  2. Configuration menu
    Copy the full SHA
    abef97a View commit details
    Browse the repository at this point in the history

Commits on Aug 10, 2017

  1. update ChangeLog for release 0.20.14

    Conflicts:
    ChangeLog
    infrastation committed Aug 10, 2017
    Configuration menu
    Copy the full SHA
    68c740d View commit details
    Browse the repository at this point in the history
  2. 0.20.14: cut the release

    Conflicts:
    wwwroot/inc/config.php
    infrastation committed Aug 10, 2017
    Configuration menu
    Copy the full SHA
    e85e7da View commit details
    Browse the repository at this point in the history
  3. Revert "copy complete 0.20.x releases only into master"

    This reverts commit 710bb27.
    infrastation committed Aug 10, 2017
    Configuration menu
    Copy the full SHA
    c908c32 View commit details
    Browse the repository at this point in the history

Commits on Aug 11, 2017

  1. formally retire support for PHP older than 5.5

    RackTables used to require PHP 5.2.10 or later for several years. As soon
    as PHP versions 7.x are the default now it is wrong to claim support for
    something that the upstream itself does not support anymore (5.5 is the
    oldest supported version on php.net). This upcoming change was announced
    on racktables-users on 2017-07-21 and nobody has objected so let's go
    ahead.
    
    From now on it is OK to _improve_ RackTables PHP code in ways that break
    it on PHP versions 5.2/5.3/5.4 only.
    infrastation committed Aug 11, 2017
    Configuration menu
    Copy the full SHA
    27bac28 View commit details
    Browse the repository at this point in the history
  2. make use of the nowdoc string literal syntax

    Out of 47 heredoc strings only 11 actually involved PHP variable
    interpolation. To make it easier to see what to expect from a random
    long literal, denote genuine 11 heredoc instances with double quotes and
    convert the other 36 instances to nowdoc.
    
    This syntax was introduced in PHP 5.3.0.
    infrastation committed Aug 11, 2017
    Configuration menu
    Copy the full SHA
    a6e090f View commit details
    Browse the repository at this point in the history
  3. Configuration menu
    Copy the full SHA
    eea39b5 View commit details
    Browse the repository at this point in the history

Commits on Aug 14, 2017

  1. Travis CI: test PHP 7.0 only once

    After the testing environment upgrade PHP "7.0" is no longer 7.0.16 or
    newer (with PHPUnit 6), it is 7.0.7 with PHPUnit 5, for whatever reason,
    so do not run two PHP 7.0 jobs. PHP 7.1 job has PHPUnit 6 and RackTables
    PHPUnit tests can sort themselves out whichever PHPUnit version it is.
    infrastation committed Aug 14, 2017
    Configuration menu
    Copy the full SHA
    d72da15 View commit details
    Browse the repository at this point in the history

Commits on Aug 15, 2017

  1. Configuration menu
    Copy the full SHA
    cbc9fd2 View commit details
    Browse the repository at this point in the history
  2. inline checkColumnOfRadios8021Q()

    * renderObject8021QSyncPreview(): move the custom JavaScript code here
    infrastation committed Aug 15, 2017
    Configuration menu
    Copy the full SHA
    cde7764 View commit details
    Browse the repository at this point in the history
  3. put renderObject8021QSyncPorts() right

    This fixes the "802.1Q sync" tab, which was broken; see commit 37095aa.
    infrastation committed Aug 15, 2017
    Configuration menu
    Copy the full SHA
    8f9feaa View commit details
    Browse the repository at this point in the history

Commits on Aug 16, 2017

  1. Configuration menu
    Copy the full SHA
    f01b069 View commit details
    Browse the repository at this point in the history

Commits on Aug 21, 2017

  1. change some L2 address format processing

    Make the L2 address regexps strictly uppercase because they are used to
    match all-uppercase strings.
    
    In l2addressForDatabase() add handling of IP-over-InfiniBand L2 addresses
    (20 bytes long). Change the SunOS-specific notation to apply to MAC
    addresses only. It used to apply to WWN addresses too, most likely due to
    a copy-and-paste change, and can be restored if there is a genuine use
    case for it.
    
    Resize the text inputs in renderPortsForObject() for IPoIB L2 addresses.
    
    Change l2addressFromDatabase() to reject addresses that it would be
    impossible to have in the database by normal means.
    
    Rearrange some code for readability and update comments. Add and update
    tests as necessary.
    infrastation committed Aug 21, 2017
    Configuration menu
    Copy the full SHA
    97792a8 View commit details
    Browse the repository at this point in the history

Commits on Aug 22, 2017

  1. improve L2 address integrity checks

    In renderDataIntegrityReport() add another check to look for L2 addresses
    that have invalid length (there is already an existing check for invalid
    characters). Declare and reuse table columns definitions.
    infrastation committed Aug 22, 2017
    Configuration menu
    Copy the full SHA
    53f8e01 View commit details
    Browse the repository at this point in the history

Commits on Aug 24, 2017

  1. tests: factor the suffixes out to a helper method

    Implement RTTestCase::myString() and update the tests to use it instead
    of copying code around.
    infrastation committed Aug 24, 2017
    Configuration menu
    Copy the full SHA
    aec4c86 View commit details
    Browse the repository at this point in the history

Commits on Aug 27, 2017

  1. Configuration menu
    Copy the full SHA
    1bba27d View commit details
    Browse the repository at this point in the history

Commits on Aug 28, 2017

  1. split getObjectClass() into three functions

    getObjectClass() used to do three different jobs and to accept two to
    three arguments, of which the first was always a constant. Split its code
    into three smaller and better focused functions with less arguments and
    replace a global with a static. Also in the gradient definition convert
    the percentage from float to integer to avoid potential issues in future
    (see commit c3fe089).
    
    * getObjectClass(): unary or binary function
    * getTagClass(): unary function
    * getCachedCSSClassForStyle(): binary function
    * renderTagRowForEditor(): update as necessary
    * getColorSelect(): ditto
    * getTagClassName(): ditto
    * enableTagsPicker(): ditto
    * setEntityColors(): ditto
    * printObjectDetailsForRenderRack(): ditto
    * renderRack(): ditto
    * renderDepot(): ditto
    * renderIPSpaceRecords(): ditto
    infrastation committed Aug 28, 2017
    Configuration menu
    Copy the full SHA
    5abb804 View commit details
    Browse the repository at this point in the history
  2. getOutputOf(): stop buffering on exception

    When the worker function outputs its contents normally, the calling
    function needs the contents only, the buffer itself is removed, which
    is right. When the worker function throws, don't just discard the
    contents, remove the buffer too.
    infrastation committed Aug 28, 2017
    Configuration menu
    Copy the full SHA
    792704c View commit details
    Browse the repository at this point in the history
  3. tests: simplify RenderDepotTest

    Test that renderDepot() has not returned an empty string, it is not much
    but more than the mere fact the function managed to return without an
    exception. Leave output buffer management to getOutputOf() and exception
    handling -- to PHPUnit.
    
    This change makes it possible to see that this test failure on PHP 7.1 is
    actually an error (as much as PHPUnit distinguishes "failures" and
    "errors") and it occurs the same way on both PHPUnit 5 and PHPUnit 6:
    
    There was 1 error:
    
    1) RenderDepotTest::testRenderDepot
    session_start(): Cannot send session cookie - headers already sent by
    (output started at /usr/share/php/PHPUnit6/Util/Printer.php:112)
    infrastation committed Aug 28, 2017
    Configuration menu
    Copy the full SHA
    216fc00 View commit details
    Browse the repository at this point in the history
  4. tests: ask PHPUnit to output to stderr, not stdout

    This removes interference with RackTables code trying to send HTTP
    headers (with session_start() at least) and should fix RenderDepotTest
    on PHP 7.1.
    infrastation committed Aug 28, 2017
    Configuration menu
    Copy the full SHA
    a86d900 View commit details
    Browse the repository at this point in the history

Commits on Aug 29, 2017

  1. loadConfigDefaults(): use intval()

    This is one of the changes required for compatibility with PHP 7.1, it
    reduces the number of test cases errored due to the warning below and
    should fix RenderDepotTest, which was still erroring because of the
    output started by the non-numeric warnings.
    
    PHP Warning:  A non-numeric value encountered in .../functions.php
    on line 5414
    infrastation committed Aug 29, 2017
    Configuration menu
    Copy the full SHA
    272a945 View commit details
    Browse the repository at this point in the history
  2. emptyStrIfZero(): a new helper function with tests

    * renderNewRackForm()
    * renderEditRSList()
    * renderNewVSForm()
    infrastation committed Aug 29, 2017
    Configuration menu
    Copy the full SHA
    d3e838c View commit details
    Browse the repository at this point in the history
  3. dismiss a few unnecessary calls to intval()

    In renderVLANDomainListEditor() $dominfo['group_id'] is either NULL or a
    string representation of an unsigned integer. Both kinds of values will
    evaluate without the conversion as expected in printNiftySelect() and its
    worker functions.
    
    In renderEmptyResults() and getPageNumOfIPv6() the value originates from
    getConfigVar(), which makes the conversion because the configuration
    variable is declared "uint", hence the call is a no-op.
    infrastation committed Aug 29, 2017
    Configuration menu
    Copy the full SHA
    7c91a82 View commit details
    Browse the repository at this point in the history
  4. Configuration menu
    Copy the full SHA
    71349ba View commit details
    Browse the repository at this point in the history

Commits on Aug 31, 2017

  1. Configuration menu
    Copy the full SHA
    935b674 View commit details
    Browse the repository at this point in the history
  2. addLotOfIPAllocation

    root committed Aug 31, 2017
    Configuration menu
    Copy the full SHA
    9d55764 View commit details
    Browse the repository at this point in the history
  3. * show wattage usage on Objects page

    root committed Aug 31, 2017
    Configuration menu
    Copy the full SHA
    7d54bcc View commit details
    Browse the repository at this point in the history