Advertisement
Guest User

Untitled

a guest
Nov 24th, 2016
80
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 2.76 KB | None | 0 0
  1. final public function login()
  2. {
  3. global $template, $autoLoader, $_CONFIG, $core, $engine;
  4.  
  5. if(isset($_POST['login']))
  6. {
  7. $username = $this->postItems['username'];
  8. $password = $this->postItems['username'];
  9. $password = md5(sha1($password));
  10. $template->form->setData();
  11. unset($template->form->error);
  12.  
  13.  
  14.  
  15.  
  16. if($this->nameTaken($template->form->log_username))
  17. {
  18. if($this->isBanned($template->form->log_username) == false || $this->isBanned($_SERVER['REMOTE_ADDR']) == false)
  19. {
  20. if($this->userValidation($template->form->log_username, $core->hashed($template->form->log_password)))
  21. {
  22.  
  23. $this->turnOn($template->form->log_username);
  24. $this->updateUser($_SESSION['user']['id'], 'ip_last', $_SERVER['REMOTE_ADDR']);
  25. $template->form->unsetData();
  26. header('Location: ' . $_CONFIG['hotel']['url'] . '/me');
  27. exit;
  28. }
  29. else
  30. {
  31.  
  32. $template->form->error = '<div class="my-notify-error">
  33. </i> <b>Details do not match please try again to log into {hotelname}!</b></div>';
  34. $engine->query("INSERT INTO cms_login_logs (`username`,`password`,`when`,`ip_tried`,`worked`) VALUES ('" . $username . "','" . $this->postItems['login'] . "','" . date("l jS of F Y H:i:s") . "','" . $_SERVER['REMOTE_ADDR'] . "','1');");
  35.  
  36. return;
  37. }
  38. }
  39. else
  40. {
  41. $template->form->error = '<div class="my-notify-error"><b>Oops! Sorry, it appears this user is banned from {hotelname}.</b><br /></div>';
  42. return;
  43. }
  44. }
  45. else
  46. {
  47. $template->form->error = '<div class="my-notify-error"></i><b>Oops! {hotelname}'s system did not locate that username, try again!</b></div>';
  48. return;
  49. }
  50. }
  51. }
  52.  
  53. <div class="row forms row-centerd">
  54. <div class="col-md-4 col-centerd">
  55. <?php echo $template->form->error; ?>
  56. <form method="post" action="index" accept-charset="UTF-8">
  57. <label for="username">Username:</label>
  58. <input class="form-control" required="required" autofocus="autofocus" name="log_username" type="text" id="username">
  59. <label for="Pasword">Password:</label>
  60. <input class="form-control" required="required" name="log_password" type="password" id+"password">
  61. <input name="remember" type="checkbox" value="1">
  62. <label for="Onthouden" style="margin-top:20px;display:inline-block;">Remember me?</label>
  63. <input class="btn-lg btn-success login" style="margin-top:10px;" name="login" type="submit" value="Login" id="button">
  64. </form>
  65. </div>
  66. </div>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement