67 Commits
Author SHA1 Message Date
Thomas VincentandTheWitness 5ea5dbd693 Confine index.php external-link content includes (#7687)
* Confine index.php external-link content includes

render_external_links() built the include path as
include/content/<contentfile> and required it after only a file_exists()
check. contentfile comes from the external_links table, so a '../' value
included an arbitrary local file. Resolve and confine the path to
include/content the way link.php already does, and html_escape the
contentfile in the iframe src and error message.

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

* Escape only the filename in the not-found message and guard the test offsets

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

---------

Signed-off-by: Thomas Vincent <thomasvincent@gmail.com>
Co-authored-by: TheWitness <thewitness@cacti.net>
2026-08-16 20:39:10 -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 b9334a15d9 QA: Updates for files for php-cs-fixer and some php-doc changes 2025-11-18 21:01:15 -05:00
TheWitness ac0c1c5c45 Switch from include to require 2025-04-03 14:37:02 -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
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
netniV 4e381cf485 Add PHPCS standards file for test purposes 2022-11-25 15:27:07 +00:00
netniV dc20aeec38 Introduce development version detection 2022-11-25 02:28:43 +00:00
TheWitness 82b229db9e Updating Copyright to 2022. 2022-02-06 17:16:20 -05:00
TheWitness df54a4a3f3 Updating copright years 2021-01-01 20:28:58 -05:00
netniV 4fa9a68fb3 Update copyright to 2020 2020-01-12 12:19:49 +00:00
cigamit 7c5f813807 Resolving Issue #2830
Disabled Top/Bottom external links should not be displayed
2019-07-18 20:04:45 -05:00
cigamit 00d47b4e45 Resolving a number of validation errors 2019-05-22 17:39:34 -05:00
netniV 308292e2d7 Update copyright notices for 2019 2019-01-25 08:05:00 +00:00
cigamit 1acf9d322b Additional visual issues with paper-plane 2019-01-12 15:28:24 -06:00
netniV 862824730a Make 'hide console' a checkbox 2018-12-30 20:36:45 +00:00
cigamit d9d054322d Minor visual correction 2018-09-23 19:23:11 -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 637c436182 Introduce Cacti Beta Constant
This will make it clear to users that they are running a beta version of
Cacti
2018-09-02 09:43:46 -05:00
Tony Roman 519b35f5cd Update copyright to 2018 2018-01-06 09:10:15 -05: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
Patrick 4617c60a02 Various updates (#1016)
* Updated Dutch translations
- 1007 translations remaining (70% translated)
- Typo fixes

* Fix for #1005

* Schema changes
- Examined queries without key usage and added/changed some keys

* Fixed some missing i18n
2017-10-07 13:05:12 -04:00
Tony Roman 27045ea52d Fixup install process to streamline releases
- Added and moved code to CACTI_VERSION constant
 - Merged cacti versions and hash codes array to have one place to add versions
 - Moved cacti version to file to facitate automation needs
 - Cleaned up cli database upgrade script
2017-05-01 08:58:29 -04:00
Patrick 9499d3bcbb Small optimisations and bugfixes:
auth.php:
- placed result of get_selected_theme() in var

functions.php:
- mailer():
  - fetch date from setting by caching method
  - read_config_option('settings_from_email') unnecessary
  - 2x undefined function $mail->replyTo() (should be addReplyTo())
- calculate_percentiles()
  - Final return statement has undeclared variable; I believe this should be results instead of result, but could not reproduce

index.php:
- only fetch the fields needed for querying external_links
- 2x </td> instead of </tr>
2017-04-04 11:42:28 +02:00
cigamit dfe219fd60 Resolving Issue #223
Case where user has not set the $poller_id in config.php
2017-01-19 16:38:19 -06:00
cigamit 2c3201233b More recovery/remote testing 2017-01-16 15:40:00 -06:00
cigamit 9070b2d3e0 More Recovery mode testing 2017-01-16 15:19:09 -06:00
cigamit fe3e899a28 Recovery mode testing 2017-01-16 14:50:46 -06:00
cigamit a8c560966a Correcting spelling and grammar issues 2017-01-12 19:09:16 -06:00
Tony Roman 35a5988f41 Update source code files copyright to new year 2017-01-01 13:45:29 -05:00
cigamit 89fe14427a More embelishment on what is supported and what is not. 2016-12-30 17:38:36 -06:00
cigamit 12733571e1 A few more wording changes. 2016-12-30 17:30:19 -06:00
cigamit b1b0dcdad3 Some console help for Remote Data Collectors 2016-12-30 17:26:32 -06:00
cigamit 2b8fde0474 Remove some bold lettering 2016-12-27 22:28:49 -06:00
cigamit a4f72265ac Add a note to the console when we are a remote poller 2016-12-27 14:35:54 -06:00
cigamit 39af17cca8 adding external link support to cacti 2016-07-10 19:02:09 -05:00
cigamit 4d4e92a2d1 minor syntax issues 2016-07-04 16:51:47 -05:00
Browniebraun 425478d486 i18n updates 2016-04-24 22:53:05 +02:00
Micke2k d188f1631d Change Copyright year 2015 -> 2016 2016-01-29 21:46:02 +04:00
Jimmy Conner 5bde3da972 1) Update Copyright Years Correct a few minor CY Issues
2) Allow Locking/UnLocking of Graphs
3) ToolTips
4) Correct Minor Issues with Login/Out/Permission associated with Theme JS
5) Upgrade jQuery which has Fixes for Major issue in Safari 7/8.1

git-svn-id: svn+ssh://repo.cacti.net/var/data/svnroot/cacti/cacti/branches/0.8.8@7662 860744bd-22fc-0310-8c96-e9fe5004b5ca
2015-01-04 01:52:50 +00:00
Jimmy Conner 5646c33484 A little bit of cleanup
Change double quotes to single quotes where possible
Move to prepared statements were possible
Fix line endings on a few files

git-svn-id: svn+ssh://repo.cacti.net/var/data/svnroot/cacti/cacti/branches/0.8.8@7609 860744bd-22fc-0310-8c96-e9fe5004b5ca
2014-12-25 07:00:57 +00:00
Tony Roman d82550439a Now with Themes!
git-svn-id: svn+ssh://repo.cacti.net/var/data/svnroot/cacti/cacti/branches/0.8.8@7480 860744bd-22fc-0310-8c96-e9fe5004b5ca
2014-11-08 19:14:29 +00:00
Andreas Braun 0a67496c07 deprecation of $colors array
git-svn-id: svn+ssh://repo.cacti.net/var/data/svnroot/cacti/cacti/branches/0.8.8@7479 860744bd-22fc-0310-8c96-e9fe5004b5ca
2014-11-05 06:03:18 +00:00
Tony Roman 65be30ffe0 Update copyright to 2014
git-svn-id: svn+ssh://repo.cacti.net/var/data/svnroot/cacti/cacti/branches/0.8.8@7437 860744bd-22fc-0310-8c96-e9fe5004b5ca
2014-03-30 19:54:50 +00:00
Tony Roman ce40281901 Update copyright to 2013 for 0.8.8
git-svn-id: svn+ssh://repo.cacti.net/var/data/svnroot/cacti/cacti/branches/0.8.8@7386 860744bd-22fc-0310-8c96-e9fe5004b5ca
2013-07-21 23:00:42 +00:00
Tony Roman a257958a0b Update copyright to 2012
git-svn-id: svn+ssh://repo.cacti.net/var/data/svnroot/cacti/cacti/branches/0.8.7@7016 860744bd-22fc-0310-8c96-e9fe5004b5ca
2012-02-27 07:04:37 +00:00