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