Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- $(document).ready(function(){
- $('#csignin').click(function(){
- $("#myModal-signin").modal('show');
- });
- $('#csignup').click(function(){
- $("#myModal-signup").modal('show');
- });
- $('#loginForm').on("submit", function (e) {
- e.preventDefault();
- //alert('submitting');
- $.ajax({
- type: "POST",
- url: 'usr/login_process.php',
- data: $('#loginForm').serialize(),
- dataType: 'text',
- timeout: 5000,
- success: function(data) {
- //success msg
- //alert(data);
- $(".signin-msg").html("<?php
- if (isset($_SESSION['f'])) {
- switch ($_SESSION['f']) {
- default: break;
- case 0:
- echo LOGIN_NOT_ACTIVE_USER;
- break;
- case 1:
- echo LOGIN_USER_BLOCKED;
- break;
- case 2:
- echo LOGIN_PASSWORDS_NOT_MATCHED;
- break;
- case 3:
- echo LOGIN_NO_TRIES;
- break;
- case 4:
- echo LOGIN_USER_INFO_MISSING;
- break;
- case 5:
- echo LOGIN_NOT_ACTIVE_ADMIN;
- break;
- }
- }
- ?>").css("color", "red");
- }
- });
- });
- });
- if (isset($_POST['process'])) {
- // Try to login the user
- if ($qls->User->login_user()) {
- $qls->redirect($qls->config['login_redirect']);
- }
- else {
- $_SESSION['f']=$qls->User->login_error;
- $qls->redirect('../index.php?f=' . $qls->User->login_error);
- }
- }
- else {
- $qls->redirect('../index.php');
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement