diff options
author | Björn Schießle <schiessle@owncloud.com> | 2013-02-06 11:38:03 +0100 |
---|---|---|
committer | Björn Schießle <schiessle@owncloud.com> | 2013-02-06 11:38:03 +0100 |
commit | 9d73e7eb1e0dae044ef386211b214e01624a3364 (patch) | |
tree | 11d85b61a0260291f9430d3602591a11f873d8b2 /settings/js | |
parent | 335b6cd0609b269b3b8c85baed2eeed94f654c3d (diff) | |
download | nextcloud-server-9d73e7eb1e0dae044ef386211b214e01624a3364.tar.gz nextcloud-server-9d73e7eb1e0dae044ef386211b214e01624a3364.zip |
let the user change his display name, if supported by the back-end
Diffstat (limited to 'settings/js')
-rw-r--r-- | settings/js/personal.js | 27 |
1 files changed, 27 insertions, 0 deletions
diff --git a/settings/js/personal.js b/settings/js/personal.js index a866e321ad6..d9455b3786b 100644 --- a/settings/js/personal.js +++ b/settings/js/personal.js @@ -31,6 +31,33 @@ $(document).ready(function(){ } }); + + $("#displaynamebutton").click( function(){ + if ($('#displayName').val() != '' ) { + // Serialize the data + var post = $( "#displaynameform" ).serialize(); + $('#displaynamechanged').hide(); + $('#displaynemerror').hide(); + // Ajax foo + $.post( 'ajax/changedisplayname.php', post, function(data){ + if( data.status == "success" ){ + $('#displaynamechanged').show(); + } + else{ + $('#newdisplayname').val(data.data.displayName) + $('#displaynameerror').html( data.data.message ); + $('#displaynameerror').show(); + } + }); + return false; + } else { + $('#displayName').val($('#oldDisplayName').val()); + $('#displaynamechanged').hide(); + $('#displaynameerror').show(); + return false; + } + + }); $('#lostpassword #email').blur(function(event){ if ($(this).val() == this.defaultValue){ |