Mercurial > hg > fapweb
comparison usrajax.js.php @ 1085:01783161eeb2
Fix usr and adm ajax and voting.
author | Matti Hamalainen <ccr@tnsp.org> |
---|---|
date | Wed, 25 Jan 2017 22:39:42 +0200 |
parents | 7da8bde9b7be |
children |
comparison
equal
deleted
inserted
replaced
1084:e1cfbfb0b64a | 1085:01783161eeb2 |
---|---|
3 // FAPWeb - Simple Web-based Demoparty Management System | 3 // FAPWeb - Simple Web-based Demoparty Management System |
4 // User actions page AJAX javascript module | 4 // User actions page AJAX javascript module |
5 // (C) Copyright 2012-2017 Tecnic Software productions (TNSP) | 5 // (C) Copyright 2012-2017 Tecnic Software productions (TNSP) |
6 // | 6 // |
7 $sessionType = "user"; | 7 $sessionType = "user"; |
8 header("Content-Type: application/javascript"); | |
8 require_once "mconfig.inc.php"; | 9 require_once "mconfig.inc.php"; |
9 require_once "msite.inc.php"; | 10 require_once "msite.inc.php"; |
10 require_once "msession.inc.php"; | 11 require_once "msession.inc.php"; |
11 | 12 |
12 | 13 |
13 if (!stUserSessionAuth() || !stCSRFCheck()) | 14 // Initiate SQL database connection |
15 if (!stConnectSQLDB()) | |
14 exit; | 16 exit; |
17 | |
18 // Fetch non-"hardcoded" settings from SQL database | |
19 stReloadSettings(); | |
20 | |
21 stUserSessionAuth(); | |
15 | 22 |
16 stCommonAJAX("usrajax.php", "usrlogout.php"); | 23 stCommonAJAX("usrajax.php", "usrlogout.php"); |
17 | 24 |
25 | |
18 ?> | 26 ?> |
27 | |
28 function updateVote(eid, value) | |
29 { | |
30 var msuccess = function(txt) | |
31 { | |
32 } | |
33 | |
34 var mfail = function(txt) | |
35 { | |
36 jsMessageBox("<h1>Ooops, an error occured</h2><p>Something went wrong, votes might not be submitted. :(</p>"); | |
37 } | |
38 | |
39 jsSendPOSTRequest("action=set&entry_id="+eid+"&vote="+value, msuccess, mfail); | |
40 return false; | |
41 } |