<html>
<head><title>tHc Private Server Booking</title></head>
  <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
  <link rel="stylesheet" media="screen" type="text/css" href="css/design.css"  />
<body>

<div id="entete"></div>
<div id="menu">
<div class="element_menu">
  <ul>
    <li><a href="http://www.thcteam.org">Accueil</a></li>

    <li><a href="http://forum.thcteam.org">Forum</a></li>
    <li><a href="http://wiki.thcteam.org">Wiki</a></li>
    <li><a href="http://www.thcteam.org/map.php">Download maps</a></li>
    <li><a href="http://thcteam.org/reservation/overview.py">Réservations</a></li>
  </ul>
</div>
</div>

<div id="liens">
  <ul>

   <li><a href="login.py">Login</a></li>
   <li><a href="form.py">Form</a></li>
   <li><a href="overview.py">Overview</a></li>
  </ul>
</div>
<body>
<%
import cgi, os, MySQLdb
from reservation import Authenticator
from reservation_session import getSession
import util

session = getSession(req)

login = form.getfirst('login')
password = form.getfirst('password')
returnURL = form.getfirst('returnURL')
if not returnURL:
    returnURL = "overview.py"
else:
    returnURL = str(returnURL)

authenticated = False
msg = ""
if login and password:
    login = MySQLdb.escape_string(login)
    password = MySQLdb.escape_string(password)

    auth = Authenticator()
    user = auth.authenticate(login, password)
    auth.close()
    if user:
         session.setUser(login)
         session.save()
         authenticated = True
         util.redirect(req, returnURL)
    else:
        msg = "Wrong login or password"

    #
if not authenticated:
%>
<div id="formulaire">
<%=msg%><br>
<form method="post" action="">
<p>Login: <input type="text" name="login" /><br />
Password: <input type="password" name="password" /><br />
<input type="hidden" name="returnURL" value="<%=returnURL%>" >
<input type="submit" value="Submit" /></p>

</form>
<p>To have an account, you just have to register on our forum(link above)</p>

</div>

<div id="pied">
   <p>Copyleft "tHcteam" 2007, aucun droits réservés. Thx to Whinze from wwF for the design</p>

<!-- phpmyvisites -->
<a href="http://www.phpmyvisites.net/" title="phpMyVisites | Open source web analytics" onclick="window.open(this.href);return(false);"><script type="text/j$
<!--
var a_vars = Array();
var pagename='';

var phpmyvisitesSite = 1;
var phpmyvisitesURL = "http://www.thcteam.org/phpmv2/phpmyvisites.php";
//-->
</script>
<script language="javascript" src="Site%20officiel%20des%20tHc_fichiers/phpmyvisites.js" type="text/javascript"></script>

<object><noscript><p>phpMyVisites | Open source web analytics
<img src="http://www.thcteam.org/phpmv2/phpmyvisites.php" alt="Statistics" style="border:0" />
</p></noscript></object></a>
<!-- /phpmyvisites -->
</div>
</body></html>
