Skip to content
This repository has been archived by the owner on Dec 13, 2022. It is now read-only.

Commit

Permalink
removing appKey from CentreonRemoteServer.php
Browse files Browse the repository at this point in the history
  • Loading branch information
hyahiaoui-ext committed Jul 8, 2022
1 parent dcbd93b commit 5dd8408
Showing 1 changed file with 2 additions and 11 deletions.
13 changes: 2 additions & 11 deletions src/CentreonRemote/Application/Webservice/CentreonRemoteServer.php
Original file line number Diff line number Diff line change
Expand Up @@ -109,14 +109,6 @@ public function postAddToWaitList(): string
throw new \RestBadRequestException('Can not access your address.');
}

if (
!isset($_POST['app_key'])
|| !$_POST['app_key']
|| empty($appKey = filter_var($_POST['app_key'], FILTER_SANITIZE_STRING))
) {
throw new \RestBadRequestException('Please send \'app_key\' in the request.');
}

if (
!isset($_POST['version'])
|| !$_POST['version']
Expand Down Expand Up @@ -147,15 +139,14 @@ public function postAddToWaitList(): string
}

$createdAt = date('Y-m-d H:i:s');
$insertQuery = "INSERT INTO `remote_servers` (`ip`, `app_key`, `version`, `is_connected`,
$insertQuery = "INSERT INTO `remote_servers` (`ip`, `version`, `is_connected`,
`created_at`, `http_method`, `http_port`, `no_check_certificate`)
VALUES (:ip, :app_key, :version, 0, '{$createdAt}',
VALUES (:ip, :version, 0, '{$createdAt}',
:http_method, :http_port, :no_check_certificate
)";

$insert = $this->pearDB->prepare($insertQuery);
$insert->bindValue(':ip', $ip, \PDO::PARAM_STR);
$insert->bindValue(':app_key', $appKey, \PDO::PARAM_STR);
$insert->bindValue(':version', $version, \PDO::PARAM_STR);
$insert->bindValue(':http_method', $httpScheme, \PDO::PARAM_STR);
$insert->bindValue(':http_port', $httpPort, \PDO::PARAM_INT);
Expand Down

0 comments on commit 5dd8408

Please sign in to comment.