2 # (c) Petr Baudis <pasky@suse.cz>
8 use lib
qw(/home/repo/repomgr/cgi);
11 my $repo = Git
::RepoCGI
->new('Project Settings');
14 my $name = $cgi->remote_user();
16 if (!valid_name
($name)) {
17 print "<p>Invalid project name. Go away, sorcerer.</p>\n";
21 if (!Git
::RepoCGI
::Project
::does_exist
($name)) {
22 print "<p>Sorry but this project does not exist. Now, how did you <em>get</em> here?!</p>\n";
26 if (!Git
::RepoCGI
::Project
::available
($name)) {
27 print "<p>Sorry but your project has not finished mirroring yet. If it takes inordinate amount of time, please tell the administrator.</p>\n";
31 my $proj = Git
::RepoCGI
::Project
->load($name);
32 $proj or die "not found project $name, that's really weird!";
34 if ($cgi->param('email')) {
35 # submitted, let's see
36 if ($proj->cgi_fill($repo) and $proj->update) {
37 print "<p>Project successfuly updated.</p>\n";
41 # $proj may be insane now but that's actually good for us since we'll let the
42 # user fix the invalid values she entered
43 my %h = $proj->form_defaults;
46 <p>Here you can adjust project settings. Go wild.
47 Though you can currently enable access only for a single user at a time
48 so perhaps you will need to click a lot.</p>
50 <p>Project name (w/o the .git suffix): $h{name}</p>
51 <p>Admin password: <input type="password" name="pwd" /> (leave empty to keep it at the current value)</p>
52 <p>E-mail contact: <input type="text" name="email" value="$h{email}" /></p>
53 <p>Repository URL: <input type="text" name="url" value="$h{url}" /></p>
54 <p>Description: <input type="text" name="desc" value="$h{desc}" /></p>
55 <p>Homepage URL: <input type="text" name="hp" value="$h{hp}" /></p>
59 if ($repo->{mirror
}) {
60 print "<p><em>Warning: This is a mirroring repository, thus you cannot push into it. Changing the user set will have no practical effect.</em></p>\n";
62 foreach my $user (@
{$h{users
}}) {
63 print "<li><input type=\"checkbox\" name=\"user\" value=\"$user\" checked=\"1\" /> $user</li>\n";
66 <li>Add user: <input type="text" name="user" /></li>
68 <p><input type="submit" name="y0" value="Update" /></p>