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->param('name');
17 unless (defined $name) {
18 print "<p>I need the project name as an argument now.</p>\n";
22 if (!valid_proj_name
($name)) {
23 print "<p>Invalid project name. Go away, sorcerer.</p>\n";
27 if (!Git
::RepoCGI
::Project
::does_exist
($name)) {
28 print "<p>Sorry but the project $name does not exist. Now, how did you <em>get</em> here?!</p>\n";
32 if (!Git
::RepoCGI
::Project
::available
($name)) {
33 print "<p>Sorry but your project has not finished mirroring yet. If it takes inordinate amount of time, please ask the administrator about it.</p>\n";
37 my $proj = Git
::RepoCGI
::Project
->load($name);
38 $proj or die "not found project $name, that's really weird!";
40 if ($cgi->param('email')) {
41 # submitted, let's see
42 if ($proj->cgi_fill($repo) and $proj->authenticate($repo) and $proj->update) {
43 print "<p>Project successfuly updated.</p>\n";
47 # $proj may be insane now but that's actually good for us since we'll let the
48 # user fix the invalid values she entered
49 my %h = $proj->form_defaults;
52 <p>Here you can adjust the settings of project $h{name}. Go wild.
53 Though you can currently enable access only for a single user at a time
54 so perhaps you will need to click a lot. Sorry! (Patches welcome.)</p>
56 if ($proj->{mirror
}) {
58 <p>Since this is a mirrored project, you can opt to remove it from the site as well.
59 Just <a href="delproj.cgi?name=$h{name}">delete it</a>.</p>
64 <p>Project name: <a href="/w/$h{name}.git">$h{name}</a>.git <input type="hidden" name="name" value="$h{name}" /></p>
65 <p>Admin password: <input type="password" name="cpwd" /> <sup><a href="pwproj.cgi?name=$name">(forgot password?)</a></sup></p>
66 <p>New admin password: <input type="password" name="pwd" /> (leave empty to keep it at the current value)</p>
67 <p>New admin password (retype): <input type="password" name="pwd2" /></p>
68 <p>E-mail contact: <input type="text" name="email" value="$h{email}" /></p>
69 <p>Repository URL: <input type="text" name="url" value="$h{url}" /></p>
70 <p>Description: <input type="text" name="desc" value="$h{desc}" /></p>
71 <p>Homepage URL: <input type="text" name="hp" value="$h{hp}" /></p>
72 <p>README (HTML, lt 8kb): <textarea name="README" rows="5" cols="80">$h{README}</textarea></p>
76 if ($proj->{mirror
}) {
77 print "<p><em>Warning: This is a mirrored repository, thus you cannot push into it. Changing the user set will have no practical effect.</em></p>\n";
78 } elsif (not grep { $_ eq 'mob' } @
{$h{users
}}) {
79 print "<p><em>(Please consider adding the <tt>mob</tt> user.<sup><a href=\"/mob.html\">(learn more)</a></sup>)</em></p>\n";
81 foreach my $user (@
{$h{users
}}) {
82 print "<li><input type=\"checkbox\" name=\"user\" value=\"$user\" checked=\"1\" /> $user</li>\n";
85 <li>Add user: <input type="text" name="user" /></li>
87 <p><input type="submit" name="y0" value="Update" /></p>