Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- /**
- * File: js/api/admin/auth.js
- */
- Admin.authenticated = function(xhr)
- {
- switch (xhr.response) {
- case 'SUC':
- break;
- default:
- break;
- };
- };
- Admin.authenticate = function(event)
- {
- // Stop form from submitting onclick.
- event.preventDefault();
- // Build the posted data object from forms children.
- var email = $('form[name=admin_auth]').find('input[name=email]').val();
- var passwd = $('form[name=admin_auth]').find('input[name=password]').val();
- // Create the ajax request and handle the response.
- $.ajax({
- url: '/admin/login.php',
- type: 'POST',
- dataType: 'JSON',
- data: {
- username: email,
- password: passwd
- },
- success: Admin.authenticated
- });
- };
Add Comment
Please, Sign In to add comment