showHeader(); GWF_Debug::setDieOnError(false); GWF_Debug::setMailOnError(false); # EMULATE REGISTER GLOBALS = ON foreach ($_GET as $k => $v) { $$k = $v; } # Send request? if (isset($_POST['password']) && isset($_POST['username']) && is_string($_POST['password']) && is_string($_POST['username']) ) { $uname = GDO::escape($_POST['username']); $pass = md5($_POST['password']); $query = "SELECT level FROM ".GWF_TABLE_PREFIX."wc_chall_reg_glob WHERE username='$uname' AND password='$pass'"; $db = gdo_db(); if (false === ($row = $db->queryFirst($query))) { echo GWF_HTML::error('Register Globals', $chall->lang('err_failed')); } else { # Login success $login = array($_POST['username'], (int)$row['level']); } } if (isset($login)) { echo GWF_HTML::message('Register Globals', $chall->lang('msg_welcome_back', array(htmlspecialchars($login[0]), htmlspecialchars($login[1])))); if (strtolower($login[0]) === 'admin') { $chall->onChallengeSolved(GWF_Session::getUserID()); } } else { ?>
$v) { unset($$k); } require_once 'challenge/html_foot.php'; ?>