Advertisement
Guest User

Untitled

a guest
Mar 4th, 2015
194
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.75 KB | None | 0 0
  1. $(document).ready(function(){
  2. $('#csignin').click(function(){
  3. $("#myModal-signin").modal('show');
  4. });
  5.  
  6. $('#csignup').click(function(){
  7. $("#myModal-signup").modal('show');
  8. });
  9.  
  10.  
  11. $('#loginForm').on("submit", function (e) {
  12.  
  13. e.preventDefault();
  14. //alert('submitting');
  15. $.ajax({
  16. type: "POST",
  17. url: 'usr/login_process.php',
  18. data: $('#loginForm').serialize(),
  19. dataType: 'text',
  20. timeout: 5000,
  21. success: function(data) {
  22. //success msg
  23. //alert(data);
  24.  
  25.  
  26. $(".signin-msg").html("<?php
  27. if (isset($_SESSION['f'])) {
  28.  
  29. switch ($_SESSION['f']) {
  30. default: break;
  31. case 0:
  32. echo LOGIN_NOT_ACTIVE_USER;
  33. break;
  34. case 1:
  35. echo LOGIN_USER_BLOCKED;
  36. break;
  37. case 2:
  38. echo LOGIN_PASSWORDS_NOT_MATCHED;
  39. break;
  40. case 3:
  41. echo LOGIN_NO_TRIES;
  42. break;
  43. case 4:
  44. echo LOGIN_USER_INFO_MISSING;
  45. break;
  46. case 5:
  47. echo LOGIN_NOT_ACTIVE_ADMIN;
  48. break;
  49. }
  50. }
  51.  
  52.  
  53. ?>").css("color", "red");
  54.  
  55.  
  56.  
  57. }
  58. });
  59.  
  60. });
  61.  
  62. });
  63.  
  64. if (isset($_POST['process'])) {
  65. // Try to login the user
  66. if ($qls->User->login_user()) {
  67. $qls->redirect($qls->config['login_redirect']);
  68. }
  69. else {
  70. $_SESSION['f']=$qls->User->login_error;
  71. $qls->redirect('../index.php?f=' . $qls->User->login_error);
  72.  
  73. }
  74. }
  75. else {
  76. $qls->redirect('../index.php');
  77. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement