Advertisement
Guest User

Untitled

a guest
Jul 20th, 2017
77
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.46 KB | None | 0 0
  1. <?php
  2. require_once('../core/ClassMain.php');
  3. require_once('class.secure-jh.php');
  4. require_once('../config.php');
  5. $Main = new Main();
  6. $Main->connect($driver,$host,$user,$password,$db,$charset);
  7. //smarty
  8. require ('../smarty/libs/Smarty.class.php');
  9. $smarty = new Smarty;
  10. $smarty->compile_check = true;
  11. //smarty Debug
  12. //$smarty->debugging = true;
  13.  
  14.  
  15. if (isset($_POST['submitBtn'])){
  16. // Get user input
  17. $username = isset($_POST['username']) ? $_POST['username'] : '';
  18. $password = isset($_POST['password']) ? $_POST['password'] : '';
  19.  
  20. // Try to login the user
  21. $jh = new loginjh();
  22. $error = $jh->loginUser($username,$password);
  23. }
  24.  
  25. if (isset($_POST['submitBtn'])){
  26. //proceed to display options
  27. if ($error != '') {
  28. $smarty->assign('Content', '
  29. <h2>Login Status</h2>
  30. <h3>'.$error.'</h3>
  31. ');
  32. }
  33. else {
  34. $smarty->assign('Content', '
  35. <h2>Login Status</h2>
  36. <h3>Welcome '.$username.'! <br/>You are now logged in!<br/><br/>
  37. <meta http-equiv="refresh" content="3;url=index.php?pg=home">Please wait to be redirected<br>
  38. <a href="index.php?pg=home">Click Here if you Don`t want to wait <br>or your browser doesn`t redirect you automaticly.</a></h3>
  39. ');
  40. }
  41. }
  42. if(!isset($error)){
  43. $error = 'login';
  44. }
  45.  
  46. $smarty->assign('PageTitle', 'Login');
  47. $smarty->assign('error', $error);
  48. $smarty->display('login.tpl');
  49. ?>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement