86 Commits
Author SHA1 Message Date
Thomas Vincent 3bcb4e4f49 fix(graphs): [develop] clear empty query fields in rendered text (#8349)
* fix(graphs): clear empty query fields in rendered text

Signed-off-by: Thomas Vincent <thomasvincent@gmail.com>

* ci(coverage): enforce changed PHP statement coverage

Signed-off-by: Thomas Vincent <thomasvincent@gmail.com>

* ci: share changed-code coverage contracts and enforce shell policy

Signed-off-by: Thomas Vincent <thomasvincent@gmail.com>

* fix(ci): run request coverage with portable path matching

Signed-off-by: Thomas Vincent <thomasvincent@gmail.com>

* ci: retain bootstrap coverage and validate request dispatch

Signed-off-by: Thomas Vincent <thomasvincent@gmail.com>

* test: synchronize native coverage fixture dispatch

Signed-off-by: Thomas Vincent <thomasvincent@gmail.com>

* test: measure coverage at the exact PR revision

Signed-off-by: Thomas Vincent <thomasvincent@gmail.com>

---------

Signed-off-by: Thomas Vincent <thomasvincent@gmail.com>
2026-10-15 20:38:03 -04:00
Thomas VincentandTheWitness f2a5ef0d51 fix: cast path_php_binary before passing it to string parameters (#7576) (#7577)
* fix: cast path_php_binary before passing it to string parameters

The setting has no default, so it is null on a fresh install, and PHP 9 turns
the resulting coercion from a deprecation into a TypeError.

Signed-off-by: Thomas Vincent <thomasvincent@gmail.com>

* docs: append the changelog entry at the end of the issue block

Matches .github/copilot-instructions.md, which appends rather than inserting
in numeric order.

Signed-off-by: Thomas Vincent <thomasvincent@gmail.com>

* test: use the full licence header on the new test files

Signed-off-by: Thomas Vincent <thomasvincent@gmail.com>

* fix: cast path_php_binary at every site that escapes it

The first pass covered three of them; a repo-wide scan found 21, and the test
now fails if a new one appears.

Signed-off-by: Thomas Vincent <thomasvincent@gmail.com>

* test: strengthen PHP binary path guard

* fix: cover default-config PHP binary reads

---------

Signed-off-by: Thomas Vincent <thomasvincent@gmail.com>
Co-authored-by: TheWitness <thewitness@cacti.net>
2026-08-06 09:42:52 -04:00
TheWitness 27919c50d7 Updating Copyrights to 2026 (#6578) 2026-01-28 16:11:10 -05:00
TheWitnessandCopilot b993471579 Fix #6539 - Allow Standard Cacti Log Files to be Rotated on Demand,PHPdoc, and Typing (#6540)
* Fix #6539 - Allow Standard Cacti Log Files to be Rotated on Demand from the Cacti UI

* QA: php-cs-fixer updates and documentation for lib/database.php

* QA: Update .gitignore for composer files

* QA: Update .gitignore for composer files

* QA: Back off .gitignore change its duplicated

* QA: Fix typing of db_has_permissions

* QA: Fixing typing issue in db_format_index_create

* Update lib/clog_webapi.php

Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>

* QA: Fix additional code issues

* QA: Applying more defaults to add device

* QA: Fix at the database layer

* QA: Fixes based upon automated testing

* QA: Fix at the database layer

* QA: After new SQL checking

* QA: Skip MacTrack oui database download warnings

* QA: Fixing type issue

* QA: Recommendation from Copilot

* QA: Recommendation from Copilot

* QA: Recommendation from Copilot

* QA: Recommendation from Copilot

* QA: Some minor changes to avoid errors in testing

* QA: Unused variable

* QA: Recommendation from Copilot

* QA: Recommendation from Copilot

* QA: Recommendation from Copilot

* QA: Minor introduced code defect

* QA: Adding some unifying space around concatination

* QA: Consistent comments and new function alias'

* QA: Multi-line comment corrections

* QA: Fix SQL Style

* QA: Missed one function alias

* QA: PHPStan Level 2 and PHPDoc fixes

* QA: PHPStan Level 2 and PHPDoc Fixes

* QA: PHPStan Level 6 Fixes

* QA: Fix lib/xml.php to PHPStan Level 6

* QA: Wrong grep -v

* PHPStan Level 6 for lib/vdef.php

* PHPStan Level 8 for lib/time.php

* QA: Raise PHPStan to Level 6 for lib/database.php

* QA: Remove @deprecated tag from grv()

* QA: Switch to htmle() alias over html_escape()

* QA: More addressing PHPStan issues at Level 6

* QA: Change recommended by Copilot for Readability

* QA: More PHPStan fixes

* QA: More PHPStan fixes

* QA: More PHPStan fixes for lib/utility.php

* QA: More PHPStan fixes at Level 6

* QA: Raise PHPStan to Level 6 More Functions

* QA: Raise PHPStan to Level 6 More Functions

* QA: Raise PHPStan to Level 6 More Functions

* QA: Raise PHPStan to Level 6 More Functions

* QA: Raise PHPStan to Level 6 More Functions

* QA: More PHPStan fixes at Level 6

* QA: Raise PHPStan to Level 6 More Functions

* QA: Raise PHPStan to Level 6 More Functions

* QA: More PHPStan fixes at Level 6

* QA: More PHPStan fixes at Level 6

* QA: Raise PHPStan to Level 6 More Functions

* QA: Raise PHPStan to Level 6 More Functions

* QA: More PHPStan fixes at Level 6

* QA: Raise PHPStan to Level 6 More Functions

* QA: Raise PHPStan to Level 6 More Functions

* QA: More PHPStan fixes at Level 6

* QA: Raise PHPStan to Level 6 More Functions

* QA: Raise PHPStan to Level 6 More Functions

* QA: More PHPStan fixes at Level 6

* QA: More PHPStan fixes at Level 6

* QA: More PHPStan fixes at Level 6

* QA: Raise PHPStan to Level 6 More Functions

* QA: More PHPStan fixes at Level 6

* QA: Some phpseclib3 fixups to update to latest

* QA: More fixups for graphing for magic strings

* QA: More PHPStan fixes at Level 6

* QA: Fixing order string type on get_allowed_graphs()

* QA: Fixing improper use of print

* QA: Optimization of color_templates

* QA: Copilot recommendation

* QA: Copilot recommendation

* QA: Copilot recommendation

* QA: Copilot recommendation

* QA: Copilot recommendation

* QA: Copilot recommendation

* QA: Copilot recommendation

* QA: Copilot recommendation

* QA: Raise PHPStan to Level 6 More Functions

* QA: Issues insalling Cacti

* QA: Issues insalling Cacti

* QA: Issues insalling Cacti

* QA: Issues insalling Cacti

* QA: Issues insalling Cacti

* QA: Issues testing Cacti

* QA: Copilot recommendation

* QA: More PHPStan fixes at Level 6

* QA: More PHPStan fixes at Level 6

* QA: More PHPStan fixes at Level 6

* QA: More PHPStan fixes at Level 6

* QA: More PHPStan fixes at Level 6

* QA: Installer failing

* Undo ownership changes to remove tar errors

* QA: Updates after php-cs-fixer

* QA: Adding code checks to syntax checking

* QA Change syntax flow language

* QA: Reduce the number of cures

* QA: Use sequentional option

* Change runner to self-hosted for check job

* Fix typo in OS version in workflow file

* Add Git installation step in workflow

Added step to install Git if not already installed.

* Add '-y' flag to apt-get install and update commands

Updated apt-get commands to include '-y' for automatic confirmation.

* Change workflow OS version to 'ubuntu-latest'

Updated the workflow to use 'ubuntu-latest' instead of 'ubuntu:latest' and modified the 'runs-on' configuration.

* Remove sequential option from phpcsfixer script

* Remove PHPCS fixer step from workflow

Removed PHP coding standards check from workflow.

* Move code checks to before plugins

Moving these core checks to before the plugins are installed as we really want to check only the base Cacti here.

* Add Composer validation and caching to start of workflow

* QA: Addressing PHPStan additional

* QA: Restore composer lock file

* QA: Addressing PHPStan additional

* QA: Addressing PHPStan additional

* QA: Complete LDAP Project

* QA: php-cs-fixer doing it's thing

* QA: Syntax is already happening in PHPStan

* QA: The md5 function no longer exists

* QA: Update after ldap changes

* QA: Undo that last password hack

* QA: Attempting to switch to MariaDB 11.8

* QA: Attempting to switch to MariaDB 11.8

* QA: Resolving some issues with PHP8.4

* QA: Resolving some issues with PHP8.4

* QA: Add PHP8.5 to the matrix

* QA: Removing PHP8.5 due to dependency issues

* QA: Add the DB version to the testing output

* QA: Switch back to MySQL for the moment

* QA: More fidelity in reporting

* QA: The pipe must be mixed

* QA: Moving audit_schema.php changes from 1.2.x

* QA: Moving audit_schema.php changes from 1.2.x

* QA: Restore mysql monitoring

* QA: php-cs-fixer issues

* QA: Attempt to roll back to MariaDB 10.6

* QA: Attempt to fix check_all_pages.sh

* QA: Make installer functional again

* QA: Fix installer php-cs-fixer issues

* QA: Type to a string

* QA: Get the database version correctly

* QA: Fix issue with reports in check_all_pages.sh

* QA: Check the server version in the right place

* Feature: Support SHA256 as a new hash for passwords

* QA: Function definition and return typing audit

* QA: Refinement of form types

* QA: Refinement of form types

* QA: Consistency of comments

* QA: Issues with php-cs-fixer and more comments

* QA: More typing issues

* QA: php-cs-fixer on merge conflict resolution

---------

Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
2026-01-25 10:13:56 -05:00
TheWitness 3d7cd822b8 QA: Fixing additional files phpdoc specs 2025-11-18 23:22:24 -05:00
TheWitness b9334a15d9 QA: Updates for files for php-cs-fixer and some php-doc changes 2025-11-18 21:01:15 -05:00
TheWitness e5c4015e0e QA: Remove most references to $config
This removes most entries to $config in the base code.  A few new constants were defined to achieve this:

* CACTI_CONNECTION - The status of the current connection
* CACTI_CSRF_SECRET - The path to the csrf secret file
* CACTI_PHP_SNMP - True if php-snmp is installed
* CACTI_WHITELIST - The path to the Cacti Whitelist file if defined

I also moved several $config['poller_id'] to the existing POLLER_ID and move a number of $config['is_web'] to the existing CACTI_WEB constants.

There remain a few artifacts in the code.  They will be handled in a separate commit.
2025-03-22 16:48:59 -04:00
TheWitness 2c779273f9 Copyright Updates and PHP-CS-Fixer updates 2025-03-09 14:34:19 -04:00
Jimmy ConnerandTheWitness 65ab16f5cf Start converting to newer PHP Syntax and Functions (#6103)
* Add Rector

* Add Rector

* Fix "Cashed" misspelling

Also harmonize the phrase with the one below it

* Fix implode error in db_table_create

Only relevant when multiple primary keys

* Fix auth issue, parentheses in the wrong location

Was causing too many arguments to be sent to cacti_sizeof which only take 1, instead of get_allowed_devices.

* Fix issue with session_var not properly using class variable

* Fix pass by reference error in get_allowed_devices

get_allowed_devices has a pass by reference on the "total_rows" field.  It is used in several places to pass the total_rows back to a counter.  Here though, we are passing a number directly to the function, which errors out with "Uncaught Error: get_allowed_devices(): Argument #4 ($total_rows) cannot be passed by reference".  So we will just place a dummy variable in front to catch the pass.

This wasn't caught before because the previous parentheses issue.

* Fix undefined variable "field_array" in html_filter

* Fix undefined function 'get_nfilter_filter_request_var'

* Fix undefined variable 'resizable'

I corrected the function parameter, as that was technically the incorrect spelling

* Fix invalid variable $user_id

* Fix undefined vars in spikekill class

* Fix copy and paste error

Oops

* Forgot to use the dummy variables

* Add missing $

Oops

* Start converting to newer PHP Syntax and Functions

* Test fixing the workflow by install composer

* Lets not valid the composer file right now
Seems we have a few things to fix it in

* Validate composer

* Lite formating changes

* lite formatting

* lite formatting

* lite format changes

* lite format changes

* lite format changes

* lite format changes

* lite format changes

* lite format changes

* lite format changes

* lite format changes

---------

Co-authored-by: TheWitness <thewitness@cacti.net>
2025-02-23 15:14:54 -05:00
Jimmy Conner 49c6c050ca Undefined functions in lib variables 2024-12-09 02:21:27 -06:00
TheWitness 39ae957b02 Fix #5681 - Add poller information to graph-variables
* This feature adds |site_blah| and |poller_blah| variables to the logic.
* Also switch documentation to correct format.
2024-11-09 13:46:27 -05:00
TheWitness 1aa72d24c9 QA: Update Copyright to 2024 2024-02-03 14:18:57 -05:00
Mark Brugnoli-Vinten 32ba2f19f4 Update copyright year for 2023 2023-01-03 20:34:26 +00:00
Mark Brugnoli-Vinten 8b29d12cc9 Define cacti system paths as constants for better code checking (#5120)
This also provides a full run of src-fixer against all files to
ensure all code is now in alignment.

Closes #5120
2023-01-01 01:03:15 +00:00
Mark Brugnoli-Vinten 22ae5bccec Allow admin emails to utilise CLOG-style ID to name/link replacements (#4157)
Closes #4157
2022-12-09 20:32:49 +00:00
Mark Brugnoli-Vinten a9ae2363a1 Add host_poller_id replacement variable (#5039)
Closes #5039
2022-12-09 14:38:35 +00:00
TheWitness 1d007b94a9 Fixing #4748 and #4743 (#4750) 2022-05-01 12:57:22 +01:00
TheWitness 82b229db9e Updating Copyright to 2022. 2022-02-06 17:16:20 -05:00
kim-fitnessandMark Brugnoli-Vinten 232aeb914e Fix bug #4259 (#4260)
Co-authored-by: Mark Brugnoli-Vinten <netniv@hotmail.com>
2021-05-14 17:56:54 +01:00
kim-fitness bdc353e96b Fix issue #4251 (#4252) 2021-05-11 18:02:40 +01:00
TheWitness df54a4a3f3 Updating copright years 2021-01-01 20:28:58 -05:00
TheWitness a100bee170 Fixing Issues #3915 and #3916
- Certain Device actions cause the removal of poller items from the remote data collector
- Bulk Enabling Devices takes forever

Need to check a few more cases before completely resolved.
2020-11-20 21:06:43 -05:00
TheWitness 749d52bb39 Update Relative to Issue #3579
If a graph has already been given a name, and the data query fails, don't change the name.  The should correct the issue in #3579, while at the same time correcting this issue.
2020-05-30 15:49:26 -04:00
3ca9a34146 Fix #3579, It is strange that many graphs show as 'Empty Graph' (#3586)
* Fix #3496, percent sign(%) is doubled in graph item of AREA type with text

* feature #3513, Add hooks for plugins to show customize graph source and customize template url

* feature #3513, Update changelog, Add hooks for plugins to show customize graph source and customize template url

* 3579, Fix it is strange that many graphs show as 'Empty Graph'.

* 3579, update change log

* 3586, Add the change log.

Co-authored-by: yboliu <yboliu@oc8636837557.ibm.com>
Co-authored-by: Mark Brugnoli-Vinten <netniv@hotmail.com>
2020-05-29 12:07:17 +01:00
TheWitness 9121e3a2b4 Fixing Issue #3478
Data Query Re-Index is not optimal causing very long Re-Index times
2020-04-19 15:39:13 -04:00
TheWitness 4d9f057726 Fixing Issue #1551
Allow uptime to be a variable for use with graphs using |host_uptime|
2020-03-21 22:39:17 -04:00
netniV 4fa9a68fb3 Update copyright to 2020 2020-01-12 12:19:49 +00:00
cigamit cc3f5cc207 Resolving Issue #2998
Session performance issues due to excessive use for database storage
2019-10-02 04:54:14 -05:00
cigamit 9b95f93d47 Resolving Issue #2656
This has finally fixed the issue.  Was specific to Aggregate Graphs.
2019-06-23 20:48:04 -05:00
netniV 47e0ec3f32 Add hook for expanding titles, enables plugin-specific expansion 2019-03-30 17:14:35 +00:00
netniV 308292e2d7 Update copyright notices for 2019 2019-01-25 08:05:00 +00:00
cigamit 8d0b05c5d2 Place check in correct location 2019-01-12 14:56:39 -06:00
cigamit 79ce305732 Resolve potential undefined variable issues 2019-01-12 13:20:38 -06:00
cigamit 05b972da12 Early morning crack at #1981
I've changed the logic ever so slightly.
2018-10-10 01:59:46 -05:00
cigamit 1af5f1a58d More audits related to Issue #1921
Mainly formatting for readability
2018-10-09 07:25:45 -05:00
cigamit 3731477fb3 Another crack at issue #1921
Just adding some doco and some safer checks.
2018-10-09 07:19:33 -05:00
cigamit 19f248226a Don't break name/title when an index is not found
For Data Sources and Graphs don't break the name or title when the index
is no longer found.
2018-09-30 12:56:49 -05:00
cigamit 664510b2ef Minor format changes for readability 2018-09-24 18:05:21 -05:00
Mark Brugnoli-Vinten 1ca32862a9 Resolving issue #1920 (#1922)
* Resolving issue #1920

* Minor QA issue
2018-09-14 20:59:52 -05:00
cigamit 85e33abdf8 More changes around site branches #122
Marking this one complete.  Will log a new issue to create Location
branches under site branches.
2018-05-12 15:37:57 -05:00
cigamit 62615311b5 Merge remote-tracking branch 'refs/remotes/origin/develop' into feature/1.2.x
# Conflicts:
#	docs/CHANGELOG
2018-01-06 14:08:07 -06:00
Tony Roman 519b35f5cd Update copyright to 2018 2018-01-06 09:10:15 -05:00
cigamit f6510d6805 Add physical location to the device
Add the location column to the host table and form objects.  This will
allow one additional level to the Site tree branches.
2017-12-27 20:24:03 -06:00
Wolfgang Stöggl 4a1a15d72c Correct spelling of RRDtool (#1038)
- Change RRDTool -> RRDtool with a lowercase t.
- Replace in all files except *.mo, *.po, *.pot
2017-10-16 11:32:05 -04:00
cigamit c862851b7e Optimizations around data input methods
No functional changes
2017-05-13 11:08:34 -05:00
Tony Roman 8a179d7d7f Fix up to move if elseif else blocks to PSR 2017-05-07 19:57:36 -04:00
patrick d000013aff RRD optimisations
- Added missing globals
- Removed unused globals
- Optimised rrdtool_function_create()
2017-05-02 10:20:20 +02:00
patrick bad78eb1e0 Optimisations for lib/variables.php
- Multiple str_replace() calls combined to one
2017-04-22 00:12:12 +02:00
cigamit f955b89e48 Resolving Issue #460
Add external_id to host variables
2017-03-21 19:35:19 -05:00
Tony Roman 35a5988f41 Update source code files copyright to new year 2017-01-01 13:45:29 -05:00