From: erickson Date: Fri, 28 May 2010 15:50:23 +0000 (+0000) Subject: added duplicate username checking/warning X-Git-Url: https://old-git.evergreen-ils.org/?a=commitdiff_plain;h=455f0f6e172deadb64183c078184de343574bd39;p=evergreen%2Fbjwebb.git added duplicate username checking/warning git-svn-id: svn://svn.open-ils.org/ILS/trunk@16530 dcc99617-32d9-48b4-a31d-7c20da2025e4 --- 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