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

Contents of /newmaint/gpgmain.wml

Parent Directory Parent Directory | Revision Log Revision Log


Revision 1.15 - (hide annotations) (download)
Sun Aug 14 19:16:26 2005 UTC (7 years, 9 months ago) by tbm
Branch: MAIN
CVS Tags: HEAD
Changes since 1.14: +3 -0 lines
add proper copyright headers.  This code is unser the GPL, version 2 or
higher.  Most of it has been written by Craig Small <csmall@debian.org> and
Martin Michlmayr <tbm@cyrius.com>, with some contributions from Peter
Palfrader <weasel@debian.org>, Ralf Treinen <treinen@debian.org> and
others.
1 tbm 1.15 # 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 tbm 1.1 <?
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 weasel 1.6 <STRONG>You should not be here!</STRONG>
16     There's no session registered for you. Please relogin.
17 tbm 1.1 <? } else {
18     session_register("s_username");
19     ?>
20    
21     <?
22     if (($db = open_db())) {
23 tbm 1.13 $s_username = $_SESSION['s_username'];
24 tbm 1.11 $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 weasel 1.6
35 tbm 1.11 $row = pg_Fetch_Array($result, 0);
36     $luser_error = "";
37 weasel 1.6
38 tbm 1.13 if ($_REQUEST['update']) {
39     $forename = $_REQUEST["forename"];
40     $surname = $_REQUEST["surname"];
41 tbm 1.11 $email = $row["email"];
42 tbm 1.13 $offer = ($_REQUEST["offer"] == "t") ? "t" : "f";
43 tbm 1.12 $id = $row["id"];
44     $last_update = $row["last_update"];
45 tbm 1.13 $url = $_REQUEST["url"];
46 tbm 1.12
47 tbm 1.13 if ($_REQUEST["passwd1"] != $_REQUEST["passwd2"]) {
48 tbm 1.12 $luser_error = "Passwords do not match, please try again";
49     } else {
50 tbm 1.13 if ($_REQUEST["passwd1"] != "") {
51     $passwd = passwd_crypt($_REQUEST["passwd1"]);
52 tbm 1.12 $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 tbm 1.14 echo "Updated entry<p>";
65 tbm 1.12 }
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 weasel 1.6
76 tbm 1.1 ?>
77    
78 weasel 1.6 <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 tbm 1.12 printf ('<TR><TD colspan="2"><FONT color="red">%s</FONT></TD></TR>', $luser_error);
85     }
86 weasel 1.7 print_text('Forename:' , 'forename' , $forename , 1);
87     print_text('Surname:' , 'surname' , $surname , 1);
88     print_text('Email:' , 'email' , $email , 0);
89 tbm 1.11 print_text_size('URL:' , 'url' , $url , 1, 40);
90 weasel 1.7 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 weasel 1.6 ?>
100     </TABLE>
101 tbm 1.10 <INPUT TYPE="submit" VALUE="Update"> <INPUT TYPE="reset">
102 weasel 1.6 </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 tbm 1.5 <P>Add <A HREF = "gpgplace.php">a new entry</A>.</P>
112 weasel 1.6 <?
113     } else {
114     ?>
115 tbm 1.12 Could not open the Database. You'r out of luck. Pester someone to get it fixed.
116 weasel 1.6 <?
117 tbm 1.12 } #dbopen
118     } #session_register
119 weasel 1.6 ?>
120 tbm 1.5

  ViewVC Help
Powered by ViewVC 1.1.5