Commit Graph
182 Commits
Author SHA1 Message Date
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 b9334a15d9 QA: Updates for files for php-cs-fixer and some php-doc changes 2025-11-18 21:01:15 -05:00
TheWitness 685d4b9357 Start addressing PHPStan Issues 2025-03-23 14:09:11 -04: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
TheWitness 5417fae42e Fix: #3766 - Mass Archive from Front-End
This first pass does the following:
* Moves archiving into the API
* Adds an archive function for Device Templates
* Moves package.php functions into lib/package.php
* Moves several create table syntax to the db_update_table use
* Creates a new table to hold Package Archives
*  Enhances filter_value() to present a tooltip
* Add the homepage to the host_template table required for archiving.
* Fixes a PHP8 deprecation warning in sqltable_to_php.php

ToDo: Includes:
* Restoral UI
* Export UI
2024-12-12 15:43:14 -05:00
TheWitness b2200dc039 QA: #5965 - Pull in metadata from the packages
* Only doing this to speed up legacy conversion.
2024-12-11 18:30:43 -05:00
TheWitness 0f27b986b0 QA: #5965 - Moving more into core library 2024-12-11 16:15:38 -05:00
TheWitness 4cc779b26d QA: #5965 - More Package Defaults
* Defaults for replace_svalues, remove_orphans, and package_location
* Make trust signature work between repo and local files
* Move some functions into core import functions
* Accept trusted tokens from different sources
2024-12-11 15:51:52 -05:00
TheWitness 6fbe67168e Fix: #5212 - Generalized Gradient Support
* Gradient Support drops Alpha transparency values from Areas and Does not Support Stack
2024-12-01 22:05:10 -05:00
TheWitness f947a6a918 Fix #5931 - Connect data_input_data to data source and host
Make it easier to connect content in the table data_input_data to the host and data source
2024-11-28 20:39:56 -05:00
TheWitness 8f0ff5d5e7 feature: Add class, and version columns for Graph Template
* This feature enhancement will support the upcoming release of the streams feature in Cacti.
* Expect more updates related to this feature enhancement.
2024-11-28 15:36:25 -05:00
Linegod c3b176780f typos 2024-11-24 23:22:15 -06:00
Jimmy Conner 12df1a4ea7 Move variable to fix undefined in error message 2024-09-07 13:42:54 -04:00
TheWitness 588c72bf85 Merge pull request from GHSA-7cmj-g5qc-pj88
* QA: Fixing Package Import CVE

For now, we will only accept the Cacti public keys until such time as we are a registered CNA and have the ability to verify third parties or we make other arrangements.

* QA: The keys in our package have trailing spaces
2024-05-20 08:33:00 -04:00
TheWitness 1b75ca3cc0 Revert "Merge pull request from GHSA-7cmj-g5qc-pj88"
This reverts commit eff35b0ff2.
2024-05-20 08:31:42 -04:00
Petr Macek eff35b0ff2 Merge pull request from GHSA-7cmj-g5qc-pj88 2024-04-07 15:25:58 +01:00
TheWitness 1aa72d24c9 QA: Update Copyright to 2024 2024-02-03 14:18:57 -05:00
TheWitness d8a2a1ac84 Fixing #5462 - Preview Remove Orphans
Package preview apparently making changes to Cacti Templates or there is a Caching issue
2023-08-20 14:11:42 -04:00
TheWitness 38a9311d98 Fixing #5426 - Fix Broken Data Templates on Import
Importing a legacy Data Query Template can result in the Template being unusable
2023-07-27 18:06:15 -04:00
TheWitness 8f6c385273 Fixing #5392 - Template Import Issues
Template import should not end with php error
2023-07-01 12:04:04 -04:00
TheWitness ce99b7e9f6 QA: Correct import SQL Error 2023-04-05 20:33:56 -04:00
TheWitness 402242861f Porting #5259 - Issues with Data Template and Graphs
When the Data Template contains more Data Sources than the Graph Template RRDfiles won't update
2023-04-01 12:34:22 -04:00
TheWitness ca7a352286 QA: Porting 1.2.24 Changes back to the Develop Branch (#5246) 2023-02-24 03:48:31 +00:00
TheWitness 0a1cb642d1 Fixing #5168 Misleading Import 2023-01-18 20:10:26 -05:00
Mark Brugnoli-Vinten 6ad0512b45 Some light function documentation and src alignment 2023-01-08 00:59:25 +00:00
TheWitness ddf859ed9d Fixing Issue #5127 import errors 2023-01-03 19:18:44 -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
TheWitness cec3b56d41 Sync the develop branch with 1.2.x branch 2022-12-17 12:20:42 -05:00
netniV dc20aeec38 Introduce development version detection 2022-11-25 02:28:43 +00:00
TheWitness f47dca2e05 QA: Instrumentation to resolve dependency issues 2022-11-12 13:13:09 -05:00
TheWitness 9d63c3bb47 QA: On Template Import
* Since we force the size and image format on import now, don't warn for these differences
2022-11-12 12:18:36 -05:00
TheWitness 24dc8af33d QA on #4991 - One additional inconsistency 2022-11-08 08:09:04 -05:00
TheWitness f0b81b8a5b QA: Selectable import was broken 2022-11-05 15:39:59 -04:00
TheWitness af2daa1ca0 QA: Resolve some issues with older or damaged packages 2022-10-16 17:50:48 -04:00
TheWitness d0f5393aae QA for #4762 - Make sure new files are displayed 2022-10-15 16:26:34 -04:00
TheWitness d60ca2d5ec QA: Make lib/import.php compatible with old packages 2022-10-15 15:52:03 -04:00
TheWitness f6a123d0fe QA on #4820 - Add more messages and show dependencies 2022-10-09 23:17:46 -04:00
TheWitness 4fb20aa8ec Fixing Issue #4820 - Selective iimport
When importing, make it possible to only import certain components
2022-10-09 17:48:17 -04:00
TheWitness efdcb915c2 QA: on #4944
We have to check the string length as the improper use of the SHA256 generates some annoying errors.
2022-10-08 13:48:16 -04:00
TheWitness 2c1f773053 Change the default algo to SHA256 2022-10-07 19:30:19 -04:00
TheWitness 170c582150 Fixing Issue #4938 - Package Import
Fixing interim release QA issue related to package import.
2022-10-05 20:17:17 -04:00
TheWitness 6095f731c2 More changes to support package import from the GUI 2022-10-02 16:51:47 -04:00
TheWitness 80cc1a31ee QA, wrong column for image format 2022-10-01 13:55:35 -04:00
TheWitness 6e6a8a9a3a More changes to support #4820
Add support for package import from third part packages, also add the following import overrides when done through the GUI:

* image_format
* graph_width
* graph_height
2022-09-18 16:45:15 -04:00
TheWitness eb8de782d6 Fixing Issue #4820 - Selective Import Feature
- Make it possible to only import certain components when importing packages
- This change is a pre-requisite for the upcoming Package plugin
2022-06-10 22:43:28 -04:00
TheWitness a9a92c65cc Fixing #4757 and documenting #4756 (#4758) 2022-05-04 01:05:10 +01:00