| 1 |
/* $Id$ */ |
/* $Id: ipauth.admin.js,v 1.4 2009/04/21 12:31:44 jonfrancisskydiver Exp $ */ |
| 2 |
|
|
| 3 |
|
$(function(){ |
| 4 |
|
|
|
$(function() { |
|
| 5 |
$("#cancel").click(function() { |
$("#cancel").click(function() { |
| 6 |
history.back(1); |
history.back(1); |
| 7 |
//window.location = "/admin/settings/ipAuthenticator"; |
//window.location = "/admin/settings/ipAuthenticator"; |
| 9 |
$("A.ip").click(function() { |
$("A.ip").click(function() { |
| 10 |
$("#edit-ip1").val($("A.ip").html()); |
$("#edit-ip1").val($("A.ip").html()); |
| 11 |
}); |
}); |
| 12 |
|
|
| 13 |
|
/** |
| 14 |
|
* This will perform an AJAX request to retreieve the users. |
| 15 |
|
*/ |
| 16 |
|
|
| 17 |
|
//ipauth_filter = new ip_auth_filter(); |
| 18 |
|
$('#user_filter').bind('keyup', function() { |
| 19 |
|
var value = $(this).val(); |
| 20 |
|
|
| 21 |
|
// if there is no value to the input field, then get all ip authenticators |
| 22 |
|
if (!value.length) |
| 23 |
|
ip_auth_filter.get_all_users(); |
| 24 |
|
|
| 25 |
|
// Filter authenticator list. |
| 26 |
|
if (value.length > 3) |
| 27 |
|
ip_auth_filter.get_authenticator_list(value); |
| 28 |
|
}); |
| 29 |
}); |
}); |
| 30 |
|
|
| 31 |
|
|
| 32 |
|
/** |
| 33 |
|
* This will create the filter plugin. |
| 34 |
|
*/ |
| 35 |
|
(function() { |
| 36 |
|
var |
| 37 |
|
window = this, |
| 38 |
|
ip_auth_filter = window.ip_auth_filter = function( var_init ) { |
| 39 |
|
return new ip_auth_filter.fn.init( var_init ); |
| 40 |
|
}; |
| 41 |
|
|
| 42 |
|
ip_auth_filter.fn = ip_auth_filter.prototype = { |
| 43 |
|
init: function( var_init ) { |
| 44 |
|
return this; |
| 45 |
|
}, |
| 46 |
|
|
| 47 |
|
get_all_users: function() { |
| 48 |
|
$.get('/admin/user/ip_authenticator/data/get_auths/all', null, function(data, textStatus) { |
| 49 |
|
$('.form-table').html(data); |
| 50 |
|
}); |
| 51 |
|
}, |
| 52 |
|
|
| 53 |
|
get_authenticator_list: function( user_filter_text ) { |
| 54 |
|
//alert("get: "+user_filter_text); |
| 55 |
|
$.get('/admin/user/ip_authenticator/data/get_auths/'+user_filter_text, null, function(data, textStatus) { |
| 56 |
|
$('.form-table').html(data); |
| 57 |
|
}); |
| 58 |
|
} |
| 59 |
|
}; |
| 60 |
|
})(); |
| 61 |
|
|
| 62 |
|
ip_auth_filter.fn.init.prototype = ip_auth_filter.fn; |
| 63 |
|
ip_auth_filter = ip_auth_filter(); |
| 64 |
|
|