Commit Graph
499 Commits
Author SHA1 Message Date
patrick 90e1a468e8 issue: Fix date separator character 2017-06-14 17:45:44 +02:00
cigamit d155a03aee Resolve potential corner case around time in state and lack of snmp support. 2017-06-11 18:12:22 -05:00
cigamit 37a5a7791a Resolving Issue #779
- Resolve randome apache segfault due to recursion.
- Also, remove additional references to export user
- Change the way the guest_account id is gathered.
- Change elseif format
- Remove trailing white-spaces
2017-06-08 07:42:22 -05:00
Tony Roman e7174c4046 Fix issue#788
- Fixed up invalid function call
 - Added default operator to cacti_version_compare function
2017-06-04 23:24:43 -04:00
Tony Roman ca8c8cd123 Move cacti_version_compare into main functions lib to be used
in non-install code
2017-06-04 21:33:15 -04:00
cigamit 27f30f498f Resolve upgrade issues from Cacti 0.8.7
If the plugin architecture does not exist, install will fail.  Also
found php function version_compare not working in PHP 5.3.x.

There were additionally issues with the upgrade functions as well.
Resolving those too.
2017-06-04 19:56:52 -05:00
Patrick 031598f56b Fix for #757 2017-06-01 20:54:27 +02:00
Patrick ae9acfd0f9 CLOG Enhancements
-Fixed CLOG paginator
-Fixed automatic page refresh
-Logfile writes rows with preferred timestamp
2017-05-30 10:20:05 +02:00
patrick ef69094b5e CLOG Enhancements
-feature: CLOG timestamp is now formatted as defined in settings
-feature: CLOG can show loginformation from rotated logfiles
-Added GDC_DOT to global_constants.php and global_arrays.php, and refactored the usage of global $datechar
2017-05-29 13:44:31 +02:00
cigamit f6699ed23d feature: add function to obtain the current execution user 2017-05-23 07:52:05 -05:00
cigamit 622f180cb6 Resolving Issue #662
Sending test Email should optionly bypass ping
2017-05-17 22:44:58 -05:00
Jimmy Conner aea8ddc7bd Merge pull request #702 from reboot1983/strlen
Cool stuff
2017-05-17 22:13:11 -05:00
patrick 16e2b7c052 Replaced all if statements and inline if statement with $variable != '' where strlen($variable) was used to determine if a string was empty or not 2017-05-18 01:14:15 +02:00
Patrick 56e02d75f2 Optimisations
- Optimisations of query calls and function calls in loops
- Removed unused function calls and variables
- Refactored large if statements into switch statements
- Applied early return
- Fixed alignments and removed unnecessary parentheses
2017-05-16 11:33:23 +02:00
cigamit 1a14cbb440 Introduce new get_cacti_version function to reduce database calls on pages 2017-05-14 12:29:30 -05:00
cigamit 8a695b113c Resolving Issue #658
Scheduled Reports (type "tree") not working.
2017-05-14 11:15:11 -05:00
cigamit c862851b7e Optimizations around data input methods
No functional changes
2017-05-13 11:08:34 -05:00
Patrick 40baee32b0 Bugfix for issue#680
- Fixed sorting; is now same as in data_source_profiles.php?action=edit
2017-05-13 00:18:47 +02:00
cigamit 7f9a808e56 Resolving Issue #657
Error in log when host is dow, using icmp ping and using cmd.php on
FreeBSD
2017-05-07 16:50:10 -05:00
Patrick f435138f44 Merge remote-tracking branch 'upstream/develop' into CLOGFix_651_Unable_to_view_cacti_log
# Conflicts:
#	install/upgrades/1_1_6.php
2017-05-07 18:06:01 +02:00
Patrick 23c95d0808 - Feature#106 Paginated CLOG and log administration
- Added missing docblock to new function
- Added configurable max_display_rows to settings panel
- Applied max_display_rows to code instead of MAX_DISPLAY_ROWS
- Removed define MAX_DISPLAY_ROWS
2017-05-07 18:00:21 +02:00
Patrick c18e032b03 - Feature#106 Paginated CLOG and log administration
- CLOG is now paginated
- System Utilities - Log administration is now paginated
- Bugfix in classic template paginator; when previous option appears, the paginator grows in height
2017-05-07 13:48:18 +02:00
Jimmy Conner 4c676b95ba Merge pull request #660 from reboot1983/CLOGFix_651_Unable_to_view_cacti_log
Fix for Issue#651: Unable to view cacti log (because of allowed memory size exhausted)
2017-05-06 06:54:36 -05:00
Jimmy Conner faf9d84eee Merge pull request #648 from reboot1983/RRDOptimisations
Thank goodness for weekends.  Okay, upon further review, perfect.
2017-05-06 05:10:44 -05:00
Patrick 01ed0fc5bd Issue#651: Unable to view cacti log (because of allowed memory size exhausted)
- Fixes memory usage; in the past the whole logfile would be read, now only the needed amount of rows
- Removed some unused variables
- Small optimisations in showing CLOG
2017-05-06 12:05:13 +02:00
cigamit 0204a2b0bd issue: FILTER_VALIDATE_MAC not defined on PHP less than 5.5
Causes cmd.php to throw errors.  Additionally, changing braketing style
for else, and elseif.
2017-05-05 06:19:01 -05:00
cigamit 7e966b98cb Create new function to gather color hex values 2017-05-04 19:10:04 -05:00
patrick d000013aff RRD optimisations
- Added missing globals
- Removed unused globals
- Optimised rrdtool_function_create()
2017-05-02 10:20:20 +02: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
cigamit a6eb1c735e wc3 Validation on select files 2017-04-30 19:28:09 -05:00
Patrick b154c3e89e Optimisations for tree view
lib/auth.php:
- is_device_allowed()
  - removed unused parameter $user
