summaryrefslogtreecommitdiffstats
path: root/settings/js
diff options
context:
space:
mode:
authorMichael Gapczynski <GapczynskiM@gmail.com>2011-08-27 17:40:41 -0400
committerMichael Gapczynski <GapczynskiM@gmail.com>2011-08-27 17:40:41 -0400
commit98ca6c4a169334a998e3a5131a7aae12df4544d2 (patch)
tree79e34d2407be4a3b1f2edb0f2bda5c48863b5efe /settings/js
parenteee7d8da50045e6b659466f8567a4672b37184f4 (diff)
downloadnextcloud-server-98ca6c4a169334a998e3a5131a7aae12df4544d2.tar.gz
nextcloud-server-98ca6c4a169334a998e3a5131a7aae12df4544d2.zip
Fix changing password in personal page (not complete)
Diffstat (limited to 'settings/js')
-rw-r--r--settings/js/personal.js40
1 files changed, 23 insertions, 17 deletions
diff --git a/settings/js/personal.js b/settings/js/personal.js
index e38eef62a8b..aad57224388 100644
--- a/settings/js/personal.js
+++ b/settings/js/personal.js
@@ -6,23 +6,29 @@
$(document).ready(function(){
$("#passwordbutton").click( function(){
- // Serialize the data
- var post = $( "#passwordform" ).serialize();
- $('#passwordchanged').hide();
- $('#passworderror').hide();
- // Ajax foo
- $.post( 'ajax/changepassword.php', post, function(data){
- if( data.status == "success" ){
- $('#pass1').val('');
- $('#pass2').val('');
- $('#passwordchanged').show();
- }
- else{
- $('#passworderror').html( data.data.message );
- $('#passworderror').show();
- }
- });
- return false;
+ if ($('#pass1').val() != '' && $('#pass2').val() != '') {
+ // Serialize the data
+ var post = $( "#passwordform" ).serialize();
+ $('#passwordchanged').hide();
+ $('#passworderror').hide();
+ // Ajax foo
+ $.post( 'ajax/changepassword.php', post, function(data){
+ if( data.status == "success" ){
+ $('#pass1').val('');
+ $('#pass2').val('');
+ $('#passwordchanged').show();
+ }
+ else{
+ $('#passworderror').html( data.data.message );
+ $('#passworderror').show();
+ }
+ });
+ return false;
+ } else {
+ $('passworderror').show();
+ return false;
+ }
+
});
$("#languageinput").change( function(){