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

Contents of /newmaint/gpglogin2.wml

Parent Directory Parent Directory | Revision Log Revision Log


Revision 1.7 - (show annotations) (download)
Sun Aug 14 19:15:17 2005 UTC (7 years, 9 months ago) by tbm
Branch: MAIN
Changes since 1.6: +0 -1 lines
this causes PHP compatibility warnings; the docs say that unset() should be
used but that doesn't seem to work either.  I'm not sure this stuff is
actually needed anyway so let's remove it.
1 <?
2
3 session_start();
4 include("gpgconfig.inc");
5 include("common.inc");
6
7 session_name("GPG-Coord");
8
9 ?>
10 <HTML>
11 <BODY bgcolor="#ffffff">
12 <?
13 function find_person($login, $password) {
14 global $s_username;
15
16 if (! ($db = open_db())) {
17 return FALSE;
18 }
19 $sql = "SELECT * FROM people WHERE email = '$login'";
20 if (! ($result = pg_exec($db, $sql))) {
21 echo "Problem with query", pg_ErrorMessage($db), "<BR>";
22 return FALSE;
23 }
24 if (pg_NumRows($result) == 1) {
25 $row = pg_Fetch_Array($result, 0);
26 if ((passwd_verify($row["passwd"], $password)) || ($row["passwd"] == "")) {
27 $s_username = $login;
28 session_register("s_username");
29 return TRUE;
30 }
31 }
32 return FALSE;
33 }
34 ?>
35 <?
36 #=============main()
37 if ($_REQUEST['username'] == "") {
38 ?>
39 No username supplied, please click the back button and enter in a username.
40 <?
41 session_destroy();
42 } else {
43 $username = strip_tags($_REQUEST['username']);
44 $passwd = strip_tags($_REQUEST['passwd']);
45 if (find_person($username, $passwd)) {
46
47 echo "<META http-equiv=\"refresh\" content=\"0;URL=gpgmain.php?";?><?=SID?>
48 <? echo "\">"; ?>
49 Logged in ok, click <A href="gpgmain.php?<?=SID?>">here</A> to continue if the
50 refresh doesn't do it itself.
51 <?
52 } else {
53 session_destroy();
54 echo "<P>I can either not find you in the database or you have entered in ",
55 "the wrong password. Click <A href=\"gpgpasswd.php?email=$username\">here</A> ",
56 "to receive your password by e-mail.</P>";
57 }
58 } ?>
59 </BODY>
60 </HTML>

  ViewVC Help
Powered by ViewVC 1.1.5