Skip to content
This repository has been archived by the owner on Sep 26, 2024. It is now read-only.

Commit

Permalink
Merge pull request #276 from ZFGCCP/release/1.1.2
Browse files Browse the repository at this point in the history
Release/1.1.2
  • Loading branch information
MGZero authored Jun 1, 2019
2 parents 51364f9 + 518cdd0 commit 8439f7f
Show file tree
Hide file tree
Showing 34 changed files with 1,849 additions and 124 deletions.
36 changes: 22 additions & 14 deletions karma.conf.js
Original file line number Diff line number Diff line change
Expand Up @@ -75,8 +75,6 @@ module.exports = function(config) {

"./src/main/webapp/scripts/pm/conversation/add-user-modal.controller.js",

"./src/main/webapp/scripts/common/header/zfgc-header.directive.js",

"./src/main/webapp/scripts/directives/whos-online/whos-online.directive.js",

"./src/main/webapp/scripts/directives/user-name-icon/user-name-icon.directive.js",
Expand All @@ -85,10 +83,14 @@ module.exports = function(config) {

"./src/main/webapp/scripts/directives/paginator/paginator.directive.js",

"./src/main/webapp/scripts/directives/list-view/list-view.directive.js",

"./src/main/webapp/scripts/directives/collapsible-widget/collapsible-widget.directive.js",

"./src/main/webapp/scripts/directives/avatar-gallery/avatar-gallery.directive.js",

"./src/main/webapp/scripts/common/header/zfgc-header.directive.js",

"./src/main/webapp/scripts/users/users.service.js",

"./src/main/webapp/scripts/users/users.controller.js",
Expand All @@ -99,14 +101,14 @@ module.exports = function(config) {

"./src/main/webapp/scripts/users/activation.controller.js",

"./src/main/webapp/scripts/sockets/web-socket.service.js",

"./src/main/webapp/scripts/searches/userSearches.service.js",

"./src/main/webapp/scripts/searches/searches.controller.js",

"./src/main/webapp/scripts/potm/potm.module.js",

"./src/main/webapp/scripts/sockets/web-socket.service.js",

"./src/main/webapp/scripts/pm/pmSend.controller.js",

"./src/main/webapp/scripts/pm/pmComparator.service.js",
Expand All @@ -119,12 +121,12 @@ module.exports = function(config) {

"./src/main/webapp/scripts/notifications/notifications.controller.js",

"./src/main/webapp/scripts/lookups/lookups.service.js",

"./src/main/webapp/scripts/modal/modal.service.js",

"./src/main/webapp/scripts/modal/modal.controller.js",

"./src/main/webapp/scripts/lookups/lookups.service.js",

"./src/main/webapp/scripts/interceptor/interceptor.service.js",

"./src/main/webapp/scripts/forum/forum.service.js",
Expand All @@ -135,9 +137,13 @@ module.exports = function(config) {

"./src/main/webapp/scripts/forms/forms.controller.js",

"./src/main/webapp/scripts/filters/range.filter.js",

"./src/main/webapp/scripts/error/error.module.js",

"./src/main/webapp/scripts/filters/range.filter.js",
"./src/main/webapp/scripts/common/server-config.service.js",

"./src/main/webapp/scripts/ui-bootstrap-tpls.js",

"./src/main/webapp/scripts/app.js",

Expand All @@ -157,10 +163,14 @@ module.exports = function(config) {

"./src/main/webapp/scripts/users/users.html",

"./src/main/webapp/scripts/common/header/zfgc-header.html",

"./src/main/webapp/scripts/directives/avatar-gallery/avatar-gallery.html",

"./src/main/webapp/scripts/directives/collapsible-widget/collapsible-widget.html",

"./src/main/webapp/scripts/directives/list-view/list-view.directive.html",

"./src/main/webapp/scripts/directives/paginator/paginator.html",

"./src/main/webapp/scripts/directives/user-details/user-details.directive.html",
Expand All @@ -169,8 +179,6 @@ module.exports = function(config) {

"./src/main/webapp/scripts/directives/whos-online/whos-online.directive.html",

"./src/main/webapp/scripts/common/header/zfgc-header.html",

"./src/main/webapp/scripts/modal/templates/modalAddUserToConvo.html",

"./src/main/webapp/scripts/modal/templates/modalAvatarGallery.html",
Expand All @@ -187,20 +195,20 @@ module.exports = function(config) {

"./src/main/webapp/scripts/modal/templates/modalValidationError.html",

"./src/main/webapp/scripts/pm/conversation/conversation.html",

"./src/main/webapp/scripts/notifications/templates/alert-template.html",

"./src/main/webapp/scripts/popover/templates/popoverMemberGroups.html",

"./src/main/webapp/scripts/popover/templates/popoverUserDetails.html",
"./src/main/webapp/scripts/pm/conversation/conversation.html",

"./src/main/webapp/scripts/pm/convobox/convoBox.html",

"./src/main/webapp/scripts/pm/convobox/prune-convos.html",

"./src/main/webapp/scripts/pm/pmTwoFactor/pmTwoFactor.html",

"./src/main/webapp/scripts/popover/templates/popoverMemberGroups.html",

"./src/main/webapp/scripts/popover/templates/popoverUserDetails.html",

"./src/main/webapp/scripts/users/member-search/member-listing.html",

"./src/main/webapp/scripts/users/user-profile/account-settings.html",
Expand Down
2 changes: 1 addition & 1 deletion pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@

<groupId>com.zfgc</groupId>
<artifactId>forum</artifactId>
<version>1.1.1-LINK</version>
<version>1.1.2-LINK</version>
<packaging>war</packaging>

<name>forum</name>
Expand Down
12 changes: 12 additions & 0 deletions src/main/database/tables/SYSTEM_SETTINGS.sql
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
CREATE TABLE `SYSTEM_SETTINGS` (
`SYSTEM_SETTING_ID` INT(11) NOT NULL AUTO_INCREMENT,
`VALUE` VARCHAR(50) NOT NULL,
`CODE` VARCHAR(50) NOT NULL,
`CREATED_TS` TIMESTAMP NOT NULL DEFAULT CURRENT_TIMESTAMP,
`UPDATED_TS` TIMESTAMP NOT NULL DEFAULT '0000-00-00 00:00:00',
PRIMARY KEY (`SYSTEM_SETTING_ID`)
)
COLLATE='latin1_swedish_ci'
ENGINE=InnoDB
AUTO_INCREMENT=2
;
3 changes: 1 addition & 2 deletions src/main/java/com/zfgc/ForumApplication.java
Original file line number Diff line number Diff line change
Expand Up @@ -170,8 +170,6 @@ public void configure(ServiceProviderBuilder serviceProvider) throws Exception {
.metadataManager()
.refreshCheckInterval(0)
.metadataTrustCheck(false)

//.localMetadataLocation("classpath:/sp-metadata.xml")
.and()
.extendedMetadata()

Expand Down Expand Up @@ -211,6 +209,7 @@ public void configure(ServiceProviderBuilder serviceProvider) throws Exception {
"/lookups/**",
"/contentstream/**",
"/subscriptions/threads/**",
"/config/**",
"/users/profile/{{\\d+}}",
"/users/navigation",
"/users/loggedInUser",
Expand Down
9 changes: 9 additions & 0 deletions src/main/java/com/zfgc/config/ZfgcSamlConfig.java
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ public class ZfgcSamlConfig {
private String defaultSuccessUrl;
private String defaultFailureUrl;
private String idpSelectionPageUrl;
private String localMetaData;

public String getDefaultSuccessUrl() {
return defaultSuccessUrl;
Expand Down Expand Up @@ -91,4 +92,12 @@ public void setEntityId(String entityId) {
public String getEntityBaseUrl(){
return scheme + "://" + serverName + ":" + serverPort + contextPath;
}

public String getLocalMetaData() {
return localMetaData;
}

public void setLocalMetaData(String localMetaData) {
this.localMetaData = localMetaData;
}
}
4 changes: 4 additions & 0 deletions src/main/java/com/zfgc/controller/BaseController.java
Original file line number Diff line number Diff line change
Expand Up @@ -8,12 +8,16 @@
import org.springframework.messaging.simp.SimpMessagingTemplate;
import org.springframework.security.core.Authentication;

import com.zfgc.config.ZfgcSamlConfig;
import com.zfgc.model.users.Users;

public abstract class BaseController {
@Autowired
HttpServletRequest request;

@Autowired
ZfgcSamlConfig zfgcSamlConfig;

protected Users zfgcUser(){
Principal userPrincipal = request.getUserPrincipal();
return zfgcUser(userPrincipal);
Expand Down
24 changes: 24 additions & 0 deletions src/main/java/com/zfgc/controller/ConfigController.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
package com.zfgc.controller;

import org.springframework.http.ResponseEntity;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.ResponseBody;

import com.zfgc.model.config.ServerConfig;

@Controller
@RequestMapping(value="/config")
public class ConfigController extends BaseController {

@RequestMapping(value="", method=RequestMethod.GET, produces="application/json")
@ResponseBody
public ResponseEntity getServerSideConfig(){
ServerConfig config = new ServerConfig();
config.setIdpEntityId(zfgcSamlConfig.getEntityId());

return ResponseEntity.ok(config);
}

}
54 changes: 54 additions & 0 deletions src/main/java/com/zfgc/dao/SystemSettingsDao.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,54 @@
package com.zfgc.dao;

import java.util.List;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Component;

import com.zfgc.dbobj.SystemSettingsDbObj;
import com.zfgc.dbobj.SystemSettingsDbObjExample;
import com.zfgc.mappers.SystemSettingsDbObjMapper;
import com.zfgc.model.system.SystemSettings;

@Component
public class SystemSettingsDao extends AbstractDao<SystemSettingsDbObjExample, SystemSettingsDbObj, SystemSettings>{

@Autowired
private SystemSettingsDbObjMapper systemSettingsDbObjMapper;

@Override
public List<SystemSettingsDbObj> get(SystemSettingsDbObjExample ex) throws RuntimeException {
return systemSettingsDbObjMapper.selectByExample(ex);
}

@Override
public void hardDelete(SystemSettings obj) throws RuntimeException {
// TODO Auto-generated method stub

}

@Override
public void updateOrInsert(SystemSettings obj) throws RuntimeException {
// TODO Auto-generated method stub

}

@Override
public void updateByExample(SystemSettings obj, SystemSettingsDbObjExample ex) throws RuntimeException {
// TODO Auto-generated method stub

}

@Override
public Integer deleteByExample(SystemSettings obj, SystemSettingsDbObjExample ex) throws RuntimeException {
// TODO Auto-generated method stub
return null;
}

@Override
public Long countByExample(SystemSettings obj, SystemSettingsDbObjExample ex) throws RuntimeException {
// TODO Auto-generated method stub
return null;
}

}
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
package com.zfgc.dataprovider;

import java.util.List;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Component;

import com.zfgc.dao.SystemSettingsDao;
import com.zfgc.dbobj.SystemSettingsDbObj;
import com.zfgc.dbobj.SystemSettingsDbObjExample;
import com.zfgc.exception.ZfgcNotFoundException;
import com.zfgc.model.system.SystemSettings;

@Component
public class SystemSettingsDataProvider extends AbstractDataProvider {

@Autowired
private SystemSettingsDao systemSettingsDao;

public String getSystemValue(String settingName) {
SystemSettingsDbObjExample ex = systemSettingsDao.getExample();
ex.createCriteria().andCodeEqualTo(settingName);

List<SystemSettingsDbObj> dbObj = systemSettingsDao.get(ex);

if(dbObj.size() > 0) {
return mapper.map(dbObj.get(0), SystemSettings.class).getValue();
}
else {
throw new ZfgcNotFoundException("The system value " + settingName + " was not found.");
}
}

}
11 changes: 11 additions & 0 deletions src/main/java/com/zfgc/dataprovider/UserProfileDataProvider.java
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,10 @@
import com.zfgc.dao.UserPersonalInfoDao;
import com.zfgc.dao.UserProfileDao;
import com.zfgc.dao.UserSecuritySettingsDao;
import com.zfgc.dao.UsersDao;
import com.zfgc.dbobj.BrMemberGroupUserDbObjExample;
import com.zfgc.dbobj.UserProfileViewDbObj;
import com.zfgc.dbobj.UsersDbObjExample;
import com.zfgc.exception.ZfgcNotFoundException;
import com.zfgc.model.avatar.Avatar;
import com.zfgc.model.bridge.BrMemberGroupUser;
Expand Down Expand Up @@ -59,6 +61,9 @@ public class UserProfileDataProvider extends AbstractDataProvider {
@Autowired
BrMemberGroupUserDao brMemberGroupUserDao;

@Autowired
UsersDao usersDao;

public UserProfileView getUserProfile(Integer userId) throws Exception{
UserProfileViewDbObj userProfileViewDbObj = null;
try{
Expand Down Expand Up @@ -112,6 +117,12 @@ public void saveAccountSettings(Users accountSettings) throws RuntimeException {
brMemberGroupUserDao.updateOrInsert(memberGroupUser);
}

Users user = new Users();
user.setPrimaryMemberGroupId(accountSettings.getPrimaryMemberGroupId());
UsersDbObjExample example = usersDao.getExample();
ex.createCriteria().andUsersIdEqualTo(accountSettings.getUsersId());
usersDao.updateByExample(user, example);

}

private void updateEmailAddress(Integer usersId, String email) throws Exception {
Expand Down
Loading

0 comments on commit 8439f7f

Please sign in to comment.