No longer salting login user name
[squasher.git] / index.php
1 <?php
2
3 require_once("include/connect.inc.php");
4
5 require_once("squasher.class.php");
6
7 //login info
8 $vars[user]=$_POST[user];
9 $vars[pass]=$_POST[pass];
10 $vars[debug]=$_GET[debug];
11 $vars[newtpl]=$_GET[newtpl];
12 $tools=$_GET[tools];
13
14 foreach($_POST AS $key => $value) $submitted[$key]=$value;
15
16 $salt=md5($_SERVER[REMOTE_ADDR]."|".$_SERVER[HTTP_USER_AGENT]);
17
18 if ($tools=="logout"){
19         session_destroy();
20         $_SESSION[creds][validated]=false;
21         header( 'Location: '.$_SERVER['PHP_SELF'] ) ;
22 }
23
24 if (!$_SESSION[creds][validated]){
25         validate_user($vars,$salt);
26 }
27
28 if ($_SESSION[creds][validated] || isset($_GET['f'])){  
29 //if ($_SESSION[creds][validated]){
30 //load squasher
31         include("squasher.php");
32 }else{
33
34 //show login
35
36 require_once("smarty/Smarty.class.php");
37
38 $smarty = new Smarty;
39
40 $smarty->assign('salt',$salt);
41 $smarty->assign('debug',$debug);
42 $smarty->display('login.tpl');
43
44 }
45 ?>