diff options
author | Kristian Lyngstol <kly@kly.no> | 2016-03-17 19:51:46 +0000 |
---|---|---|
committer | Kristian Lyngstol <kly@kly.no> | 2016-03-17 19:51:46 +0000 |
commit | 5c9d6d10dc7e53a8d06fbd056ded591a6b583167 (patch) | |
tree | 6f6290fb1b8bcc859278a2c68573a35547173931 /web/nms.gathering.org/api/private/comment-change | |
parent | 76a3aad5090d304ec0f76f28e50afe1f53b7b96c (diff) | |
parent | 025f01e7e8c5bfea21b559fbac650f90c2774a29 (diff) |
Merge branch 'master' of https://github.com/tech-server/tgmanage
Diffstat (limited to 'web/nms.gathering.org/api/private/comment-change')
-rwxr-xr-x | web/nms.gathering.org/api/private/comment-change | 10 |
1 files changed, 7 insertions, 3 deletions
diff --git a/web/nms.gathering.org/api/private/comment-change b/web/nms.gathering.org/api/private/comment-change index ccf336d..fb7da54 100755 --- a/web/nms.gathering.org/api/private/comment-change +++ b/web/nms.gathering.org/api/private/comment-change @@ -3,12 +3,16 @@ use lib '../../../../include'; use utf8; use nms; -use nms::web; +use nms::web qw($dbh db_safe_quote get_input finalize_output); + use strict; use warnings; -my $id = db_safe_quote('comment'); -my $state = db_safe_quote('state'); +my $in = get_input(); +my %tmp = %{JSON::XS::decode_json($in)}; + +my $id = $dbh->quote($tmp{'comment'}); +my $state = $dbh->quote($tmp{'state'}); my $q = $nms::web::dbh->prepare("UPDATE switch_comments SET state = " . $state . " WHERE id = " . $id . ";"); $q->execute(); |