Skip to content

Commit

Permalink
Fixing #5628 - Argument --with-profile not used
Browse files Browse the repository at this point in the history
Argument '--with-profile' is a invalid arg of cli/import_package.php
  • Loading branch information
TheWitness committed Jan 29, 2024
1 parent dae1025 commit f51d319
Show file tree
Hide file tree
Showing 2 changed files with 20 additions and 0 deletions.
1 change: 1 addition & 0 deletions CHANGELOG
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ Cacti CHANGELOG

1.2.27
-issue#5622: Errors and deprecation warnings with PHP 8.3.0
-issue#5628: Argument '--with-profile' is a invalid arg of cli/import_package.php
-issue#5629: auth_changepassword.php cannot return to the refer url by just clicking the "Return" button once
-issue#5636: Cacti 1.2.26 error on LDAP authentication the first time
-issue#5638: Add tooltip info about IPv6 address
Expand Down
19 changes: 19 additions & 0 deletions cli/import_package.php
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,7 @@
$preview_only = false;
$info_only = false;
$profile_id = '';
$profile_set = false;

foreach($parms as $parameter) {
if (strpos($parameter, '=')) {
Expand All @@ -63,6 +64,17 @@
case '--filename':
$filename = trim($value);

break;
case '--with-profile':
if ($profile_set) {
print 'The argument --with-profile can not be used in conjunction with --profile-id.' . PHP_EOL;
exit(1);
}

$profile_set = true;

$profile_id = db_fetch_cell('SELECT id FROM data_source_profiles WHERE `default` = "on"');

break;
case '--use-profile':
$use_profile = true;
Expand All @@ -77,6 +89,13 @@

break;
case '--profile-id':
if ($profile_set) {
print 'The argument --profile-id can not be used in conjunction with --with-profile.' . PHP_EOL;
exit(1);
}

$profile_set = true;

$profile_id = trim($value);

break;
Expand Down

0 comments on commit f51d319

Please sign in to comment.