2 # (c) Petr Baudis <pasky@suse.cz>
8 use lib
qw(/home/repo/repomgr/cgi);
11 my $repo = Git
::RepoCGI
->new('User Registration');
13 $repo->bye("<p>Go away, bot.</p>") if $repo->sparam('mail');
15 if ($repo->sparam('y0')) {
16 # submitted, let's see
17 # FIXME: racy, do a lock
18 my $name = $repo->wparam('name');
19 valid_user_name
($name)
20 and Git
::RepoCGI
::User
::does_exist
($name)
21 and $repo->err("User with that name already exists.");
23 my $user = Git
::RepoCGI
::User
->ghost($name);
24 if ($user->cgi_fill($repo)) {
27 <p>User $name successfuly registered.</p>
29 You can now <a href="regproj.cgi?mode=push">start a hosted project</a>
30 and <a href="regproj.cgi?mode=fork">create forks</a>. To use them, you
31 need to <a href="editproj.cgi">grant push access</a> to yourself,
32 using the project's adminstration password.
35 Of course, other administrators can give you access to an existing
36 project, but why share their project when <em>you can have your own
37 fork</em>? You can have push access to many projects, and little
38 additional resources will be used by creating new forks.
40 <p>Congratulations! Now, get forking!</p>
46 my $name = $repo->wparam('name');
47 my $email = $repo->sparam('email');
48 my $keys = $repo->sparam('keys');
51 This page allows you to register as a user of this service.
52 You must register as a user in order to be granted push access
53 to depot mode projects that you create.
56 <h2>User Acount Access</h2>
58 SSH is used for pushing (the <tt>git+ssh</tt> protocol), and the
59 SSH key that you provide in this form will be used to authenticate you.
60 There is no password; however, we recommend that your private SSH key
61 be password-protected; use <code>ssh-agent</code> to help your fingers.
63 You can find your public key in <tt>~/.ssh/id_rsa.pub</tt> or
64 <tt>~/.ssh/id_dsa.pub</tt>. If you do not have one yet, you can
65 generate it using the <code>ssh-keygen</code> command.
68 You can paste multiple keys in the box below, each on a separate line.
69 Paste each key <em>including</tt> the <tt>ssh-</tt>whatever prefix and
73 <h2>E-mail Address</h2>
75 We do not share your email contact, but this address may be used to
76 contact you or confirm your identity shall the need arise. We also
77 need to send you an e-mail if you want to update your SSH keys later.
82 By submitting this form, you are confirming that you will push only free
83 software and no content that would violate any law of Czech Republic.
84 You also agree to the <a href=/about.html">terms for using the site</a>.
90 <h3>Register Account</h3>
92 <p>Login: <input type="text" name="name" value="$name" /></p>
93 <p>Email: <input type="text" name="email" value="$email" /></p>
94 <p>Public SSH key(s): <br />
95 <textarea name="keys" rows="5" cols="80">$keys</textarea></p>
96 <p style="display:none">Anti-captcha (leave empty!): <input type="text" name="mail" /></p>
97 <p><input type="submit" name="y0" value="Register" /></p>