From 56a38583fd770ad8851de49485489e30baa7467c Mon Sep 17 00:00:00 2001 From: Kristian Lyngstol Date: Tue, 21 Apr 2015 17:14:45 +0200 Subject: 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. --- web/nms.gathering.org/comment-change.pl | 24 ++++++++++++++++++++++++ 1 file changed, 24 insertions(+) create mode 100755 web/nms.gathering.org/comment-change.pl (limited to 'web/nms.gathering.org/comment-change.pl') 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' }"; + -- cgit v1.2.3