SHARE
TWEET

seberm

seberm Apr 20th, 2009 15 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. <?php
  2.  
  3. include_once ("./class/url.class.php");
  4.         $url = new TUrl;
  5.  
  6. $url->script_name = "login.php";
  7. $failed_header = "Location: ". $url->create(array("action" => "failed"));
  8.  
  9. if ((!$_POST["login"] || !$_POST["password"]) && $_GET["action"] == "login")
  10.         header ($failed_header);
  11.        
  12. $action = $url->create(array("action" => "login"));
  13.  
  14. if ($_GET["action"] == "login") {
  15.         include_once ("./config.inc.php");
  16.         include_once ("./class/user.class.php");
  17.                 $db  = new TDatabase ($_Config["db"]["server"], $_Config["db"]["user"], $_Config["db"]["pass"], $_Config["db"]["database"], $_Config["db"]["prefix"]);
  18.                 $user = new TUser ($_POST["login"], $_POST["password"], $_POST["remember"], $db);
  19.        
  20.         $db->connect();
  21.  
  22.         if ($user->login()) {
  23.                 $url->script_name = "index.php";
  24.                 header ("Location: ". $url->create(array("page" => "logmain")));
  25.         }
  26.        
  27.         $db->close();
  28. }
  29. ?>
RAW Paste Data
Top