Skip to content

Commit

Permalink
Merging #5409 from 1.2.x branch
Browse files Browse the repository at this point in the history
  • Loading branch information
TheWitness committed Jul 27, 2023
1 parent 38a9311 commit 85249df
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 0 deletions.
1 change: 1 addition & 0 deletions CHANGELOG
Original file line number Diff line number Diff line change
Expand Up @@ -136,6 +136,7 @@ Cacti CHANGELOG
-issue#5390: Fix SQL error when saving DS template
-issue#5392: Template import should not end with php error
-issue#5403: Cacti Log regular expression filters can not calculate 'does not match' properly
-issue#5409: Enabling a plugin can have no response
-issue#5413: Rows Per Page - Not all options are available
-issue#5414: Plugins are unable to modify fields in the setting 'Change Device Settings'
-issue#5417: Cacti mailer log message misses 'bcc' addresses in log notification
Expand Down
9 changes: 9 additions & 0 deletions lib/plugins.php
Original file line number Diff line number Diff line change
Expand Up @@ -737,6 +737,12 @@ function api_plugin_install($plugin) {

$author = $info['author'];
$version = $info['version'];
} elseif (strpos($plugin, 'plugin_') !== false) {
raise_message('directory_error', __('The Plugin directory \'%s\' needs to be renamed to remove \'plugin_\' from the name before it can be installed.', $plugin), MESSAGE_LEVEL_ERROR);
return false;
} else {
raise_message('version_error', __('The Plugin in the directory \'%s\' does not include an version function \'%s()\'. This function must exist for the plugin to be installed.', $plugin, $function), MESSAGE_LEVEL_ERROR);
return false;
}

db_execute_prepared('INSERT INTO plugin_config
Expand All @@ -763,6 +769,9 @@ function api_plugin_install($plugin) {
WHERE directory = ?',
array($plugin));
}
} else {
raise_message('install_error', __('The Plugin in the directory \'%s\' does not include an install function \'%s()\'. This function must exist for the plugin to be installed.', $plugin, $function), MESSAGE_LEVEL_ERROR);
return false;
}

api_plugin_replicate_config();
Expand Down

0 comments on commit 85249df

Please sign in to comment.