Fix links to other CGIs
[girocco.git] / cgi / reguser.cgi
blob87a1ed332d5922c83694a9018c85d04099416d71
1 #!/usr/bin/perl
2 # (c) Petr Baudis <pasky@suse.cz>
3 # GPLv2
5 use strict;
6 use warnings;
8 use lib qw(/home/repo/repomgr/cgi);
9 use Git::RepoCGI;
11 my $repo = Git::RepoCGI->new('User Registration');
12 my $cgi = $repo->cgi;
14 if ($cgi->param('name')) {
15 # submitted, let's see
16 # FIXME: racy, do a lock
17 my $name = $repo->wparam('name');
18 valid_name($name)
19 and Git::RepoCGI::User::does_exist($name)
20 and $repo->err("User with that name already exists.");
22 my $user = Git::RepoCGI::User->ghost($name);
23 if ($user->cgi_fill($repo)) {
24 $user->conjure;
25 print <<EOT;
26 <p>
27 User successfuly registered.
28 You (or whoever knows the project password) can <a href="p/editproj.cgi">assign it</a> to a project now
29 (use project name as username, admin password as password).
30 (One user can have push access to multiple projects and multiple users can have push access to one project.)
31 </p>
32 <p>Congratulations!</p>
33 EOT
34 exit;
38 print <<EOT;
39 <p>Here you can register a user.
40 You need to register a user so that it can be granted push access to project(s).
41 SSH is used for pushing (the git+ssh protocol) and what authenticates you is your SSH key -
42 there is no password (though we recommend that your SSH key is password-protected).
43 You can find your public key in ~/.ssh/id_rsa.pub or ~/.ssh/id_dsa.pub;
44 if you do not have any yet, generate it using the ssh-keygen command.
45 You can paste multiple keys in the box below, if you wish, each on a separate line.
46 Changing the keys later is not implemented yet - if you need to do that, please contact the administrator.</p>
47 <p>We won't bother to verify your email contact,
48 but fill in something sensible in your own interest
49 so that we can contact you or confirm your identity shall the need arise.</p>
50 <p>By submitting this form, you are confirming that you will push only free software
51 and no content that would violate any law of Czech Republic. Have fun!</p>
52 <form method="post">
53 <p>Login: <input type="text" name="name" /></p>
54 <p>Email: <input type="text" name="email" /></p>
55 <p>Public SSH key(s): <textarea name="keys" cols="80" rows="10"></textarea></p>
56 <p><input type="submit" name="y0" value="Register" /></p>
57 </form>
58 EOT