assign("output", $output); $tpl->printToScreen( ); dbclose( ); exit( ); } if($maintenance && $passwd['level'] < 0) { header("Location: maintenance.php"); exit( ); } $encryptedpassword = md5($_POST['password']); if($passwd['level'] == -1) { require_once("header.php"); //make a new TemplatePower object if(file_exists("$skindir/default.tpl")) $tpl = new TemplatePower( "$skindir/default.tpl" ); else $tpl = new TemplatePower("default_tpls/default.tpl"); include_once("includes/pagesetup.php"); $output = write_error(_ACCOUNTLOCKED); $tpl->assign("output", $output); $tpl->printToScreen( ); dbclose( ); exit( ); } if($passwd['password'] == $encryptedpassword) { if(isset($_POST['cookiecheck'])) { setcookie($sitekey."_useruid",$passwd['uid'], time()+60*60*24*30, "/"); setcookie($sitekey."_salt", md5($passwd['email'] . $encryptedpassword), time()+60*60*24*30, "/"); } if(!isset($_SESSION)) session_start( ); $_SESSION[$sitekey."_useruid"] = $passwd['uid']; $_SESSION[$sitekey."_salt"] = md5($passwd['email'] . $encryptedpassword); $logincode = dbquery("SELECT * FROM ".TABLEPREFIX."fanfiction_codeblocks WHERE code_type = 'login'"); while($code = dbassoc($logincode)) { eval($code['code_text']); } } else { require_once("header.php"); //make a new TemplatePower object if(file_exists("$skindir/default.tpl")) $tpl = new TemplatePower( "$skindir/default.tpl" ); else $tpl = new TemplatePower("default_tpls/default.tpl"); include_once("includes/pagesetup.php"); $output .= "
"._MEMBERLOGIN."
"; $output .= "
"._WRONGPASSWORD."
"; $tpl->assign("output", $output); $tpl->printToScreen( ); dbclose( ); exit( ); } $debug = $tempdebug; } else { require_once("header.php"); if(!isMEMBER) { $output .= "
"._MEMBERLOGIN."
"; $output .= "



"; $linkquery = dbquery("SELECT * from ".TABLEPREFIX."fanfiction_pagelinks WHERE link_name = 'login' OR link_name = 'lostpassword'"); while($link = dbassoc($linkquery)) { if($link['link_access'] && !isMEMBER) continue; if($link['link_access'] == 2 && !isADMIN) continue; $pagelinks[$link['link_name']] = array("id" => $link['link_id'], "text" => $link['link_text'], "url" => _BASEDIR.$link['link_url'], "link" => "".$link['link_text'].""); } $output .= "
"; if(isset($pagelinks['register'])) { $output .= $pagelinks['register']['link']." | "; } $output .= $pagelinks['lostpassword']['link']."
"; } } ?>