diff options
author | Kristian Lyngstol <kristian@bohemians.org> | 2015-04-21 17:14:45 +0200 |
---|---|---|
committer | Kristian Lyngstol <kristian@bohemians.org> | 2015-04-21 17:14:45 +0200 |
commit | 56a38583fd770ad8851de49485489e30baa7467c (patch) | |
tree | 5edd90db060d8b61d2ae74f5800b806a972eb44a /web/nms.gathering.org/comment-change.pl | |
parent | 0443c94d44ecf94d10f47bba2945e695bd16da12 (diff) |
NMS: More coarse-tuning of comments
Wouldn't call it fine tuning.
Now got active/inactive/persists/delete state working OK, and things are
showing up prettier.
Diffstat (limited to 'web/nms.gathering.org/comment-change.pl')
-rwxr-xr-x | web/nms.gathering.org/comment-change.pl | 24 |
1 files changed, 24 insertions, 0 deletions
diff --git a/web/nms.gathering.org/comment-change.pl b/web/nms.gathering.org/comment-change.pl new file mode 100755 index 0000000..13ed058 --- /dev/null +++ b/web/nms.gathering.org/comment-change.pl @@ -0,0 +1,24 @@ +#! /usr/bin/perl +use CGI qw(fatalsToBrowser); +use DBI; +use lib '../../include'; +use utf8; +use nms; +use strict; +use warnings; +use Data::Dumper; + +my $cgi = CGI->new; + +my $dbh = nms::db_connect(); + +my $id = $dbh->quote($cgi->param('comment') || die ); +my $state= $dbh->quote($cgi->param('state') || die); + + +my $q = $dbh->prepare("UPDATE switch_comments SET state = " . $state . " WHERE id = " . $id . ";"); +$q->execute(); + +print $cgi->header(-type=>'text/json; charset=utf-8'); +print "{ 'state': 'ok' }"; + |