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