Mercurial > hg > fapweb
annotate usrlogin.php @ 156:fa7f3defffd0
Comments.
author | Matti Hamalainen <ccr@tnsp.org> |
---|---|
date | Fri, 25 Oct 2013 16:12:05 +0300 |
parents | 5b92f130ba87 |
children | 8df523e6326a |
rev | line source |
---|---|
110 | 1 <? |
155
5b92f130ba87
Add copyright header blurbs.
Matti Hamalainen <ccr@tnsp.org>
parents:
129
diff
changeset
|
2 // |
5b92f130ba87
Add copyright header blurbs.
Matti Hamalainen <ccr@tnsp.org>
parents:
129
diff
changeset
|
3 // FAPWeb Simple Demoparty System |
5b92f130ba87
Add copyright header blurbs.
Matti Hamalainen <ccr@tnsp.org>
parents:
129
diff
changeset
|
4 // Administration interface session login handler |
5b92f130ba87
Add copyright header blurbs.
Matti Hamalainen <ccr@tnsp.org>
parents:
129
diff
changeset
|
5 // (C) Copyright 2012-2013 Tecnic Software productions (TNSP) |
5b92f130ba87
Add copyright header blurbs.
Matti Hamalainen <ccr@tnsp.org>
parents:
129
diff
changeset
|
6 // |
110 | 7 $sessionType = "user"; |
8 require "mconfig.inc.php"; | |
9 require "msite.inc.php"; | |
10 require "msession.inc.php"; | |
11 | |
156 | 12 // |
13 // Initialize | |
14 // | |
110 | 15 stSetupCacheControl(); |
16 | |
17 if (!stConnectSQLDB()) | |
18 die("Could not connect to SQL database."); | |
19 | |
20 stReloadSettings(); | |
21 | |
22 | |
156 | 23 // |
24 // Authenticate | |
25 // | |
110 | 26 $gotoPage = stGetRequestItem("goto", FALSE); |
27 $password = stGetRequestItem("key", FALSE); | |
28 | |
29 $sql = stPrepareSQL("SELECT id FROM votekeys WHERE key=%s", $password); | |
30 if (($votekey_id = stFetchSQLColumn($sql)) !== false) | |
31 { | |
129 | 32 if (!stSessionStart(SESS_USER, $password, "userTimeout")) |
110 | 33 { |
34 error_log("User session AUTH LOGIN failed (session setup)"); | |
35 $gotoPage = "loginerror"; | |
36 } | |
37 else | |
38 stSetSessionItem("mode", stGetRequestItem("mode", "error")); | |
39 } | |
40 else | |
41 { | |
42 error_log("User session AUTH LOGIN failed (password)"); | |
43 $gotoPage = "loginerror"; | |
44 } | |
45 | |
123
5837b9333964
Add new "about" page, and setting for default page.
Matti Hamalainen <ccr@tnsp.org>
parents:
110
diff
changeset
|
46 header("Location: ".($gotoPage !== FALSE ? $gotoPage : stGetSetting("defaultPage"))); |
110 | 47 ?> |