Mercurial > hg > fapweb
diff usrajax.php @ 216:bcc3c4696b3e
Some more work.
author | Matti Hamalainen <ccr@tnsp.org> |
---|---|
date | Sun, 17 Nov 2013 22:28:48 +0200 |
parents | 5bae42020034 |
children | 1bb4f4bcb027 |
line wrap: on
line diff
--- a/usrajax.php Sun Nov 17 22:17:11 2013 +0200 +++ b/usrajax.php Sun Nov 17 22:28:48 2013 +0200 @@ -75,42 +75,13 @@ // // Handle the request // -$action = "ERROR"; -if (stChkRequestItem("action") && stChkRequestItem("type")) -{ - $action = $_REQUEST["action"]; - $type = $_REQUEST["type"]; -} - -switch ($action) +switch (stGetRequestItem("action")) { - case "get": - // - // Get specific data - // - switch ($type) - { - case "votes": - $sql = "SELECT * FROM votes ORDER BY utime DESC"; - break; - } - - // - // Perform query if we need to, output results - // - if (isset($sql) && ($res = stExecSQLCond($sql, "")) !== FALSE) - { - if ($type == "votes") - { - } - } - break; - case "set": // // Set vote, if voting is enabled // - if ($type == "votes" && stChkSetting("allowVoting") && + if (stChkSetting("allowVoting") && stChkRequestItem("votekey") && stChkRequestItem("entry_id") && stChkRequestItem("vote"))