watch: add 'watch' support
[girocco/ztw.git] / cgi / watchmsg.cgi
blob0b2b9e117cbcf3f7690abefb5b860a6a8decad3b
1 #!/usr/bin/perl
2 # (c) Zachary T Welch <zw@superlucidity.net>
3 # GPLv2
5 use strict;
6 use warnings;
8 use lib qw(/home/repo/repomgr/cgi);
9 use Git::RepoCGI;
11 my $repo = Git::RepoCGI->new('Notify Watchers');
12 my $project = $repo->sparam('project');
13 my $branch = $repo->sparam('branch');
14 my $path = $repo->sparam('path');
15 my $name = $repo->sparam('name');
17 # check for submission
18 my $incomplete = grep { !$repo->sparam($_) } qw( project msg name cpwd go );
19 $repo->bye('Not yet implemented') unless $incomplete;
21 print <<EOT
22 <p>
23 Using the form on this page, users with push access to '$project.git'
24 can send messages to some or all registered watchers of a particular
25 fork, branch, or path. By leaving all fields in the form blank, the
26 message will be sent to all project watchers, regardless of the branch
27 or path that they are watching.
28 </p>
29 <!--
30 <p>
31 Users can <a href="watchabuse.cgi?project=$project">report abuses</a>
32 of this messaging system, allowing projects and forks to have repeat
33 offenders' accounts added to a blacklist automatically.
34 </p>
35 -->
37 <h2>Contact Watchers</h2>
39 To send a message, specify the intended recipients, the content of the
40 message to forward, and your authentication credentials.
42 <h3>Recipients</h3>
43 <form method="post">
44 <p>Project: <em>$project</em>
45 <input type="hidden" name="project" value="$project" /></p>
46 <p>Branch: <input type="text" name="branch" value="$branch" /></p>
47 <p>Path: <input type="text" name="path" value="$path" /></p>
48 <p>User: <input type="text" name="user" /></p>
50 <h3>Message Content</h3>
51 <textarea name="msg"/ rows="10" cols="80"></textarea></p>
53 <h3>Account Authentication</h3>
54 If you do not have an account, then <a href="reguser.cgi">register</a> now.
55 <p>Account: <input type="text" name="name" value="$name" /></p>
56 <p>Password: <input type="password" name="cpwd" /></p>
57 <br />
58 <p><input type="submit" name="go" value="Send" /></p>
59 </form>
60 EOT