← Back to team overview

dhis2-devs team mailing list archive

[Branch ~dhis2-devs-core/dhis2/trunk] Rev 19580: minor

 

------------------------------------------------------------
revno: 19580
committer: Morten Olav Hansen <mortenoh@xxxxxxxxx>
branch nick: dhis2
timestamp: Wed 2015-07-08 14:25:31 +0700
message:
  minor
modified:
  dhis-2/dhis-web/dhis-web-api/src/main/java/org/hisp/dhis/webapi/controller/AccountController.java
  dhis-2/dhis-web/dhis-web-commons-resources/src/main/webapp/dhis-web-commons/javascripts/useraccount/expired.js
  dhis-2/dhis-web/dhis-web-commons-resources/src/main/webapp/dhis-web-commons/javascripts/useraccount/recovery.js
  dhis-2/dhis-web/dhis-web-commons-resources/src/main/webapp/dhis-web-commons/javascripts/useraccount/restore.js


--
lp:dhis2
https://code.launchpad.net/~dhis2-devs-core/dhis2/trunk

Your team DHIS 2 developers is subscribed to branch lp:dhis2.
To unsubscribe from this branch go to https://code.launchpad.net/~dhis2-devs-core/dhis2/trunk/+edit-subscription
=== modified file 'dhis-2/dhis-web/dhis-web-api/src/main/java/org/hisp/dhis/webapi/controller/AccountController.java'
--- dhis-2/dhis-web/dhis-web-api/src/main/java/org/hisp/dhis/webapi/controller/AccountController.java	2015-06-17 14:11:12 +0000
+++ dhis-2/dhis-web/dhis-web-api/src/main/java/org/hisp/dhis/webapi/controller/AccountController.java	2015-07-08 07:25:31 +0000
@@ -465,7 +465,7 @@
             return;
         }
 
