+ my $genderselect = '<select name="gender">'
+ . '<option value="9"'
+ . ($data{gender} == 9 ? ' selected' : '')
+ . '>unspecified'
+ . '<option value="1"'
+ . ($data{gender} == 1 ? ' selected' : '')
+ . '>male<option value="2"'
+ . ($data{gender} == 2 ? ' selected' : '')
+ . '>female</select>';
+ my $confirmstring = '';
+ my $sudopassword = '';
+ for my $entry (@{$entry->{'sudopassword'}}) {
+ my ($uuid, $status, $hosts, $crypted) = ($entry =~ /^([0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}) (confirmed:[0-9a-f]{40}|unconfirmed) ([a-z0-9.,*]+) ([^ ]+)$/);
+ unless (defined $uuid) {
+ $sudopassword .= "<tr><td>Unparseable line!</td></tr>\n";
+ next;
+ }
+ $status =~ s/:.*//; # remove verification hmac, it's just noise here.
+ my $e = "<tr><td>$hosts</td>
+ <td>$status</td>
+ <td><small>not shown</small></td>
+ <td><small><code>$uuid</code></small></td>
+ <td><input name=\"sudopassword-delete-$uuid\" type=\"checkbox\" value=\"delete\"> (delete)</td></tr>\n";
+ $sudopassword .= $e;
+ if ($status eq 'unconfirmed') {
+ my $hmac = hmac_sha1_hex( join(':', 'confirm-new-password', $uuid, $hosts, $crypted), $hmac_key);
+ $confirmstring .= "confirm sudopassword $uuid $hosts $hmac\n";
+ }
+ };
+ if ($confirmstring ne '') {
+ $confirmstring = "<br>To confirm your new sudo passwords send signed mail to changes\@db.debian.org with a signed body containing these lines:<br><pre>$confirmstring</pre>";
+ }
+
+ my $sudopasswordhosts = '<select name="newsudopass-host"> <option value="*">ALL';
+ for my $dn (sort {$host_entries->{$a}->{host}->[0] cmp $host_entries->{$b}->{host}->[0]} keys(%$host_entries)) {
+ my $data = $host_entries->{$dn};
+ my $host = $data->{'host'}->[0];
+ my $hostname = $data->{'hostname'}->[0];
+ $sudopasswordhosts .= "<option value=\"$host\">$hostname\n";
+ };
+ $sudopasswordhosts .= '</select>';
+