Removed mass delete wip
[squasher.git] / index.php
index 04222778344b72ccb662d1bfb6e171162caaac33..dfcc4689205efd4de0a1b232a728ce76c849793a 100644 (file)
--- a/index.php
+++ b/index.php
@@ -1,52 +1,35 @@
-<?
+<?php
 
-require_once("include/connect.inc.php");
+require_once("config.php");
 
 require_once("squasher.class.php");
 
-//login info
-$vars[user]=$_POST[user];
-$vars[pass]=$_POST[pass];
-$vars[debug]=$_GET[debug];
-$vars[newtpl]=$_GET[newtpl];
-$tools=$_GET[tools];
+$salt = md5($_SERVER['REMOTE_ADDR']."|".$_SERVER['HTTP_USER_AGENT']);
 
-foreach($_POST AS $key => $value) $submitted[$key]=$value;
-
-$saltplus=md5($_SERVER[REMOTE_ADDR].":".$_SERVER[REMOTE_PORT]."|".$_SERVER[HTTP_USER_AGENT]);
-$salt=md5($_SERVER[REMOTE_ADDR]."|".$_SERVER[HTTP_USER_AGENT]);
-
-//(md5(md5('jasper').$salt) == $vars[user]) ? $vun = "Username validated" : $vun = "Username incorrect";
-//(md5(md5('test'  ).$salt) == $vars[pass]) ? $vpw = "Password validated" : $vpw = "Password incorrect";
-//echo $vun . ' <br/> ' . $vpw;
-
-if ($tools=="logout"){
+if (@$_GET['tools']=="logout"){
        session_destroy();
-       $_SESSION[creds][validated]=false;
+       $_SESSION['creds']['validated'] = false;
        header( 'Location: '.$_SERVER['PHP_SELF'] ) ;
 }
 
-if (!$_SESSION[creds][validated]){
-       validate_user($vars,$salt);
+if (!@$_SESSION['creds']['validated']){
+       validate_user(@$_POST['user'], @$_POST['pass'], $salt);
 }
 
-if ($_SESSION[creds][validated] || isset($_GET['f'])){ 
-//if ($_SESSION[creds][validated]){
-//load squasher
+if ($_SESSION['creds']['validated'] || @$_GET['f']) {
+//if ($_SESSION['creds']['validated']){
+       //load squasher
        include("squasher.php");
-}else{
-
-//show login
-
-require_once("smarty/Smarty.class.php");
+} else {
+       //show login
 
-$smarty = new Smarty;
+       require_once(SQUASHER_SMARTY); // See config.php
 
-$smarty->assign('salt',$salt);
-$smarty->assign('vun',$vun);
-$smarty->assign('vpw',$vpw);
-$smarty->assign('debug',$debug);
-$smarty->display('login.tpl');
+       $smarty = new Smarty;
 
+       $smarty->assign('salt', $salt);
+       $smarty->assign('debug', @$_GET['debug']);
+       $smarty->display('login.tpl');
 }
-?>
\ No newline at end of file
+// vim: syntax=php ts=4 sw=4 sts=4 sr noet
+?>