2 # (c) Petr Baudis <pasky@suse.cz>
16 my $pname = $cgi->param('p')||'';
17 my $ctags = $cgi->param('t')||'';
20 if ($cgi->request_method ne 'POST') {
21 print $cgi->header(-status
=>403);
22 print "<p>Invalid data. Go away, sorcerer.</p>\n";
26 my $proj = Girocco
::Project
->load($pname);
28 print $cgi->header(-status
=>404);
29 print "<p>Project $pname does not exist.</p>";
33 if ($ctags =~ /[^ a-zA-Z0-9:.+#_-]/) {
34 print $cgi->header(-status
=>403);
35 print "<p>Content tag(s) '$ctags' contain evil characters.</p>";
39 foreach my $ctag (split(/ /, $ctags)) {
40 # Locking is not important
41 valid_tag
($ctag) or next;
43 open CT
, '<', $proj->{path
}."/ctags/$ctag" and $val = <CT
> and close CT
;
45 open CT
, '>', $proj->{path
}."/ctags/$ctag" and print CT
($val+1)."\n" and close CT
;
48 print $cgi->header(-status
=>303, -location
=>"@{[url_path($Girocco::Config::gitweburl)]}/$pname.git");