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