Commit Graph
467 Commits
Author SHA1 Message Date
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
Patrick 85e1b8a831 Small fix in invalid function call
- Unused variable
- Typo fix in function call. There is no function like hex2dec() ?
2017-03-27 12:02:38 +02:00
cigamit b2d0b5c410 Resolving Issue #467
Reduce the number of queries in the log function
2017-03-22 18:50:50 -05:00
cigamit 203d5df13b Resolving Issue #461
The function escapshellarg not appropriate on Windows
2017-03-22 07:04:34 -05:00
cigamit 948328da78 Resolve issue #459
- Add vairable date time option to report mail subject.
- Add Global Date/Time format to Cacti
2017-03-21 20:10:30 -05:00
cigamit 552454a1c3 Support generalized date format approach in the GUI 2017-03-21 19:50:46 -05:00
cigamit 12a8fa46cf Use builtin functions where possible.
On hax string validation, hex strings always include spaces on output.
So, if length is 1, then return false.
2017-03-18 08:57:17 -05:00
cigamit 16521a11a2 Resolve empty breadcrumb issue on links page 2017-03-17 17:19:29 -05:00
cigamit 4a4eedabae feature: Add page refresh API to make page refreshing in Ajax easier to accomplish 2017-03-17 07:15:50 -05:00
cigamit 0cf06d6573 Improve email test exception errors and change default timeout to 10 seconds 2017-03-16 19:10:53 -05:00
cigamit 3387043ef2 Resolving Issue #415 2017-03-13 06:16:22 -05:00
cigamit 1faa081241 Only perform System Data Input repair if good hashes are found 2017-03-12 12:34:24 -05:00
cigamit 456e1a3bcc Move repair script to prepared statements. 2017-03-12 10:55:10 -05:00
cigamit 19bfc5b168 Resolving Issue #404
Cacti gives success even when test mail fails
2017-03-11 09:42:31 -06:00
earendilfr 6b0643c3af Fix the error in merge request #352 :
* the $index_recache string already contains the / separator. I don't need to add in preg_match function
* some errors in the methods to take in count the storage of the modified value
* a cosmetic change that permit to clean the debug value in debug_log_return function after the display
* a change in poller function that fixe an error when your index field in the XML file is a fake index oid
2017-03-07 22:50:06 +01:00
cigamit 65ea7a36bc Resolving Issue #358
Testing email settings results in warning.
2017-03-04 13:51:04 -06:00
cigamit 3cb1958f82 Improved is_ipaddress functions 2017-03-04 13:29:39 -06:00
cigamit b6867b1f09 Resolve issue with output messaging 2017-02-24 18:31:24 -06:00
cigamit c7fd363abd Resolving Issue #309 2017-02-23 20:30:34 -06:00
cigamit 712349d35e Resolving Issue #301 2017-02-18 12:28:58 -06:00
cigamit 64a3de583f Additional fixes for Syslog Issue #13 2017-02-08 07:41:02 -06:00
cigamit 93a35a3041 Resolving Syslog Issue #13 2017-02-08 06:43:58 -06:00
cigamit fdac4b7d55 support utf8 for mailer 2017-02-08 06:41:11 -06:00
cigamit aee90468ea Resolving Issue #243 2017-02-01 17:08:20 -06:00
Browniebraun 0efde1b7ef Update functions.php
Back to original way of generating absolute paths. Relative paths needed for RRDproxy will be generated on the fly within /lib/rrd.php.
No need to rebuilt the poller cache after changing the data storage.
2017-01-19 14:58:16 +01:00
cigamit 677fcfd776 Resolving part of Issue #214 2017-01-16 17:32:41 -06:00
cigamit 06d3bc884a Reduce database calls. 2017-01-16 11:28:45 -06:00
cigamit 88aa4e74a7 Reduce database calls 2017-01-16 11:14:48 -06:00
cigamit 99c0a84c29 Resolving Issue #140 2017-01-05 22:31:00 -06:00
cigamit db82103718 Resolving Issue #138 2017-01-05 21:12:03 -06:00
cigamit 094dd874ca Resolving issue #147
At developer debug, only dev debug and stats messages should display
2017-01-05 17:22:59 -06:00
cigamit e82f4621da Undefined variable warning. 2017-01-04 19:29:11 -06:00
cigamit ba52b29c1c Taking the is_ipaddress() function from lib/ping.php
Making this function public.
2017-01-04 19:02:20 -06:00