/[webwml]/newmaint/gpgregister.wml
ViewVC logotype

Contents of /newmaint/gpgregister.wml

Parent Directory Parent Directory | Revision Log Revision Log


Revision 1.5 - (show annotations) (download)
Fri Jul 13 18:36:46 2001 UTC (11 years, 10 months ago) by tbm
Branch: MAIN
Changes since 1.4: +2 -2 lines
more WML<->PHP interactions
1 <?
2 include("gpgconfig.inc");
3 include("common.inc");
4
5 ?>
6 #use wml::gpgpage title="GPG Signing Coordination - Register"
7
8 <?
9
10 if ($email) {
11 if ($passwd != $passwd2) {
12 echo "Passwords do not match, please try again";
13 } else {
14 if (! ($db = open_db())) {
15 return FALSE;
16 }
17
18 $sql = "SELECT id FROM people WHERE email = '$email'";
19 if (! ($result = pg_exec($db, $sql))) {
20 echo "Problem with query", pg_ErrorMessage($db), "<BR>";
21 return FALSE;
22 }
23 if (pg_NumRows($result) > 0) {
24 echo "That e-mail address is in the database already.";
25 return FALSE;
26 }
27
28 $now = strftime('%Y-%m-%d');
29 $sql = "INSERT INTO people (forename, surname, email, passwd, offer, last_update) VALUES ('$forename', '$surname', '$email', $passwd, $offer, $now)";
30 if (! ($result = pg_exec($db, $sql))) {
31 echo "Problem with query", pg_ErrorMessage($db), "<BR>";
32 return FALSE;
33 } else {
34 echo "OK.";
35 }
36
37 }
38 } else {
39 echo "<div align=\"center\">\n", "<FORM method=\"post\" action=\"gpgregister.php\">\n",
40 "<TABLE summary=\"\">\n",
41 "<TR><TD><B>Forename</B></TD><TD><INPUT name=\"forename\" type=\"text\"></TD></TR>",
42 "<TR><TD><B>Surname</B></TD><TD><INPUT name=\"surname\" type=\"text\"></TD></TR>",
43 "<TR><TD><B>E-mail:</B></TD><TD>",
44 "<INPUT name=\"email\" type=\"text\"></TD></TR>",
45 "<TR><TD><B>Password:</B></TD><TD> <INPUT name=\"passwd\" type=\"password\"></TD></TR>",
46 "<TR><TD><B>Password (again):</B></TD><TD> <INPUT name="\passwd2\"",
47 "type=\"password\"></TD></TR>",
48 "<TR><TD><B>Offer to sign key</B></TD><TD><INPUT name=\"offer\" type=\"checkbox\"></TD></TR>",
49 "<TR><TD> </TD><TD><INPUT type=\"submit\" value=\"Login\"></TD></TR>",
50 "</TABLE>\n</FORM>\n</CENTER>\n";
51 }
52
53 ?>
54

  ViewVC Help
Powered by ViewVC 1.1.5