Untitled
unknown
plain_text
a month ago
1.3 kB
1
Indexable
Never
private boolean isUserLoggedIn() { if ((sfUserBean == null) || (sfUserBean.getUser() == null)) { return false; } return sfUserBean.getUser().isLoggedIn(); } private JSONObject getAccountsForDomainWithoutDPP(SFUser sfUser)throws JSONException { JSONObject finalResponse = new JSONObject(); JSONObject response = new JSONObject(); JSONObject data = new JSONObject(); JSONObject responseInfo = new JSONObject(); if(isUserLoggedIn()){ if (isLargeUser(sfUser)){ data.put("isLargeUser", true); } else { data.put("isLargeUser", false); data.put("account", getAccountsDetails()); } } else{ responseInfo.put("error","User not logged in"); } response.put("data", data); finalResponse.put("finalResponse", response); return data; } private JSONArray getAccountsDetails(){ JSONArray accounts = new JSONArray(); accounts.put("accountId", sfUserBeanViewer.getPurchasableAccountsForDomainWithoutGivenType(SFClassNameConstant.PRIVATE_REGISTRATION_TYPE.getDescription()); // accounts.put("accountName",getAccountName()); return accounts; }