]> git.sesse.net Git - itkacl/blobdiff - itkacl-web-1.0/web/addnode.pl
Bump version number to itkacl-2.3.
[itkacl] / itkacl-web-1.0 / web / addnode.pl
index d0f1ddd7271e6f4f13eb068128eb507f4b1e80bf..299942147648ce5fa0fb9937ef23c60d49c94d7c 100755 (executable)
@@ -2,15 +2,17 @@
 use strict;
 use warnings;
 use utf8;
 use strict;
 use warnings;
 use utf8;
+use Encode;
 
 use lib '../include';
 use itkaclcommon;
 
 itkaclcommon::init();
 
 use lib '../include';
 use itkaclcommon;
 
 itkaclcommon::init();
+itkaclcommon::check_csrf_token();
 
 my $parent = $itkaclcommon::cgi->param('parent');
 my $name = $itkaclcommon::cgi->param('name');
 
 my $parent = $itkaclcommon::cgi->param('parent');
 my $name = $itkaclcommon::cgi->param('name');
-my $description = $itkaclcommon::cgi->param('description');
+my $description = Encode::decode_utf8($itkaclcommon::cgi->param('description'));
 
 if ($name !~ /^[a-zA-Z0-9-]+$/) {
        die "Illegal characters in name";
 
 if ($name !~ /^[a-zA-Z0-9-]+$/) {
        die "Illegal characters in name";
@@ -23,9 +25,6 @@ $itkaclcommon::dbh->do('INSERT INTO objects (name,description,parent) VALUES (?,
     $name, $description, $parent)
        or die "Couldn't insert new object";
 
     $name, $description, $parent)
        or die "Couldn't insert new object";
 
-# Let sync-itkacl know there's updates
-utime(time(), time(), '/etc/itkacl/updated');
-
 #
 # Redirect to the newly created node (a little touch: make sure the node
 # is opened so the new node is visible in the tree -- this won't catch all
 #
 # Redirect to the newly created node (a little touch: make sure the node
 # is opened so the new node is visible in the tree -- this won't catch all