remove hardcoded references to localhost or any part of the platform api url from jsp and javascript libs.
This commit is contained in:
+2
-3
@@ -2,8 +2,7 @@ package org.mifosng.configuration;
|
||||
|
||||
public interface ApplicationConfigurationService {
|
||||
|
||||
OAuthProviderDetails retrieveOAuthProviderDetails();
|
||||
|
||||
void update(OAuthProviderDetails newDetails);
|
||||
void update(String platformApiUrl);
|
||||
|
||||
String retrievePlatformApiUrl();
|
||||
}
|
||||
|
||||
+10
-32
@@ -6,46 +6,24 @@ import org.springframework.stereotype.Service;
|
||||
* When application goes down or rebooted, configuration values return to defaults provided here.
|
||||
*/
|
||||
@Service
|
||||
public class InMemoryApplicationConfigurationService implements
|
||||
ApplicationConfigurationService {
|
||||
|
||||
private String oauthProviderUrl = "http://localhost:8080/mifosng-provider/";
|
||||
private String requestTokenURL = "oauth/request_token";
|
||||
private String userAuthorizationURL = "oauth/confirm_access";
|
||||
private String accessTokenURL = "oauth/access_token";
|
||||
|
||||
private String individualLendingResourceConsumerkey = "mifosng-ui-consumer-key";
|
||||
private String individualLendingConsumerSharedSecret = "testmifosng";
|
||||
public class InMemoryApplicationConfigurationService implements ApplicationConfigurationService {
|
||||
|
||||
private String platformApiUrl = "http://localhost:8080/mifosng-provider/api/v1/";
|
||||
|
||||
public InMemoryApplicationConfigurationService() {
|
||||
//
|
||||
}
|
||||
|
||||
@Override
|
||||
public OAuthProviderDetails retrieveOAuthProviderDetails() {
|
||||
|
||||
String requestTokenFullUrl = this.oauthProviderUrl
|
||||
.concat(this.requestTokenURL);
|
||||
String userAuthorizationFullURL = this.oauthProviderUrl
|
||||
.concat(this.userAuthorizationURL);
|
||||
String accessTokenFullURL = this.oauthProviderUrl
|
||||
.concat(this.accessTokenURL);
|
||||
|
||||
return new OAuthProviderDetails(this.oauthProviderUrl, requestTokenFullUrl,
|
||||
userAuthorizationFullURL, accessTokenFullURL,
|
||||
this.individualLendingResourceConsumerkey,
|
||||
this.individualLendingConsumerSharedSecret);
|
||||
public void update(final String platformApiUrl) {
|
||||
this.platformApiUrl = platformApiUrl;
|
||||
if (!this.platformApiUrl.endsWith("/")) {
|
||||
this.platformApiUrl = this.platformApiUrl.concat("/");
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void update(OAuthProviderDetails newDetails) {
|
||||
this.oauthProviderUrl = newDetails.getProviderBaseUrl();
|
||||
if (!this.oauthProviderUrl.endsWith("/")) {
|
||||
this.oauthProviderUrl = this.oauthProviderUrl.concat("/");
|
||||
}
|
||||
|
||||
this.individualLendingResourceConsumerkey = newDetails.getConsumerkey();
|
||||
this.individualLendingConsumerSharedSecret = newDetails.getSharedSecret();
|
||||
public String retrievePlatformApiUrl() {
|
||||
return this.platformApiUrl;
|
||||
}
|
||||
|
||||
}
|
||||
-56
@@ -1,56 +0,0 @@
|
||||
package org.mifosng.configuration;
|
||||
|
||||
public class OAuthProviderDetails {
|
||||
|
||||
private final String requestTokenUrl;
|
||||
private final String userAuthorizationUrl;
|
||||
private final String accessTokenUrl;
|
||||
private final String sharedSecret;
|
||||
private final String consumerkey;
|
||||
private final String providerBaseUrl;
|
||||
|
||||
public OAuthProviderDetails(String providerBaseUrl, String requestTokenUrl,
|
||||
String userAuthorizationUrl, String accessTokenUrl,
|
||||
String consumerkey, String sharedSecret) {
|
||||
this.providerBaseUrl = providerBaseUrl;
|
||||
this.requestTokenUrl = requestTokenUrl;
|
||||
this.userAuthorizationUrl = userAuthorizationUrl;
|
||||
this.accessTokenUrl = accessTokenUrl;
|
||||
this.consumerkey = consumerkey;
|
||||
this.sharedSecret = sharedSecret;
|
||||
}
|
||||
|
||||
public OAuthProviderDetails(String oauthProviderUrl, String consumerkey,
|
||||
String sharedSecret) {
|
||||
this.providerBaseUrl = oauthProviderUrl;
|
||||
this.consumerkey = consumerkey;
|
||||
this.sharedSecret = sharedSecret;
|
||||
this.accessTokenUrl = "";
|
||||
this.userAuthorizationUrl = "";
|
||||
this.requestTokenUrl = "";
|
||||
}
|
||||
|
||||
public String getRequestTokenUrl() {
|
||||
return requestTokenUrl;
|
||||
}
|
||||
|
||||
public String getUserAuthorizationUrl() {
|
||||
return userAuthorizationUrl;
|
||||
}
|
||||
|
||||
public String getAccessTokenUrl() {
|
||||
return accessTokenUrl;
|
||||
}
|
||||
|
||||
public String getSharedSecret() {
|
||||
return sharedSecret;
|
||||
}
|
||||
|
||||
public String getConsumerkey() {
|
||||
return consumerkey;
|
||||
}
|
||||
|
||||
public String getProviderBaseUrl() {
|
||||
return providerBaseUrl;
|
||||
}
|
||||
}
|
||||
-14
@@ -1,9 +1,6 @@
|
||||
package org.mifosng.ui;
|
||||
|
||||
import org.mifosng.configuration.ApplicationConfigurationService;
|
||||
import org.mifosng.configuration.OAuthProviderDetails;
|
||||
import org.mifosng.ui.infrastructure.BasicAuthUserDetails;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.security.access.AccessDeniedException;
|
||||
import org.springframework.security.core.Authentication;
|
||||
import org.springframework.stereotype.Controller;
|
||||
@@ -21,13 +18,6 @@ import org.springframework.web.servlet.ModelAndView;
|
||||
@Controller
|
||||
public class ApplicationPagesRoutesController {
|
||||
|
||||
private final ApplicationConfigurationService applicationConfigurationService;
|
||||
|
||||
@Autowired
|
||||
public ApplicationPagesRoutesController(ApplicationConfigurationService applicationConfigurationService) {
|
||||
this.applicationConfigurationService = applicationConfigurationService;
|
||||
}
|
||||
|
||||
@ExceptionHandler(AccessDeniedException.class)
|
||||
public String accessDeniedException() {
|
||||
return "unAuthorizedAction";
|
||||
@@ -106,14 +96,10 @@ public class ApplicationPagesRoutesController {
|
||||
@RequestMapping(value = "/reporting/flexireport", method = RequestMethod.GET)
|
||||
public String viewFlexibleReportingPage(final Model model, final Authentication authentication) {
|
||||
|
||||
OAuthProviderDetails oauthDetails = this.applicationConfigurationService.retrieveOAuthProviderDetails();
|
||||
|
||||
BasicAuthUserDetails userDetails = (BasicAuthUserDetails) authentication.getPrincipal();
|
||||
model.addAttribute("basicAuthKey", userDetails.getBasicAuthenticationKey());
|
||||
model.addAttribute("baseApiUrl", userDetails.getFullApiUrl());
|
||||
|
||||
model.addAttribute("baseUrl", oauthDetails.getProviderBaseUrl());
|
||||
|
||||
return "reports/flexireport";
|
||||
}
|
||||
}
|
||||
+3
-5
@@ -5,7 +5,6 @@ import java.util.ArrayList;
|
||||
import java.util.Collection;
|
||||
|
||||
import org.mifosng.configuration.ApplicationConfigurationService;
|
||||
import org.mifosng.configuration.OAuthProviderDetails;
|
||||
import org.mifosng.data.AuthenticatedUserData;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.http.HttpEntity;
|
||||
@@ -46,10 +45,9 @@ public class ApiDelegatingAuthenticationProvider extends AbstractUserDetailsAuth
|
||||
|
||||
String password = (String) authentication.getCredentials();
|
||||
|
||||
OAuthProviderDetails oauthDetails = this.applicationConfigurationService.retrieveOAuthProviderDetails();
|
||||
String apiVersion = "api/v1/";
|
||||
String platformApiUrl = this.applicationConfigurationService.retrievePlatformApiUrl();
|
||||
String authUrlExtension = "authentication?username=" + username + "&password=" + password;
|
||||
StringBuilder authenticationApiUrl = new StringBuilder(oauthDetails.getProviderBaseUrl()).append(apiVersion).append(authUrlExtension);
|
||||
StringBuilder authenticationApiUrl = new StringBuilder(platformApiUrl).append(authUrlExtension);
|
||||
|
||||
URI restUri = URI.create(authenticationApiUrl.toString());
|
||||
ResponseEntity<AuthenticatedUserData> s = this.restTemplate.postForEntity(restUri, authRequest(), AuthenticatedUserData.class);
|
||||
@@ -63,7 +61,7 @@ public class ApiDelegatingAuthenticationProvider extends AbstractUserDetailsAuth
|
||||
authorities.add(new SimpleGrantedAuthority(permission));
|
||||
}
|
||||
User user = new User(authenticatedUserData.getUsername(), "[not needed]", authorities);
|
||||
userDetails = new BasicAuthUserDetails(user, authenticatedUserData.getBase64EncodedAuthenticationKey(), oauthDetails.getProviderBaseUrl(), apiVersion);
|
||||
userDetails = new BasicAuthUserDetails(user, authenticatedUserData.getBase64EncodedAuthenticationKey(), platformApiUrl);
|
||||
}
|
||||
|
||||
return userDetails;
|
||||
|
||||
+4
-14
@@ -10,14 +10,12 @@ public class BasicAuthUserDetails implements UserDetails {
|
||||
|
||||
private final User user;
|
||||
private final String basicAuthenticationKey;
|
||||
private final String apiBaseUrl;
|
||||
private final String apiVersion;
|
||||
private final String fullApiUrl;
|
||||
|
||||
public BasicAuthUserDetails(User user, String basicAuthenticationKey, String apiBaseUrl, String apiVersion) {
|
||||
public BasicAuthUserDetails(User user, String basicAuthenticationKey, String fullApiUrl) {
|
||||
this.user = user;
|
||||
this.basicAuthenticationKey = basicAuthenticationKey;
|
||||
this.apiBaseUrl = apiBaseUrl;
|
||||
this.apiVersion = apiVersion;
|
||||
this.fullApiUrl = fullApiUrl;
|
||||
}
|
||||
|
||||
@Override
|
||||
@@ -59,15 +57,7 @@ public class BasicAuthUserDetails implements UserDetails {
|
||||
return basicAuthenticationKey;
|
||||
}
|
||||
|
||||
public String getApiBaseUrl() {
|
||||
return apiBaseUrl;
|
||||
}
|
||||
|
||||
public String getApiVersion() {
|
||||
return apiVersion;
|
||||
}
|
||||
|
||||
public String getFullApiUrl() {
|
||||
return this.apiBaseUrl + apiVersion;
|
||||
return this.fullApiUrl;
|
||||
}
|
||||
}
|
||||
+19
-17
@@ -3,8 +3,6 @@
|
||||
$.stretchyReporting = {};
|
||||
|
||||
$.stretchyReporting.initialise = function(params) {
|
||||
username="mifos";
|
||||
password="password";
|
||||
initialiseReporting(params)
|
||||
};
|
||||
|
||||
@@ -81,6 +79,9 @@ function initialiseReporting(params) {
|
||||
|
||||
if (params.RESTUrl) RESTUrl = params.RESTUrl
|
||||
else RESTUrl = "";
|
||||
|
||||
if (params.basicAuthKey) basicAuthKey = params.basicAuthKey
|
||||
else basicAuthKey = "";
|
||||
|
||||
if (params.pentahoUrl) pentahoUrl = params.pentahoUrl
|
||||
else pentahoUrl = "";
|
||||
@@ -984,21 +985,21 @@ return
|
||||
for (var i in inParams ) inQueryParameters["R_" + i] = inParams[i];
|
||||
if (rptDB > "") inQueryParameters["R_rptDB"] = rptDB;
|
||||
|
||||
OAuthSimple().reset();
|
||||
var OAuthProcess = (new OAuthSimple()).sign({
|
||||
path : RESTUrl,
|
||||
parameters : inQueryParameters,
|
||||
signatures : {
|
||||
'consumer_key' : apiKey,
|
||||
'shared_secret' : sharedSecret,
|
||||
'access_token' : accessToken,
|
||||
'access_secret' : tokenSecret
|
||||
}
|
||||
});
|
||||
// OAuthSimple().reset();
|
||||
// var OAuthProcess = (new OAuthSimple()).sign({
|
||||
// path : RESTUrl,
|
||||
// parameters : inQueryParameters,
|
||||
// signatures : {
|
||||
// 'consumer_key' : apiKey,
|
||||
// 'shared_secret' : sharedSecret,
|
||||
// 'access_token' : accessToken,
|
||||
// 'access_secret' : tokenSecret
|
||||
// }
|
||||
// });
|
||||
|
||||
showMsgE("getReportData IS Auth: " + inQueryParameters);
|
||||
$.ajax({
|
||||
url: OAuthProcess.signed_url,
|
||||
url: RESTUrl,
|
||||
type:'GET',
|
||||
dataType: 'json',
|
||||
contentType: "application/json; charset=utf-8",
|
||||
@@ -1006,6 +1007,8 @@ return
|
||||
cache: false,
|
||||
beforeSend: function( xhr ) {
|
||||
xhr.setRequestHeader("Accept", "application/json");
|
||||
console.log("base64: " + basicAuthKey);
|
||||
xhr.setRequestHeader("Authorization", "Basic " + basicAuthKey);
|
||||
},
|
||||
success: successFunction,
|
||||
error:function(jqXHR, textStatus, errorThrown){
|
||||
@@ -1058,9 +1061,8 @@ function getReportDataNoAuth(rptName, inParams, successFunction, isParameterType
|
||||
cache: false,
|
||||
beforeSend : function(xhr) {
|
||||
xhr.setRequestHeader("Accept", "application/json");
|
||||
var base64 = $.base64Encode(username + ":" + password);
|
||||
console.log("base64: " + base64);
|
||||
xhr.setRequestHeader("Authorization", "Basic " + base64);
|
||||
console.log("base64: " + basicAuthKey);
|
||||
xhr.setRequestHeader("Authorization", "Basic " + basicAuthKey);
|
||||
},
|
||||
success: successFunction,
|
||||
error:function(jqXHR, textStatus, errorThrown){
|
||||
+5
-4
@@ -22,6 +22,7 @@ $(document).ready(function() {
|
||||
|
||||
// basic auth details
|
||||
var base64 = "${basicAuthKey}";
|
||||
var baseApiUrl = "${baseApiUrl}";
|
||||
|
||||
// these helpers are registered for the jsViews and jsRender functionality to fix bug with display zero!
|
||||
$.views.registerHelpers({
|
||||
@@ -312,8 +313,8 @@ $(document).ready(function() {
|
||||
$("#settings").html(tableHtml);
|
||||
|
||||
$('#changepassword').click(function(e) {
|
||||
var getUrl = 'http://localhost:8080/mifosng-provider/api/v1/useraccounts/current/password/template';
|
||||
var putUrl = 'http://localhost:8080/mifosng-provider/api/v1/useraccounts/current/password';
|
||||
var getUrl = baseApiUrl + 'useraccounts/current/password/template';
|
||||
var putUrl = baseApiUrl + 'useraccounts/current/password';
|
||||
var templateSelector = "#changePasswordFormTemplate";
|
||||
var width = 600;
|
||||
var height = 350;
|
||||
@@ -329,7 +330,7 @@ $(document).ready(function() {
|
||||
});
|
||||
|
||||
$('#changedetails').click(function(e) {
|
||||
var getAndPutUrl = 'http://localhost:8080/mifosng-provider/api/v1/useraccounts/current';
|
||||
var getAndPutUrl = baseApiUrl + 'useraccounts/current';
|
||||
var templateSelector = "#userSettingsFormTemplate";
|
||||
var width = 600;
|
||||
var height = 350;
|
||||
@@ -361,7 +362,7 @@ $(document).ready(function() {
|
||||
<div id="content">
|
||||
<div id="tabs">
|
||||
<ul>
|
||||
<li><a href="http://localhost:8080/mifosng-provider/api/v1/useraccounts/current" title="settings"><spring:message code="tab.settings"/></a></li>
|
||||
<li><a href="${baseApiUrl}useraccounts/current" title="settings"><spring:message code="tab.settings"/></a></li>
|
||||
</ul>
|
||||
<div id="settings">
|
||||
</div>
|
||||
|
||||
@@ -17,7 +17,8 @@
|
||||
|
||||
// basic auth details
|
||||
var base64 = "${basicAuthKey}";
|
||||
|
||||
var baseApiUrl = "${baseApiUrl}";
|
||||
|
||||
// these helpers are registered for the jsViews and jsRender functionality to fix bug with display zero!
|
||||
$.views.registerHelpers({
|
||||
|
||||
@@ -298,8 +299,8 @@
|
||||
});
|
||||
|
||||
$('#addloanproduct').click(function(e) {
|
||||
var getUrl = 'http://localhost:8080/mifosng-provider/api/v1/loanproducts/template';
|
||||
var postUrl = 'http://localhost:8080/mifosng-provider/api/v1/loanproducts';
|
||||
var getUrl = baseApiUrl + 'loanproducts/template';
|
||||
var postUrl = baseApiUrl + 'loanproducts';
|
||||
var templateSelector = "#productFormTemplate";
|
||||
var width = 800;
|
||||
var height = 550;
|
||||
@@ -315,7 +316,7 @@
|
||||
|
||||
function refreshLoanProductsView() {
|
||||
var jqxhr = $.ajax({
|
||||
url: 'http://localhost:8080/mifosng-provider/api/v1/loanproducts', //'${allLoanProductsUrl}',
|
||||
url: baseApiUrl + 'loanproducts',
|
||||
type: 'GET',
|
||||
contentType: 'application/json',
|
||||
dataType: 'json',
|
||||
@@ -335,8 +336,8 @@
|
||||
$("a.editproduct").click( function(e) {
|
||||
var linkId = this.id;
|
||||
var productId = linkId.replace("editproduct", "");
|
||||
var getUrl = 'http://localhost:8080/mifosng-provider/api/v1/loanproducts/' + productId;
|
||||
var putUrl = 'http://localhost:8080/mifosng-provider/api/v1/loanproducts/' + productId;
|
||||
var getUrl = baseApiUrl + 'loanproducts/' + productId;
|
||||
var putUrl = baseApiUrl + 'loanproducts/' + productId;
|
||||
|
||||
var templateSelector = "#productFormTemplate";
|
||||
var width = 800;
|
||||
@@ -394,8 +395,8 @@
|
||||
});
|
||||
|
||||
$('#addoffice').click(function(e) {
|
||||
var getUrl = 'http://localhost:8080/mifosng-provider/api/v1/offices/template';
|
||||
var postUrl = 'http://localhost:8080/mifosng-provider/api/v1/offices';
|
||||
var getUrl = baseApiUrl + 'offices/template';
|
||||
var postUrl = baseApiUrl + 'offices';
|
||||
var templateSelector = "#officeFormTemplate";
|
||||
var width = 600;
|
||||
var height = 400;
|
||||
@@ -411,7 +412,7 @@
|
||||
|
||||
function refreshOfficesView() {
|
||||
var jqxhr = $.ajax({
|
||||
url: 'http://localhost:8080/mifosng-provider/api/v1/offices', // '${allOfficesUrl}',
|
||||
url: baseApiUrl + 'offices',
|
||||
type: 'GET',
|
||||
contentType: 'application/json',
|
||||
dataType: 'json',
|
||||
@@ -435,8 +436,8 @@
|
||||
$("a.edit").click( function(e) {
|
||||
var linkId = this.id;
|
||||
var entityId = linkId.replace("edit", "");
|
||||
var getUrl = 'http://localhost:8080/mifosng-provider/api/v1/offices/' + entityId;
|
||||
var putUrl = 'http://localhost:8080/mifosng-provider/api/v1/offices/' + entityId;
|
||||
var getUrl = baseApiUrl + 'offices/' + entityId;
|
||||
var putUrl = baseApiUrl + 'offices/' + entityId;
|
||||
|
||||
var templateSelector = "#officeFormTemplate";
|
||||
var width = 600;
|
||||
@@ -482,8 +483,8 @@
|
||||
|
||||
// currency configuration
|
||||
$('#editconfiguration').click(function(e) {
|
||||
var getUrl = 'http://localhost:8080/mifosng-provider/api/v1/configurations/currency';
|
||||
var putUrl = 'http://localhost:8080/mifosng-provider/api/v1/configurations/currency';
|
||||
var getUrl = baseApiUrl + 'configurations/currency';
|
||||
var putUrl = baseApiUrl + 'configurations/currency';
|
||||
var templateSelector = "#configurationFormTemplate";
|
||||
var width = 900;
|
||||
var height = 400;
|
||||
|
||||
@@ -19,6 +19,7 @@ $(document).ready(function() {
|
||||
|
||||
// basic auth details
|
||||
var base64 = "${basicAuthKey}";
|
||||
var baseApiUrl = "${baseApiUrl}";
|
||||
|
||||
//
|
||||
$.views.registerHelpers({
|
||||
@@ -346,14 +347,14 @@ $(document).ready(function() {
|
||||
}
|
||||
|
||||
$('#listusers').click(function(e) {
|
||||
var listUrl = "http://localhost:8080/mifosng-provider/api/v1/users";
|
||||
var listUrl = baseApiUrl + "users";
|
||||
refreshUsersView();
|
||||
e.preventDefault();
|
||||
});
|
||||
|
||||
$('#adduser').click(function(e) {
|
||||
var url = 'http://localhost:8080/mifosng-provider/api/v1/users/template';
|
||||
var postUrl = "http://localhost:8080/mifosng-provider/api/v1/users";
|
||||
var url = baseApiUrl + 'template';
|
||||
var postUrl = baseApiUrl + "users";
|
||||
var templateSelector = "#userFormTemplate";
|
||||
var width = 1000;
|
||||
var height = 550;
|
||||
@@ -368,14 +369,14 @@ $(document).ready(function() {
|
||||
});
|
||||
|
||||
$('#listroles').click(function(e) {
|
||||
var listUrl = "http://localhost:8080/mifosng-provider/api/v1/roles";
|
||||
var listUrl = baseApiUrl + "roles";
|
||||
refreshRolesView();
|
||||
e.preventDefault();
|
||||
});
|
||||
|
||||
$('#addrole').click(function(e) {
|
||||
var url = 'http://localhost:8080/mifosng-provider/api/v1/roles/template';
|
||||
var postUrl = "http://localhost:8080/mifosng-provider/api/v1/roles";
|
||||
var url = baseApiUrl +'template';
|
||||
var postUrl = baseApiUrl + "roles";
|
||||
var templateSelector = "#roleFormTemplate";
|
||||
var width = 1000;
|
||||
var height = 550;
|
||||
@@ -397,7 +398,7 @@ $(document).ready(function() {
|
||||
|
||||
function refreshUsersView() {
|
||||
|
||||
var listUrl = 'http://localhost:8080/mifosng-provider/api/v1/users';
|
||||
var listUrl = baseApiUrl + 'users';
|
||||
var templateSelector = "#usersListTemplate";
|
||||
var displayAreaDivSelector = "#contentplaceholder";
|
||||
|
||||
@@ -419,8 +420,8 @@ $(document).ready(function() {
|
||||
$("a.edit").click( function(e) {
|
||||
var linkId = this.id;
|
||||
var entityId = linkId.replace("edit", "");
|
||||
var getUrl = 'http://localhost:8080/mifosng-provider/api/v1/users/' + entityId;
|
||||
var putUrl = 'http://localhost:8080/mifosng-provider/api/v1/users/' + entityId;
|
||||
var getUrl = baseApiUrl + 'users/' + entityId;
|
||||
var putUrl = baseApiUrl + 'users/' + entityId;
|
||||
|
||||
var templateSelector = "#userFormTemplate";
|
||||
var width = 1000;
|
||||
@@ -438,7 +439,7 @@ $(document).ready(function() {
|
||||
$("a.delete").click( function(e) {
|
||||
var linkId = this.id;
|
||||
var entityId = linkId.replace("delete", "");
|
||||
var url = 'http://localhost:8080/mifosng-provider/api/v1/users/' + entityId;
|
||||
var url = baseApiUrl + 'users/' + entityId;
|
||||
showNotAvailableDialog('dialog.title.functionality.not.available');
|
||||
|
||||
e.preventDefault();
|
||||
@@ -464,7 +465,7 @@ $(document).ready(function() {
|
||||
}
|
||||
|
||||
function refreshRolesView() {
|
||||
var listUrl = 'http://localhost:8080/mifosng-provider/api/v1/roles';
|
||||
var listUrl = baseApiUrl + 'roles';
|
||||
var templateSelector = "#roleListTemplate";
|
||||
var displayAreaDivSelector = "#contentplaceholder";
|
||||
|
||||
@@ -486,8 +487,8 @@ $(document).ready(function() {
|
||||
$("a.edit").click( function(e) {
|
||||
var linkId = this.id;
|
||||
var entityId = linkId.replace("edit", "");
|
||||
var getUrl = 'http://localhost:8080/mifosng-provider/api/v1/roles/' + entityId;
|
||||
var putUrl = 'http://localhost:8080/mifosng-provider/api/v1/roles/' + entityId;
|
||||
var getUrl = baseApiUrl + 'roles/' + entityId;
|
||||
var putUrl = baseApiUrl + 'roles/' + entityId;
|
||||
|
||||
var templateSelector = "#roleFormTemplate";
|
||||
var width = 1000;
|
||||
@@ -505,7 +506,7 @@ $(document).ready(function() {
|
||||
$("a.delete").click( function(e) {
|
||||
var linkId = this.id;
|
||||
var entityId = linkId.replace("delete", "");
|
||||
var url = 'http://localhost:8080/mifosng-provider/api/v1/roles/' + entityId;
|
||||
var url = baseApiUrl + 'roles/' + entityId;
|
||||
showNotAvailableDialog('dialog.title.functionality.not.available');
|
||||
|
||||
e.preventDefault();
|
||||
@@ -531,7 +532,7 @@ $(document).ready(function() {
|
||||
}
|
||||
|
||||
function refreshPermissionsView() {
|
||||
var listUrl = 'http://localhost:8080/mifosng-provider/api/v1/permissions';
|
||||
var listUrl = baseApiUrl + 'permissions';
|
||||
var templateSelector = "#permissionListTemplate";
|
||||
var displayAreaDivSelector = "#contentplaceholder";
|
||||
|
||||
|
||||
+1
-1
@@ -840,7 +840,7 @@ $(document).ready(function() {
|
||||
|
||||
<div id="newtabs">
|
||||
<ul>
|
||||
<li><a href="http://localhost:8080/mifosng-provider/api/v1/clients/${clientId}" title="clienttab" class="topleveltab"><span id="clienttabname">Loading...</span></a></li>
|
||||
<li><a href="${baseApiUrl}clients/${clientId}" title="clienttab" class="topleveltab"><span id="clienttabname">Loading...</span></a></li>
|
||||
</ul>
|
||||
<div id="clienttab">
|
||||
</div>
|
||||
|
||||
+1
-1
@@ -15,6 +15,6 @@
|
||||
<script type="text/javascript" src="${resValue}/libs/DataTables-1.8.2/extras/TableTools/media/js/ZeroClipboard.js"></script>
|
||||
<script type="text/javascript" src="${resValue}/libs/DataTables-1.8.2/extras/TableTools/media/js/TableTools.min.js"></script>
|
||||
<script type="text/javascript" src="${resValue}/libs/jquery.i18n.properties-min-1.0.9.js"></script>
|
||||
<script type="text/javascript" src="${resValue}/stretchyreporting/stretchyreporting-0.985.js"></script>
|
||||
<script type="text/javascript" src="${resValue}/stretchyreporting/stretchyreporting-0.987.js"></script>
|
||||
|
||||
<script type="text/javascript" src="https://www.google.com/jsapi"></script>
|
||||
|
||||
@@ -343,7 +343,7 @@ $(document).ready(function() {
|
||||
</sec:authorize>
|
||||
<div id="tabs">
|
||||
<ul>
|
||||
<li><a href="http://localhost:8080/mifosng-provider/api/v1/clients" title="searchtab"><spring:message code="tab.search"/></a></li>
|
||||
<li><a href="${baseApiUrl}clients" title="searchtab"><spring:message code="tab.search"/></a></li>
|
||||
</ul>
|
||||
<div id="searchtab"></div>
|
||||
</div>
|
||||
|
||||
@@ -15,6 +15,7 @@ $(document).ready(function() {
|
||||
|
||||
// basic auth details
|
||||
var base64 = "${basicAuthKey}";
|
||||
var baseApiUrl = "${baseApiUrl}";
|
||||
|
||||
$.views.registerHelpers({
|
||||
|
||||
@@ -197,7 +198,7 @@ $(document).ready(function() {
|
||||
|
||||
function repopulateFullForm(clientId, productId) {
|
||||
|
||||
var url = 'http://localhost:8080/mifosng-provider/api/v1/loans/template?clientId=' + clientId + '&productId=' + productId;
|
||||
var url = baseApiUrl + 'loans/template?clientId=' + clientId + '&productId=' + productId;
|
||||
|
||||
var jqxhr = $.ajax({
|
||||
url: url,
|
||||
@@ -298,7 +299,7 @@ $(document).ready(function() {
|
||||
}
|
||||
|
||||
function calculateLoanSchedule() {
|
||||
var calculateLoanScheduleurl = 'http://localhost:8080/mifosng-provider/api/v1/loans?command=calculateLoanSchedule';
|
||||
var calculateLoanScheduleurl = baseApiUrl + 'loans?command=calculateLoanSchedule';
|
||||
|
||||
var newFormData = JSON.stringify($('#entityform').serializeObject());
|
||||
console.log(newFormData);
|
||||
@@ -328,7 +329,7 @@ $(document).ready(function() {
|
||||
}
|
||||
|
||||
function submitLoanApplication() {
|
||||
var submitLoanApplicationUrl = 'http://localhost:8080/mifosng-provider/api/v1/loans';
|
||||
var submitLoanApplicationUrl = baseApiUrl + 'loans';
|
||||
|
||||
var newFormData = JSON.stringify($('#entityform').serializeObject());
|
||||
console.log(newFormData);
|
||||
@@ -361,7 +362,7 @@ $(document).ready(function() {
|
||||
|
||||
// on page load
|
||||
var jqxhr = $.ajax({
|
||||
url: 'http://localhost:8080/mifosng-provider/api/v1/loans/template?clientId=${clientId}',
|
||||
url: baseApiUrl + 'loans/template?clientId=${clientId}',
|
||||
type: 'GET',
|
||||
contentType: 'application/json',
|
||||
dataType: 'json',
|
||||
|
||||
+4
-3
@@ -64,7 +64,7 @@
|
||||
<div id=myOutput></div>
|
||||
|
||||
|
||||
<script language="javascript" type="text/javascript">
|
||||
<script type="text/javascript">
|
||||
|
||||
function selectNewDecimals(selectedVal) {
|
||||
if (!(selectedVal == "")) jQuery.stretchyReporting.changeDecimals(selectedVal);
|
||||
@@ -91,8 +91,9 @@ function selectNewThousandsSep(selectedVal) {
|
||||
|
||||
var reportingParams = {
|
||||
//rptDB: "mifosngproviderJ",
|
||||
RESTUrl: "${baseUrl}api/v1/reports",
|
||||
pentahoUrl: "${baseUrl}pentahoreport",
|
||||
RESTUrl: "${baseApiUrl}reports",
|
||||
basicAuthKey: "${basicAuthKey}",
|
||||
pentahoUrl: "${baseApiUrl}pentahoreport",
|
||||
bundleDir: "${resValue}/stretchyreporting/mifosngbundle/",
|
||||
reportsListDiv: "myListOfReports",
|
||||
runReportDiv: "myRunReportButton",
|
||||
|
||||
@@ -370,7 +370,7 @@
|
||||
<span class="longrowlabel"><spring:message code="label.client.account.pending.approval.loans"/> ({{=$ctx.number(pendingApprovalLoanCount)}}):</span>
|
||||
<span class="rowvalue">
|
||||
{{#each pendingApprovalLoans}}
|
||||
<span class="loanaccount"><a href="http://localhost:8080/mifosng-provider/api/v1/loans/{{=id}}" id="loan{{=id}}" class="openloanaccount" title="{{=loanProductName}}: #{{=id}}">{{=loanProductName}}: #{{=id}}</a></span>
|
||||
<span class="loanaccount"><a href="${baseApiUrl}loans/{{=id}}" id="loan{{=id}}" class="openloanaccount" title="{{=loanProductName}}: #{{=id}}">{{=loanProductName}}: #{{=id}}</a></span>
|
||||
{{/each}}
|
||||
</span>
|
||||
</div>
|
||||
@@ -381,7 +381,7 @@
|
||||
<span class="longrowlabel"><spring:message code="label.client.account.pending.disbursal.loans"/> ({{=$ctx.number(awaitingDisbursalLoanCount)}}):</span>
|
||||
<span class="rowvalue">
|
||||
{{#each awaitingDisbursalLoans}}
|
||||
<span class="loanaccount"><a href="http://localhost:8080/mifosng-provider/api/v1/loans/{{=id}}" id="loan{{=id}}" class="openloanaccount" title="{{=loanProductName}}: #{{=id}}">{{=loanProductName}}: #{{=id}}</a></span>
|
||||
<span class="loanaccount"><a href="${baseApiUrl}loans/{{=id}}" id="loan{{=id}}" class="openloanaccount" title="{{=loanProductName}}: #{{=id}}">{{=loanProductName}}: #{{=id}}</a></span>
|
||||
{{/each}}
|
||||
</span>
|
||||
</div>
|
||||
@@ -392,7 +392,7 @@
|
||||
<span class="longrowlabel"><spring:message code="label.client.account.active.loans"/> ({{=$ctx.number(activeLoanCount)}}):</span>
|
||||
<span class="rowvalue">
|
||||
{{#each openLoans}}
|
||||
<span class="loanaccount"><a href="http://localhost:8080/mifosng-provider/api/v1/loans/{{=id}}" id="loan{{=id}}" class="openloanaccount" title="{{=loanProductName}}: #{{=id}}">{{=loanProductName}}: #{{=id}}</a></span>
|
||||
<span class="loanaccount"><a href="${baseApiUrl}loans/{{=id}}" id="loan{{=id}}" class="openloanaccount" title="{{=loanProductName}}: #{{=id}}">{{=loanProductName}}: #{{=id}}</a></span>
|
||||
{{/each}}
|
||||
</span>
|
||||
</div>
|
||||
@@ -403,7 +403,7 @@
|
||||
<div class="longrowlabel"><spring:message code="label.client.account.closed.loans"/> ({{=$ctx.number(closedLoanCount)}}):</div>
|
||||
<div class="rowvalue">
|
||||
{{#each closedLoans}}
|
||||
<span class="loanaccount"><a href="http://localhost:8080/mifosng-provider/api/v1/loans/{{=id}}" id="loan{{=id}}" class="openloanaccount" title="{{=loanProductName}}: #{{=id}}">{{=loanProductName}}: #{{=id}}</a></span>
|
||||
<span class="loanaccount"><a href="${baseApiUrl}loans/{{=id}}" id="loan{{=id}}" class="openloanaccount" title="{{=loanProductName}}: #{{=id}}">{{=loanProductName}}: #{{=id}}</a></span>
|
||||
{{/each}}
|
||||
</div>
|
||||
</div>
|
||||
|
||||
+1
-1
@@ -177,7 +177,7 @@ public class AppUserWritePlatformServiceJpaRepositoryImpl implements AppUserWrit
|
||||
AppUser userToUpdate = this.appUserRepository.findOne(currentUser.getId());
|
||||
|
||||
PlatformUser dummyPlatformUser = new BasicPasswordEncodablePlatformUser(
|
||||
((AppUser) userToUpdate).getId(),
|
||||
userToUpdate.getId(),
|
||||
userToUpdate.getUsername(), command.getPassword());
|
||||
|
||||
String newPasswordEncoded = this.platformPasswordEncoder.encode(dummyPlatformUser);
|
||||
|
||||
Reference in New Issue
Block a user