11 my $parent = $itkaclcommon::cgi->param('parent');
12 my $name = $itkaclcommon::cgi->param('name');
13 my $description = $itkaclcommon::cgi->param('description');
15 if ($name !~ /^[a-zA-Z0-9-]+$/) {
16 die "Illegal characters in name";
18 if (length($name) > 64) {
22 $itkaclcommon::dbh->do('INSERT INTO objects (name,description,parent) VALUES (?,?,?)', undef,
23 $name, $description, $parent)
24 or die "Couldn't insert new object";
26 # Let sync-itkacl know there's updates
27 utime(time(), time(), '/etc/itkacl/updated');
30 # Redirect to the newly created node (a little touch: make sure the node
31 # is opened so the new node is visible in the tree -- this won't catch all
32 # cases, but at least most of them).
34 my $ref = $itkaclcommon::dbh->selectrow_hashref('SELECT id FROM objects WHERE name=? AND parent=?',
35 undef, $name, $parent);
37 print $itkaclcommon::cgi->redirect("view.pl?entry=$ref->{'id'}&open=$parent");