aboutsummaryrefslogtreecommitdiffhomepage
path: root/assets/php/SavePublicKey.php
diff options
context:
space:
mode:
authormarvin-borner@live.com2018-04-16 21:09:05 +0200
committermarvin-borner@live.com2018-04-16 21:09:05 +0200
commitcf14306c2b3f82a81f8d56669a71633b4d4b5fce (patch)
tree86700651aa180026e89a66064b0364b1e4346f3f /assets/php/SavePublicKey.php
parent619b01b3615458c4ed78bfaeabb6b1a47cc8ad8b (diff)
Main merge to user management system - files are now at /main/public/
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