Mercurial > hg > fapweb
view usrlogin.php @ 120:2c594958050e
Make test vote keys "testN" where N >= 1
author | Matti Hamalainen <ccr@tnsp.org> |
---|---|
date | Tue, 22 Oct 2013 14:22:26 +0300 |
parents | ff511f5351df |
children | 5837b9333964 |
line wrap: on
line source
<? $sessionType = "user"; require "mconfig.inc.php"; require "msite.inc.php"; require "msession.inc.php"; stSetupCacheControl(); // Initiate SQL database connection if (!stConnectSQLDB()) die("Could not connect to SQL database."); // Fetch non-"hardcoded" settings from SQL database stReloadSettings(); $gotoPage = stGetRequestItem("goto", FALSE); $password = stGetRequestItem("key", FALSE); $sql = stPrepareSQL("SELECT id FROM votekeys WHERE key=%s", $password); if (($votekey_id = stFetchSQLColumn($sql)) !== false) { if (!stSessionStart(SESS_USER, $votekey_id, "userTimeout")) { error_log("User session AUTH LOGIN failed (session setup)"); $gotoPage = "loginerror"; } else stSetSessionItem("mode", stGetRequestItem("mode", "error")); } else { error_log("User session AUTH LOGIN failed (password)"); $gotoPage = "loginerror"; } header("Location: ".($gotoPage !== FALSE ? $gotoPage : "news")); ?>