2 # (c) Petr Baudis <pasky@suse.cz>
8 use lib
qw(/home/repo/repomgr/cgi);
11 my $repo = Git
::RepoCGI
->new('Project Registration');
14 if ($cgi->param('name')) {
15 # submitted, let's see
16 # FIXME: racy, do a lock
17 my $name = $repo->wparam('name');
19 and Git
::RepoCGI
::Project
::does_exist
($name)
20 and $repo->err("Project with that name already exists.");
22 my $mirror = $cgi->param('mode') eq 'mirror';
23 my $proj = Git
::RepoCGI
::Project
->ghost($name, $mirror);
24 if ($proj->cgi_fill($repo)) {
27 print "<p>Initiated mirroring. You will be notified by mail about results.</p>\n";
32 Project successfuly set up.
33 You can <a href="p/editproj.pl">assign users</a> now (use project name as username, admin password as password).
34 You need to <a href="reguser.pl">register a user</a> first if you have not done so yet.
35 (One user can have push access to multiple projects and multiple users can have push access to one project.)
37 <p>You may experience permission problems if you try to push right now.
38 If so, that should get fixed automagically in few minutes.</p>
39 <p>Enjoy yourself!</p>
47 <p>Here you can register a project.
48 It can be hosted in two modes: mirror mode and push mode.
49 In the first mode, we will check another repository at a given URL each hour and mirror any new updates.
50 In the second mode, registered users with appropriate permissions will be able to push to the repository.
51 You currently cannot switch freely between those two modes;
52 if you want to switch an existing project, please contact the administrator.</p>
53 <p>You will need the admin password to adjust project settings later
54 (mirroring URL, list of users allowed to push, project description, ...).
55 Use the project name as the username when asked by the browser.</p>
56 <p>By submitting this form, you are confirming that the repository contains only free software
57 and redistributing it does not violate any law of Czech Republic. Have fun!</p>
59 <p>Project name (w/o the .git suffix): <input type="text" name="name" /></p>
60 <p>Admin password: <input type="password" name="pwd" /></p>
61 <p>E-mail contact: <input type="text" name="email" /></p>
62 <p>Description: <input type="text" name="desc" /></p>
63 <p>Homepage URL: <input type="text" name="hp" /></p>
64 <p>Hosting mode:</p><ul>
65 <li><input type="radio" name="mode" value="mirror" />Mirror mode. Repository URL: <input type="text" name="url" /></li>
66 <li><input type="radio" name="mode" value="push" />Push mode.</li></ul>
67 <p><input type="submit" name="y0" value="Register" /></p>