Mercurial > hg > fapweb
view usrlogin.php @ 220:db433a1d22b4
Fix test data creation.
author | Matti Hamalainen <ccr@tnsp.org> |
---|---|
date | Mon, 18 Nov 2013 01:27:52 +0200 |
parents | 8df523e6326a |
children | 7181350076c1 |
line wrap: on
line source
<? // // FAPWeb Simple Demoparty System // Administration interface session login handler // (C) Copyright 2012-2013 Tecnic Software productions (TNSP) // $sessionType = "user"; require_once "mconfig.inc.php"; require_once "msite.inc.php"; require_once "msession.inc.php"; // // Initialize // stSetupCacheControl(); if (!stConnectSQLDB()) die("Could not connect to SQL database."); stReloadSettings(); // // Authenticate // $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, $password, "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 : stGetSetting("defaultPage"))); ?>