Skip to content

Commit

Permalink
- Re-organized files structure
Browse files Browse the repository at this point in the history
  • Loading branch information
vagharsh committed Nov 12, 2017
1 parent d0e79d0 commit 18fbd05
Show file tree
Hide file tree
Showing 4 changed files with 7 additions and 10 deletions.
4 changes: 1 addition & 3 deletions backend/functions.php
Original file line number Diff line number Diff line change
@@ -1,9 +1,7 @@
<?php

function putInConsul($path, $value, $cas) {
if ($cas == 0){
$path = $path."?cas=0";
}
if ($cas == 0){$path = $path."?cas=0";}
$ch = curl_init();
curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, false);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
Expand Down
8 changes: 4 additions & 4 deletions backend/requests.php
Original file line number Diff line number Diff line change
Expand Up @@ -28,8 +28,8 @@
}
} elseif ($method === 'BulkIMPORT') {
if ($userRights[1] == 1) {
if (isset($_POST['path']) && isset($_POST['value']) && isset($_POST['cas'])) {
echo (importFn($_POST['path'], $_POST['value'], $_POST['cas']));
if (isset($_POST['consul']) && isset($_POST['value']) && isset($_POST['cas'])) {
echo (importFn($_POST['consul'], $_POST['value'], $_POST['cas']));
}
} else {
echo "You are not Authorized to perform this action";
Expand Down Expand Up @@ -72,9 +72,9 @@
}
}
}
if (isset($_GET['path'])) {
if (isset($_GET['consul'])) {
if ($userRights[0] == 1) {
echo(json_encode(getFromConsul($_GET['path'])));
echo(json_encode(getFromConsul($_GET['consul'])));
} else {
echo "You are not Authorized to perform this action";
}
Expand Down
4 changes: 2 additions & 2 deletions lib/js/functions.js
Original file line number Diff line number Diff line change
Expand Up @@ -125,7 +125,7 @@ function importConsul(cas) {
method: "POST",
url: "backend/requests.php",
data: {
path: consulUrl,
consul: consulUrl,
method: "BulkIMPORT",
cas: cas,
value: JSON.stringify(result)
Expand Down Expand Up @@ -346,7 +346,7 @@ function getTree(tree, allKeys) {
url: "backend/requests.php",
dataType: 'json',
data: {
path: allKeys
consul: allKeys
}
}).done(function (data) {
$('#connectingModalId').modal('hide');
Expand Down
1 change: 0 additions & 1 deletion lib/js/triggers.js
Original file line number Diff line number Diff line change
Expand Up @@ -223,5 +223,4 @@ $(function () {
searchInputObj.parent().removeClass('has-error');
}, 1000);
});

});

0 comments on commit 18fbd05

Please sign in to comment.