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

Contents of /newmaint/gpglogin2.wml

Parent Directory Parent Directory | Revision Log Revision Log


Revision 1.1 - (hide annotations) (download)
Fri Jul 13 17:44:43 2001 UTC (11 years, 10 months ago) by tbm
Branch: MAIN
Initial GPG Key Signing Coordination system
1 tbm 1.1 <?
2    
3     session_start();
4     include("gpgconfig.inc");
5     include("common.inc");
6    
7     session_name("GPG-Coord");
8     session_unregister("s_username");
9    
10     ?>
11     <HTML>
12     <BODY bgcolor="#ffffff">
13     <?
14     function find_person($login, $password) {
15     global $s_username;
16    
17     if (! ($db = open_db())) {
18     return FALSE;
19     }
20     $sql = "SELECT * FROM people WHERE email = '$login'";
21     if (! ($result = pg_exec($db, $sql))) {
22     echo "Problem with query", pg_ErrorMessage($db), "<BR>";
23     return FALSE;
24     }
25     if (pg_NumRows($result) == 1) {
26     $row = pg_Fetch_Array($result, 0);
27     if (($row["passwd"] == $password) || ($row["passwd"] == "")) {
28     $s_username = $login;
29     session_register("s_username");
30     return TRUE;
31     }
32     }
33     return FALSE;
34     }
35     ?>
36     <?
37     #=============main()
38     if ($username == "") {
39     ?>
40     No username supplied, please click the back button and enter in a username.
41     <?
42     session_destroy();
43     } else {
44     $username = strip_tags($username);
45     $passwd = strip_tags($passwd);
46     if (find_person($username, $passwd)) {
47    
48     echo "<META http-equiv=\"refresh\" content=\"0;URL=gpgmain.php?";?><?=SID?>
49     <? echo "\">"; ?>
50     Logged in ok, click <A href="gpgmain.php?<?=SID?>">here</A> to continue if the
51     refresh doesn't do it itself.
52     <?
53     } else {
54     session_destroy();
55     ?>
56     <P>I can either not find you in the database or you have entered in
57     the wrong password. Click <A href="gpgpasswd.php?email=$username">here</A>
58     to receive your password by e-mail.</P>
59     <?
60     }
61     } ?>
62     </BODY>
63     </HTML>

  ViewVC Help
Powered by ViewVC 1.1.5