From 455f0f6e172deadb64183c078184de343574bd39 Mon Sep 17 00:00:00 2001 From: erickson Date: Fri, 28 May 2010 15:50:23 +0000 Subject: [PATCH] added duplicate username checking/warning git-svn-id: svn://svn.open-ils.org/ILS/trunk@16530 dcc99617-32d9-48b4-a31d-7c20da2025e4 --- Open-ILS/web/js/ui/default/actor/user/register.js | 30 ++++++++++++++++++++++ .../default/actor/user/register_table.tt2 | 9 ++++++- 2 files changed, 38 insertions(+), 1 deletion(-) diff --git a/Open-ILS/web/js/ui/default/actor/user/register.js b/Open-ILS/web/js/ui/default/actor/user/register.js index 0ce7decb6..5b4f1ff31 100644 --- a/Open-ILS/web/js/ui/default/actor/user/register.js +++ b/Open-ILS/web/js/ui/default/actor/user/register.js @@ -613,6 +613,36 @@ function attachWidgetEvents(fmcls, fmfield, widget) { if(fmcls == 'au') { switch(fmfield) { + case 'usrname': + dojo.connect(widget.widget, 'onChange', + function() { + var input = findWidget('au', 'usrname'); + var usrname = input.widget.attr('value'); + + if(!usrname) { + dojo.addClass(dojo.byId('uedit-dupe-username-warning'), 'hidden'); + return; + } + + fieldmapper.standardRequest( + ['open-ils.actor', 'open-ils.actor.username.exists'], + { + params: [openils.User.authtoken, usrname], + oncomplete : function(r) { + var res = openils.Util.readResponse(r); + if(res) { + dojo.removeClass(dojo.byId('uedit-dupe-username-warning'), 'hidden'); + } else { + dojo.addClass(dojo.byId('uedit-dupe-username-warning'), 'hidden'); + } + } + } + ); + } + ); + + return; + case 'profile': // when the profile changes, update the expire date dojo.connect(widget.widget, 'onChange', function() { diff --git a/Open-ILS/web/templates/default/actor/user/register_table.tt2 b/Open-ILS/web/templates/default/actor/user/register_table.tt2 index 0acfb1190..af67820f2 100644 --- a/Open-ILS/web/templates/default/actor/user/register_table.tt2 +++ b/Open-ILS/web/templates/default/actor/user/register_table.tt2 @@ -6,7 +6,14 @@ - + + + + + + Verify Password -- 2.11.0