aboutsummaryrefslogtreecommitdiffhomepage
path: root/assets/php/SavePublicKey.php
diff options
context:
space:
mode:
Diffstat (limited to 'assets/php/SavePublicKey.php')
-rwxr-xr-xassets/php/SavePublicKey.php17
1 files changed, 0 insertions, 17 deletions
diff --git a/assets/php/SavePublicKey.php b/assets/php/SavePublicKey.php
deleted file mode 100755
index 725a005..0000000
--- a/assets/php/SavePublicKey.php
+++ /dev/null
@@ -1,17 +0,0 @@
-<?php
-if (isset($_POST["UserID"]) && isset($_POST["PublicKeyString"])) {
- require "DataBaseConf.php";
- $CheckIfAlreadySetStmt = $conn->prepare("SELECT count(*) FROM `PublicKeys` WHERE UserID = :UserID");
- $CheckIfAlreadySetStmt->bindValue(':UserID', $_POST['UserID']);
- $CheckIfAlreadySetStmt->execute();
- $CheckIfAlreadySetRes = $CheckIfAlreadySetStmt->fetchColumn();
- if ($CheckIfAlreadySetRes == 1) {
- $UpdatePublicKeyStmt = $conn->prepare("UPDATE `PublicKeys` SET PublicKeyString = :PublicKeyString WHERE UserID = :UserID");
- $UpdatePublicKeyStmt->execute(array('PublicKeyString' => $_POST["PublicKeyString"], 'UserID' => $_POST["UserID"]));
- } else if ($CheckIfAlreadySetRes == 0) {
- $InsertPublicKeyStmt = $conn->prepare("INSERT INTO `PublicKeys` (UserID, PublicKeyString) VALUES (:UserID, :PublicKeyString)");
- $InsertPublicKeyStmt->execute(array('PublicKeyString' => $_POST["PublicKeyString"], 'UserID' => $_POST["UserID"]));
- }
-} else {
- http_response_code(400);
-} \ No newline at end of file