-        if( !passwordManager.legacyOrCurrentMatches( oldPassword, credentials.getPassword(), credentials.getUsername() ) )
+        if ( !passwordManager.legacyOrCurrentMatches( oldPassword, credentials.getPassword(), credentials.getUsername() ) )
         {
             result.put( "status", "NON_MATCHING_PASSWORD" );
             result.put( "message", "Old password is wrong, please correct and try again." );

=== modified file 'dhis-2/dhis-web/dhis-web-commons-resources/src/main/webapp/dhis-web-commons/javascripts/useraccount/expired.js'
--- dhis-2/dhis-web/dhis-web-commons-resources/src/main/webapp/dhis-web-commons/javascripts/useraccount/expired.js	2014-09-17 07:03:32 +0000
+++ dhis-2/dhis-web/dhis-web-commons-resources/src/main/webapp/dhis-web-commons/javascripts/useraccount/expired.js	2015-07-08 07:25:31 +0000
@@ -27,53 +27,52 @@
  */
 
 var validationRules = {
-	rules: {
-		oldPassword: {
-			required: true
-		},
-		password: {
-			required: true,
-			rangelength: [ 8, 80 ],
-			password: true,
-			notequalto : "#oldPassword"
-		},
-		retypePassword: {
-			required: true,
-			equalTo: "#password"
-		}
-	}
+  rules: {
+    oldPassword: {
+      required: true
+    },
+    password: {
+      required: true,
+      rangelength: [8, 80],
+      password: true,
+      notequalto: "#oldPassword"
+    },
+    retypePassword: {
+      required: true,
+      equalTo: "#password"
+    }
+  }
 };
 
-$( document ).ready( function() {
-	$( "#accountForm" ).validate( {
-		rules: validationRules.rules,
-		submitHandler: accountSubmitHandler,
-		errorPlacement: function( error, element ) {
-			element.parent( "td" ).append( "<br>" ).append( error );
-		}
-	} );
-} );
-
-function accountSubmitHandler()
-{
-	$( "#submitButton" ).attr( "disabled", "disabled" );
-
-	$.ajax( {
-		url: '../../api/account/password',
-		data: $( "#accountForm" ).serialize(),
-		type: 'POST',
-		success: function( data ) {
-			window.location.href = "../../dhis-web-commons-about/redirect.action";
-		},
-		error: function( jqXHR, textStatus, errorThrown ) {
-            var data = JSON.parse(jqXHR.responseText);
-
-            if( data.status === 'NON_EXPIRED' ) {
-                window.location.href = "login.action";
-            }
-
-            $( "#messageSpan" ).show().text( data.message );
-			$( "#submitButton" ).removeAttr( "disabled" );
-		}
-	} );
+$(document).ready(function() {
+  $("#accountForm").validate({
+    rules: validationRules.rules,
+    submitHandler: accountSubmitHandler,
+    errorPlacement: function(error, element) {
+      element.parent("td").append("<br>").append(error);
+    }
+  });
+});
+
+function accountSubmitHandler() {
+  $("#submitButton").attr("disabled", "disabled");
+
+  $.ajax({
+    url: '../../api/account/password',
+    data: $("#accountForm").serialize(),
+    type: 'POST',
+    success: function(data) {
+      window.location.href = "../../dhis-web-commons-about/redirect.action";
+    },
+    error: function(jqXHR, textStatus, errorThrown) {
+      var data = JSON.parse(jqXHR.responseText);
+
+      if( data.status === 'NON_EXPIRED' ) {
+        window.location.href = "login.action";
+      }
+
+      $("#messageSpan").show().text(data.message);
+      $("#submitButton").removeAttr("disabled");
+    }
+  });
 }

=== modified file 'dhis-2/dhis-web/dhis-web-commons-resources/src/main/webapp/dhis-web-commons/javascripts/useraccount/recovery.js'
--- dhis-2/dhis-web/dhis-web-commons-resources/src/main/webapp/dhis-web-commons/javascripts/useraccount/recovery.js	2013-10-10 15:49:20 +0000
+++ dhis-2/dhis-web/dhis-web-commons-resources/src/main/webapp/dhis-web-commons/javascripts/useraccount/recovery.js	2015-07-08 07:25:31 +0000
@@ -1,52 +1,46 @@
-
 var login = {};
 login.localeKey = "dhis2.locale.ui";
 
-$( document ).ready( function() {
-
-	var locale = localStorage[login.localeKey];
-    
-    if ( undefined !== locale && locale )
-    {
-    	login.changeLocale( locale );
+$(document).ready(function() {
+
+  var locale = localStorage[login.localeKey];
+
+  if( undefined !== locale && locale ) {
+    login.changeLocale(locale);
+  }
+
+});
+
+function recoverAccount() {
+  var username = $.trim($("#username").val());
+
+  if( username.length == 0 ) {
+    return false;
+  }
+
+  $.ajax({
+    url: "../../api/account/recovery",
+    data: {
+      username: username
+    },
+    type: "post",
+    success: function(data) {
+      $("#recoveryForm").hide();
+      $("#recoverySuccessMessage").fadeIn();
+    },
+    error: function(data) {
+      $("#recoveryForm").hide();
+      $("#recoveryErrorMessage").fadeIn();
     }
-    
-} );
-
-function recoverAccount()
-{
-	var username = $.trim( $( "#username" ).val() );
-	
-	if ( username.length == 0 )
-	{
-		return false;
-	}
-	
-	$.ajax( {
-		url: "../../api/account/recovery",
-		data: {
-			username: username
-		},
-		type: "post",
-		success: function( data ) {
-			$( "#recoveryForm" ).hide();
-			$( "#recoverySuccessMessage" ).fadeIn();
-		},
-		error: function( data ) {
-			$( "#recoveryForm" ).hide();
-			$( "#recoveryErrorMessage" ).fadeIn();
-		}
-	} );
+  });
 }
 
-
-login.changeLocale = function( locale )
-{		
-	$.get( 'recoveryStrings.action?loc=' + locale, function( json ) {				
-		$('#accountRecovery').html( json.account_recovery );
-		$('#labelUsername').html( json.user_name );
-		$('#recoveryButton').val( json.recover );
-		$('#recoverySuccessMessage').html( json.recover_success_message );
-		$('#recoveryErrorMessage').html( json.recover_error_message );
-	} );	
-}
\ No newline at end of file
+login.changeLocale = function(locale) {
+  $.get('recoveryStrings.action?loc=' + locale, function(json) {
+    $('#accountRecovery').html(json.account_recovery);
+    $('#labelUsername').html(json.user_name);
+    $('#recoveryButton').val(json.recover);
+    $('#recoverySuccessMessage').html(json.recover_success_message);
+    $('#recoveryErrorMessage').html(json.recover_error_message);
+  });
+};

=== modified file 'dhis-2/dhis-web/dhis-web-commons-resources/src/main/webapp/dhis-web-commons/javascripts/useraccount/restore.js'
--- dhis-2/dhis-web/dhis-web-commons-resources/src/main/webapp/dhis-web-commons/javascripts/useraccount/restore.js	2013-10-10 15:49:20 +0000
+++ dhis-2/dhis-web/dhis-web-commons-resources/src/main/webapp/dhis-web-commons/javascripts/useraccount/restore.js	2015-07-08 07:25:31 +0000
@@ -1,52 +1,50 @@
-
 var validationRules = {
-	rules: {
-		code: {
-			required: true
-		},
-		password: {
-			required: true,
-			rangelength: [ 8, 80 ],
-			password: true
-		},
-		retypePassword: {
-			required: true,
-			equalTo: "#password",
-		}
-	}
+  rules: {
+    code: {
+      required: true
+    },
+    password: {
+      required: true,
+      rangelength: [8, 80],
+      password: true
+    },
+    retypePassword: {
+      required: true,
+      equalTo: "#password"
+    }
+  }
 };
 
-$( document ).ready( function() {
-
-	$( "#restoreForm" ).validate( {
-		rules: validationRules.rules,
-		submitHandler: restoreSubmitHandler,
-		errorPlacement: function( error, element ) {
-			element.parent( "td" ).append( "<br>" ).append( error );
-		}
-	} );
-} );
-
-function restoreSubmitHandler()
-{
-	$( "#submitButton" ).attr( "disabled", "disabled" );
-
-	$.ajax( {
-		url: "../../api/account/restore",
-		data: {
-			username: $( "#username" ).val(),
-			token: $( "#token" ).val(),
-			code: $( "#code" ).val(),
-			password: $( "#password" ).val()
-		},
-		type: "post",
-		success: function( data ) {
-			$( "#restoreForm" ).hide();
-			$( "#restoreSuccessMessage" ).fadeIn();
-		},
-		error: function( jqXHR, textStatus, errorThrown ) {
-			$( "#submitButton" ).removeAttr( "disabled" );
-			$( "#restoreErrorMessage" ).fadeIn();
-		}
-	} );	
+$(document).ready(function() {
+
+  $("#restoreForm").validate({
+    rules: validationRules.rules,
+    submitHandler: restoreSubmitHandler,
+    errorPlacement: function(error, element) {
+      element.parent("td").append("<br>").append(error);
+    }
+  });
+});
+
+function restoreSubmitHandler() {
+  $("#submitButton").attr("disabled", "disabled");
+
+  $.ajax({
+    url: "../../api/account/restore",
+    data: {
+      username: $("#username").val(),
+      token: $("#token").val(),
+      code: $("#code").val(),
+      password: $("#password").val()
+    },
+    type: "post",
+    success: function(data) {
+      $("#restoreForm").hide();
+      $("#restoreSuccessMessage").fadeIn();
+    },
+    error: function(jqXHR, textStatus, errorThrown) {
+      $("#submitButton").removeAttr("disabled");
+      $("#restoreErrorMessage").fadeIn();
+    }
+  });
 }
\ No newline at end of file