- get_allowed_tree_level()
  - removed unused parameter $user
- get_allowed_tree_content()
  - removed unused paramters $sql_where, $order_by, $limit, $total_rows and $user
  - refactored the code to apply for these unused parameters
- get_allowed_tree_header_graphs()
  - removed unused parameters $order_by, $limit, $total_rows and $user
  - refactored the code to apply for these unused parameters
- get_allowed_trees()
  - removed unused parameters $edit, $sql_where, $limit, $total_rows and $user
  - refactored the code to apply for these unused parameters

lib/functions.php:
- removed get_graph_tree_array() because it's unused after refactor

lib/html_tree.php
- draw_dhtml_tree_level():
  - removed unused parameter $graphing
  - removed unused global $config
- create_dhtml_tree()
  - removed unused global $config
  - refactored get_graph_tree_array() to alias: get_allowed_trees()

auth_profile.php:
  - refactored get_graph_tree_array(true) to alias: get_allowed_trees(true)
2017-04-28 18:16:46 +02:00
Patrick 11d801cbfa HTML Fix:
-issue#592: Incorrectly formatted HTML
2017-04-25 09:51:22 +02:00
cigamit 49e83d7fa1 Resolving Issued #580, #606, #608, #609
- Data collection warnings when using cmd.php
- Replace <path_php_binary> in data input methods
- Spaces adjacent to double quotes are eliminated durate data input
method import
- Horor the column setting in graph tree view mode
2017-04-24 20:40:05 -05:00
cigamit 53c91d7173 Resolving Issue #604
Don't show the regex errors when validating.
2017-04-23 08:18:16 -05:00
cigamit b28f44a9d9 Add escaping to filter values prior to request.
Handles the sepecial case of a pound sign causing issues.
2017-04-23 07:35:01 -05:00
Jimmy Conner 6c689b5f95 Merge pull request #597 from reboot1983/Optimisations
Optimisations
2017-04-22 08:58:16 -05:00
cigamit e2243f62d2 feature: Make Cacti more tolerant of empty PHP_SELF on some web servers 2017-04-22 08:22:01 -05:00
Patrick 2424f6ddb8 Merge remote-tracking branch 'upstream/develop' into Optimisations
# Conflicts:
#	host.php
2017-04-22 12:26:55 +02:00
Patrick 7386d2296b Small optimisations for poller 2017-04-22 11:18:00 +02:00
cigamit 6b8b210173 Resolving Issue #524
Reporting not working when Tree branch is device
2017-04-21 21:34:24 -05:00
Jimmy Conner c97f2b133d Merge pull request #578 from reboot1983/PHP7.2_compatibility_fixes
Great work!
2017-04-18 07:51:18 -05:00
Patrick 623611cd16 PHP7.2 changes:
- Replaced deprecated each() for foreach()
- Removed unnecessary reset() calls used for resetting pointers of an array before iterating by a foreach() loop
2017-04-18 14:40:29 +02:00
cigamit 55a74571a6 Resolving some minor issues
issue: ping email does not use from email address
issue: automation does not used default site or poller
feature: reorganize device defaults
2017-04-17 17:09:10 -05:00
Patrick 70ae146e6f Optimisations in lib\functions.php
Alignment for:
- array_rekey()
- is_hex_string()
- get_graph_group(()
- calculate_percentiles()
- cacti_oid_numeric_format()
- CactiErrorHandler()

read_default_user_setting() and read_default_config_option()
- refactored each() info foreach()
- removed unnecessary parentheses

tail_file()
- small optimisiational refactoring

get_full_script_path()
- alignment
- optimised str_replace() into one execution

stri_replace()
- strlen() into variable

clean_up_path()
- optimised if statement by reordering

generate_data_source_path()
- Removed unneeded variable declarations
- Limited query result (because of fetch cell returning one cell)

generate_graph_def_name()
- put strval($graph_item_id) into variable

move_graph_group()
- moved query to lower position
- alignment
- foreach instead of each() (each() will be deprecated in php 7.2.0)

exec_into_array()
- I believe this code was a self-implemented array_values()

draw_login_status()
- declared only necessary fields in querystatement

draw_navigation_text()
- removed/repositioned unnecessary declaration of variables
- declared only necessary fields in querystatement

resolve_navigation_variables()
- refactored heavy function call stored into variable

get_hash_graph_template()
get_hash_data_template()
get_hash_data_input()
get_hash_cdef()
get_hash_vdef()
get_hash_data_query()
- refactored into switch statement (33% faster)
- added default case

generate_hash()
- removed global $config;
2017-04-10 12:10:53 +02:00
patrick 3281e4c8d0 Small refactor and cleanup of unused functions
Cleanup of unused functions:
- is_valid_email()
- timer_start()
- timer_end()
- strip_newlines()

Small refactor in cacti_log():
- reduce function calls for read_config_option()
- refactor of loglevel if statement
- unnecessary parentheses
- syslog section refactor
- strpos() is 33% quicker than substr_count() in this case

draw_navigation_text():
- get result in 1 query instead of 2
2017-04-06 18:15:13 +02: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
Patrick 927c9899c2 Alignment 2017-03-28 17:18:41 +02:00
Patrick cc455d216b Fixed alignment of changed lines
Fixed alignment of changed lines
2017-03-28 16:45:29 +02:00
Patrick 67e13b914f oops
oops.. how did that come there?

fixed:
if (strlen($part != 2)) {
2017-03-27 16:17:40 +02:00
Patrick 321c1fc38a - optimisations: is_hexadecimal()
- trim() && str_replace() all at once
  - applied early return
  - strlen() and ctype_xdigit() instead of preg_match (33% faster)
- is_mac_address(): unnecessary if statement
- optimisations: is_hex_string()
  - strlen() and ctype_xdigit() instead of preg_match (33% faster)
- prepare_validate_result()
  - variable declaration to early
  - unnecessary parentheses
  - unnecessary if statement
- duplicate key in array: 'graph_templates.php:actions'

- strlen($hash) == 32 && ctype_xdigit($hash) instead of preg_match('/[a-fA-F0-9]{32}/', $hash) in:
  - get_hash_cdef()
  - get_hash_gprint()
  - get_hash_vdef()
  - get_hash_data_source_profile()
  - get_hash_host_template()
  - get_hash_data_query()
2017-03-27 14:21:54 +02:00