<?php
error_reporting(0);
require_once "quickprotect.class.php";
$quickprotect = new quickprotect('login.ini.php');

if (isset($_SESSION['goAfterLogin'])){
    $goto = $_SESSION['goAfterLogin'];
    unset($_SESSION['goAfterLogin']);
}
else $goto = $quickprotect->settings['DEFAULT_LOGIN_SUCCESS_PAGE'];

if (isset($_POST[username])) {
    if($quickprotect->login($_POST[username], $_POST[password])) header ("Location: $goto");
}

if (isset($_GET['changepassword'])){
    $quickprotect->setNewPassword($_POST[username], $_POST[oldpassword], $_POST[newpassword]);
}

if ($_GET['do']=="logout") {
    $quickprotect->logout();
}
?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title><?php echo file_get_contents("../rr/productname.txt", true); ?> - Setup</title>
<link href="../css/css.css" rel="stylesheet" type="text/css" />

<script type="text/javascript" src="script/nicEdit.js"></script>
<script type="text/javascript">
	bkLib.onDomLoaded(function() { nicEditors.allTextAreas() });
</script>

</head>

<body>

<div id="mainWrapper">

	<form action="login.php" method="POST">
    
	<div id="mainTopArea">
    
    	<div id="LogoArea">
        	<img src="../rr/logo.png" style="margin-left:-9px;" />
        </div>
    	<br clear="left" />
    
    </div>
    
    <div id="mainSection">
    
    	<div id="createdVersions">
        	
            <div id="cookieCrumb" style=" margin-top:17px;">
        
        	<span><a href="#" class="viewall">view all fanpages</a></span> <span style="margin-left:10px; margin-right:10px;">-</span> <span><strong>Login Page</strong></span>
        
        </div>
            
            <div id="cvTitle">
       	  <span><strong ">Login Into Admin Area...</strong></span></div>
            
            <div id="cvCreatedList">
            
            	<div class="ListITEM_create">
                
                	<div class="ctTitle" >
                	<span><img src="../images/bullet_go.png" style="margin-right:15px; margin-left:15px; margin-bottom:-3px;" /><strong style="font-size:14px;">Username &amp; Password Required...</strong> <?php echo $quickprotect->echoMsg(); ?></span></div>
                    
                    
                                   
                </div>
         </div>
        
        
        </div>
        
<div id="shadow" align="center" style="margin-top:1px;">
        	<img src="../images/shadow.png" />
      </div>
       
        
        <div id="templateChooser" style="margin-left:47px; margin-right:47px;">
        
        	<table width="100%" border="0" cellspacing="0" cellpadding="0">
              <tr>
                <td width="250"><p><strong>Username:</strong><br />
                  refer to the manual if forgotten...</p></td>
                <td>
                <input class="textinputCreate" type="text" name="username"  /></td>
              </tr>
            </table>
            
			<div class="splitterest"></div>
            
            <table width="100%" border="0" cellspacing="0" cellpadding="0">
              <tr>
                <td width="250"><p><strong>Password:</strong><br />
                  Can be changed in ini file...</p></td>
                <td>
                
                <input class="textinputCreate" type="password" name="password"  /></td>
              </tr>
            </table>
            
			<div class="splitterest"></div>
            	
            <div></div>
        
        	
            
        	
        </div>
         <br clear="right" />
    </div>
         
        
        
        <div id="createNewVersion">
          <div id="videoTutorial2">
                	
            
                    
                    <div id="supportTalk" align="center" >
                    
                    <span><input type="image" src="../images/login.png"  /></span>
                    
                    </div>
          </div>
        
        	<br clear="left" />
           
          
  </div>
        
        <div id="FooterArea" align="center">
        
        	<span><strong><?php echo file_get_contents("rr/productname.txt", true); ?></strong> - All Rights Reserved - This was made in 2010 - <?php echo file_get_contents("rr/producttag.txt", true); ?> </span>
        
        </div>
</form>

</div>

</body>
</html>
