2 # (c) Petr Baudis <pasky@suse.cz>
8 use lib
qw(/home/repo/repomgr/cgi);
11 # TODO: add config file support, remove hard-coded URLs
12 my $site_repo_url = 'git://repo.or.cz/repo.git';
14 my $repo = Git
::RepoCGI
->new('Project Settings');
15 my $name = $repo->sparam('name');
17 my $proj = $repo->load_project($name);
19 if ($repo->sparam('email')) {
20 $repo->bye("Form failed. Try again.") unless $proj->cgi_fill($repo);
21 $repo->bye("Authentication failed.") unless $proj->authenticate($repo);
22 my $okay = $proj->update ?
"" : ' <span style="color:red">not</span>';
23 print "<p><em>The settings were$okay updated.</em></p>\n";
26 # $proj may be insane now but that's actually good for us since we'll let the
27 # user fix the invalid values she entered
28 my %h = $proj->form_defaults;
32 <p>Project name: <a href="/w/$h{name}.git">$h{name}</a>.git
33 <input type="hidden" name="name" value="$h{name}" /></p>
34 <h3>Contact/Description </h3>
35 <p>E-mail contact: <input type="text" name="email" value="$h{email}" /></p>
36 <p>Repository URL: <input type="text" name="url" value="$h{url}" /></p>
37 <p>Description: <input type="text" name="desc" value="$h{desc}" /></p>
38 <p>Homepage URL: <input type="text" name="hp" value="$h{hp}" /></p>
39 <p>README (HTML, lt 8kb): <br />
40 <textarea name="README" rows="5" cols="80">$h{README}</textarea></p>
43 if ($proj->{mirror
}) {
45 <h3>Mirror Settings</h3>
47 If no forks have been created, then you can
48 <a href="delproj.cgi?name=$h{name}">remove this project</a> from the site.
51 Since users cannot push changes to this project, the user access
52 list has no practical effect for this type of project.
61 Currently, you can add access for only one user at a time.
62 If this will be a limitation for you, you may create a patch for
63 <a href="$site_repo_url">the site</a> to improve this functionality,
64 and it will be incorporated in a future revision.
68 print <<EOT unless grep { $_ eq 'mob' } @{$h{users}};
70 <em>Please consider adding the <tt>mob</tt> user to provide
71 <a href=\"/mob.html\">anonymous push access</a> to the mob branch
76 print "<p>Users:</p>\n<ul>\n";
77 print <<EOT foreach @{$h{users}};
78 <li><input type="checkbox" name="user" value="$_" checked="1" />$_</li>
82 <li>Add user: <input type="text" name="user" /></li>
85 <h3>Enter Admin Password</h3>
86 <p>Admin password: <input type="password" name="cpwd" />
87 <sup><a href="pwproj.cgi?name=$name">(forgot password?)</a></sup></p>
88 <p>New password: <input type="password" name="pwd" />
89 (leave empty to keep it at the current value)</p>
90 <p>Verify password: <input type="password" name="pwd2" /></p>
92 <p><input type="submit" name="y0" value="Change" /></p>