Commit Graph
459 Commits
Author SHA1 Message Date
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
cigamit 9459c704a1 Make the WMI caller faster 2017-01-03 19:26:14 -06:00
cigamit cd1e4a5135 Resolving #131
https://github.com/Cacti/cacti/issues/131
2017-01-03 17:48:46 -06:00
Tony Roman 35a5988f41 Update source code files copyright to new year 2017-01-01 13:45:29 -05:00
cigamit 97ad5b81ec Make the debug log work wihtout a sesson
Required for remote data query
2016-12-31 11:18:14 -06:00
cigamit 480ca77b68 Resolving #119
Please backup your database before re-runnning the upgrade script.  This
change requires rerunning the upgrade script even though it has been
tested.
2016-12-30 13:19:06 -06:00
cigamit a004131eb6 Insure communications are using the right protocol http vs. https 2016-12-27 16:58:08 -06:00
cigamit 27960d6773 Update logging utilities. 2016-12-27 12:32:08 -06:00
cigamit 7269cbfd88 Committing prototype of replication api for team review
Part of multiple polling is to support either MySQL replication, or to
replicate tables requred for remote data collection.  These changes will
enable the later method, but are not complete.

The replicate_tables in lib/poller.php function is designed to handle
each of the table replecation types.  When complete, it will handle all
table replication based upon poller state.

There may be additional table schema changes to increase performance,
but those changes have not been validated yet.
2016-12-19 21:44:34 -06:00