2 # (c) Zachary T Welch <zw@superlucidity.net>
3 # (c) Petr Baudis <pasky@suse.cz>
9 use lib
qw(/home/repo/repomgr/cgi);
12 my $repo = Git
::RepoCGI
->new('Forgotten Project Password');
13 my $name = $repo->sparam('name');
14 my $proj = $repo->load_project($name);
16 my $mail = $proj->{email
};
18 if ($repo->sparam('y0')) {
20 my $newpwd = genpwd
();
22 my $domain = $repo->site_domain;
23 my $subject = "[$domain] New password for project $name";
24 open (M
, '|-', 'mail', '-s', $subject, $mail)
25 or $repo->bye("Cannot spawn mail: $!");
29 Somebody requested the password for project '$name.git' to be reset.
31 This address has been listed as the contact address for the project,
32 so you are receiving the new password:
36 If you did not request the password to be reset, then we apologize.
37 In any event, you must now use this new password to change the settings
38 for the '$name.git' project.
40 If you would like to change your project password again, you can use
41 this quick link to edit the project page:
43 Quick-link to the edit project page:
45 http://$domain/m/editproj.cgi?name=$name
49 close M
or $repo->bye("Sending mail to $mail for $name failed: $!");
51 $proj->update_password($newpwd);
53 print "<p>Project password has been reset. Have a nice day.</p>\n";
58 <p>If you have forgotten the admin password for the '$name' project,
59 it can be reset to a random string that will be mailed to the listed
60 contact e-mail address: <tt><$mail></tt>.</p>
62 <input type="hidden" name="name" value="$name" />
63 <p><input type="submit" name="y0" value="Reset Password" /></p>