| 1 |
tbm |
1.1 |
<? |
| 2 |
|
|
session_start(); |
| 3 |
|
|
include("gpgconfig.inc"); |
| 4 |
|
|
include("common.inc"); |
| 5 |
|
|
include("gpgcommon.inc"); |
| 6 |
|
|
|
| 7 |
|
|
?> |
| 8 |
|
|
#use wml::gpgpage title="GPG Signing Coordination - Your profile" |
| 9 |
|
|
<? |
| 10 |
|
|
if (!session_is_registered("s_username")) { |
| 11 |
|
|
?> |
| 12 |
weasel |
1.6 |
<STRONG>You should not be here!</STRONG> |
| 13 |
|
|
There's no session registered for you. Please relogin. |
| 14 |
tbm |
1.1 |
<? } else { |
| 15 |
|
|
session_register("s_username"); |
| 16 |
|
|
?> |
| 17 |
|
|
|
| 18 |
|
|
<? |
| 19 |
|
|
if (($db = open_db())) { |
| 20 |
weasel |
1.6 |
|
| 21 |
|
|
$sql = "SELECT id, forename, surname, email, offer, last_update FROM people WHERE email = '$s_username'"; |
| 22 |
|
|
if (! ($result = pg_exec($db, $sql))) { |
| 23 |
|
|
echo "Problem with query", pg_ErrorMessage($db), "<BR>"; |
| 24 |
|
|
return FALSE; |
| 25 |
|
|
} |
| 26 |
|
|
|
| 27 |
|
|
if (pg_NumRows($result) != 1) { |
| 28 |
|
|
echo "That e-mail address is wicked."; |
| 29 |
|
|
return FALSE; |
| 30 |
|
|
} |
| 31 |
|
|
|
| 32 |
|
|
$row = pg_Fetch_Array($result, 0); |
| 33 |
|
|
$luser_error = ""; |
| 34 |
|
|
|
| 35 |
|
|
if ($update) { |
| 36 |
|
|
$email = $row["email"]; |
| 37 |
|
|
#$forename = # no filtering done |
| 38 |
|
|
#$surname = # no filtering done |
| 39 |
weasel |
1.7 |
$offer = ($offer == "t") ? "t" : "f"; |
| 40 |
weasel |
1.6 |
$id = $row["id"]; |
| 41 |
|
|
$last_update = $row["last_update"]; |
| 42 |
|
|
|
| 43 |
|
|
if ($passwd1 != $passwd2) { |
| 44 |
|
|
$luser_error = "Passwords do not match, please try again"; |
| 45 |
|
|
} else { |
| 46 |
|
|
if ($passwd1 != "") { |
| 47 |
|
|
$passwd = $passwd1; |
| 48 |
|
|
$sql = "UPDATE people SET forename = '$forename', surname = '$surname', email = '$email' , passwd = '$passwd', offer = '$offer', last_update = 'now' WHERE id=$id"; |
| 49 |
|
|
} else { |
| 50 |
|
|
$sql = "UPDATE people SET forename = '$forename', surname = '$surname', email = '$email' , offer = '$offer', last_update = 'now' WHERE id=$id"; |
| 51 |
|
|
}; |
| 52 |
|
|
|
| 53 |
|
|
if (! ($result = pg_exec($db, $sql))) { |
| 54 |
|
|
$luser_error = "Some error updating the database."; |
| 55 |
|
|
|
| 56 |
|
|
$email = $row["email"]; |
| 57 |
|
|
$forename = $row["forename"]; |
| 58 |
|
|
$surname = $row["surname"]; |
| 59 |
|
|
$id = $row["id"]; |
| 60 |
|
|
}; |
| 61 |
|
|
}; |
| 62 |
|
|
} else { |
| 63 |
|
|
$email = $row["email"]; |
| 64 |
|
|
$forename = $row["forename"]; |
| 65 |
|
|
$surname = $row["surname"]; |
| 66 |
|
|
$id = $row["id"]; |
| 67 |
weasel |
1.7 |
$offer = ($row["offer"] == "t") ? "t" : "f"; |
| 68 |
weasel |
1.6 |
$last_update = $row["last_update"]; |
| 69 |
|
|
}; |
| 70 |
|
|
|
| 71 |
tbm |
1.1 |
?> |
| 72 |
|
|
|
| 73 |
weasel |
1.6 |
<FORM action="gpgmain.php" method="POST"> |
| 74 |
|
|
<INPUT TYPE="hidden" NAME="update" VALUE="1"> |
| 75 |
|
|
<H2>Your info</H2> |
| 76 |
|
|
<TABLE> |
| 77 |
|
|
<? |
| 78 |
|
|
if ($luser_error) { |
| 79 |
|
|
printf ('<TR><TD colspan="2"><FONT color="red">%s</FONT></TD></TR>', $luser_error); |
| 80 |
|
|
}; |
| 81 |
weasel |
1.7 |
print_text('Forename:' , 'forename' , $forename , 1); |
| 82 |
|
|
print_text('Surname:' , 'surname' , $surname , 1); |
| 83 |
|
|
print_text('Email:' , 'email' , $email , 0); |
| 84 |
|
|
print_text('Last update:', 'last_update', $last_update, 0); |
| 85 |
|
|
|
| 86 |
|
|
echo '<TR><TD colspan="2">Change password:</TD></TR>'; |
| 87 |
|
|
print_passwd('New Password:', 'passwd1'); |
| 88 |
|
|
print_passwd('Confirm:' , 'passwd2'); |
| 89 |
|
|
|
| 90 |
|
|
echo '<TR><TD colspan="2">Switch offer / require signatures (If you are a Debian developer, this should be <em>checked</em>)</TD></TR>'; |
| 91 |
|
|
print_checkbox('Offer to sign key:', 'offer', $offer, 1) |
| 92 |
|
|
|
| 93 |
weasel |
1.6 |
?> |
| 94 |
|
|
</TABLE> |
| 95 |
|
|
<INPUT TYPE="submit"> <INPUT TYPE="reset"> |
| 96 |
|
|
</FORM> |
| 97 |
|
|
|
| 98 |
|
|
<P><A HREF="gpguserdel.php">Remove</A> yourself from the database.</P> |
| 99 |
|
|
|
| 100 |
|
|
<H2>Your places</H2> |
| 101 |
|
|
<? |
| 102 |
|
|
print_all_places($id, TRUE); |
| 103 |
|
|
|
| 104 |
|
|
?> |
| 105 |
tbm |
1.5 |
<P>Add <A HREF = "gpgplace.php">a new entry</A>.</P> |
| 106 |
weasel |
1.6 |
<? |
| 107 |
|
|
} else { |
| 108 |
|
|
?> |
| 109 |
|
|
Could not open the Database. You'r out of luck. Pester someone to get it fixed. |
| 110 |
|
|
<? |
| 111 |
|
|
}; #dbopen |
| 112 |
|
|
}; #session_register |
| 113 |
|
|
?> |
| 114 |
tbm |
1.5 |
|