aboutsummaryrefslogtreecommitdiffstats
path: root/web/nms.gathering.org/comment-change.pl
diff options
context:
space:
mode:
authorKristian Lyngstol <kristian@bohemians.org>2015-04-21 17:14:45 +0200
committerKristian Lyngstol <kristian@bohemians.org>2015-04-21 17:14:45 +0200
commit56a38583fd770ad8851de49485489e30baa7467c (patch)
tree5edd90db060d8b61d2ae74f5800b806a972eb44a /web/nms.gathering.org/comment-change.pl
parent0443c94d44ecf94d10f47bba2945e695bd16da12 (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-xweb/nms.gathering.org/comment-change.pl24
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' }";
+