2 # (c) Petr Baudis <pasky@suse.cz>
14 my $gcgi = Girocco
::CGI
->new('User Registration');
17 unless ($Girocco::Config
::manage_users
) {
18 print "<p>I don't manage users.</p>";
22 if ($cgi->param('mail')) {
23 print "<p>Go away, bot.</p>";
27 if ($cgi->param('name')) {
28 # submitted, let's see
29 # FIXME: racy, do a lock
30 my $name = $gcgi->wparam('name');
31 Girocco
::User
::valid_name
($name)
32 and Girocco
::User
::does_exist
($name)
33 and $gcgi->err("User with that name already exists.");
35 my $user = Girocco
::User
->ghost($name);
36 if ($user->cgi_fill($gcgi)) {
39 <p>User $name successfuly registered.</p>
40 <p>Project administrators can now give you push access to their projects.</p>
41 <p>Congratulations, and have a lot of fun!</p>
48 <p>Here you can register a user.
49 You need to register a user so that you can push to the hosted projects.</p>
50 <p>SSH is used for pushing (the <tt>ssh</tt> protocol), your SSH key authenticates you -
51 there is no password (though we recommend that your SSH key is password-protected;
52 use <code>ssh-agent</code> to help your fingers).
53 You can find your public key in <tt>~/.ssh/id_rsa.pub</tt> or <tt>~/.ssh/id_dsa.pub</tt>.
54 If you do not have any yet, generate it using the <code>ssh-keygen</code> command.
55 You can paste multiple keys in the box below, each on a separate line.
56 Paste each key <em>including</em> the <tt>ssh-</tt>whatever prefix and email-like postfix.</p>
57 <p>We won't bother to verify your email contact,
58 but fill in something sensible in your own interest
59 so that we can contact you or confirm your identity shall the need arise.
60 We also need to send you an e-mail if you want to update your SSH keys later.</p>
61 $Girocco::Config::legalese
64 <tr><td class="formlabel">Login:</td><td><input type="text" name="name" /></td></tr>
65 <tr><td class="formlabel">Email:</td><td><input type="text" name="email" /></td></tr>
66 <tr><td class="formlabel">Public SSH key(s):</td><td><textarea wrap="off" name="keys" rows="5" cols="80"></textarea></td></tr>
67 <tr style="display:none"><td class="formlabel">Anti-captcha (leave empty!):</td><td><input type="text" name="mail" /></td></tr>
68 <tr><td class="formlabel"></td><td><input type="submit" name="y0" value="Register" /></td></tr>