Moved php files in webroot/
[squasher.git] / webroot / index.php
1 <?php
2
3 require_once("config.php");
4
5 require_once("squasher.class.php");
6
7 $salt = md5($_SERVER['REMOTE_ADDR']."|".$_SERVER['HTTP_USER_AGENT']);
8
9 if (@$_GET['tools']=="logout"){
10         session_destroy();
11         $_SESSION['creds']['validated'] = false;
12         header( 'Location: '.$_SERVER['PHP_SELF'] ) ;
13 }
14
15 if (!@$_SESSION['creds']['validated']){
16         validate_user(@$_POST['user'], @$_POST['pass'], $salt);
17 }
18
19 if ($_SESSION['creds']['validated'] || @$_GET['f']) {
20 //if ($_SESSION['creds']['validated']){
21         //load squasher
22         include("squasher.php");
23 } else {
24         //show login
25
26         $smarty = get_smarty();
27
28         $smarty->assign('salt', $salt);
29         $smarty->assign('debug', @$_GET['debug']);
30         $smarty->display('login.tpl');
31 }
32 // vim: syntax=php ts=4 sw=4 sts=4 sr noet
33 ?>