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 #414 from ZFGCCP/release/2.1.0
Browse files Browse the repository at this point in the history
Release/2.1.0
  • Loading branch information
MGZero authored Dec 24, 2020
2 parents 8ba5f67 + e417b87 commit e2a3077
Show file tree
Hide file tree
Showing 144 changed files with 13,066 additions and 2,927 deletions.
35 changes: 15 additions & 20 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,25 +2,20 @@
It's a secret to everyone.

## Installation
Install Node 6.11.0
Install Python
Install Yarn 1.12.3 https://yarnpkg.com/en/docs/install#windows-stable

`npm install .`
`npm install -g bower gulp-cli`
`cd src/main/webapp`
`yarn install`

Install JDK 8 https://www.oracle.com/java/technologies/javase/javase-jdk8-downloads.html
Install Tomcat 9 https://tomcat.apache.org/download-90.cgi
Install Eclipse Java EE https://www.eclipse.org/downloads/packages/

## Development Tools

Gulp is used to compile sass and inject CSS/JS files into the index.html.
`gulp`

To run tests, use:
`gulp test`

## Navigating the app
Use the following URL to begin navigating:
`http://localhost:8080/forum/zfgcui/bbs/index - forum index`
Create a workspace folder separate from where this repo is cloned
Load this folder into Eclipse
Import the project as an "existing maven project"
Right click the project, Go to Run As, Run Configurations
Click Maven Build, then create new
Enter ${workspace_loc:/forum} into base directory
Enter clean install into Goals
Check skip Tests
On the JRE tab, set the alternate JRE to jdk 1.8
Click Apply, then Run to build the .war
Go to the servers tab and add a new Tomcat 9 server
Deploy the project to the server
Clean the server then start in debug mode
40 changes: 32 additions & 8 deletions karma.conf.js
Original file line number Diff line number Diff line change
Expand Up @@ -47,12 +47,14 @@ module.exports = function(config) {

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

"./src/main/webapp/scripts/forum/thread/move/move-thread.controller.js",

"./src/main/webapp/scripts/directives/forms/message-editor/message-editor.directive.js",

"./src/main/webapp/scripts/directives/forms/user-search/user-search.directive.js",

"./src/main/webapp/scripts/directives/forms/date-selector/date-selector.directive.js",

"./src/main/webapp/scripts/directives/forms/message-editor/message-editor.directive.js",

"./src/main/webapp/scripts/vendor/jstz/jstz.min.js",

"./src/main/webapp/scripts/users/whos-online/whos-online.service.js",
Expand Down Expand Up @@ -83,12 +85,16 @@ module.exports = function(config) {

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

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

"./src/main/webapp/scripts/directives/user-sidebar/user-sidebar.directive.js",
"./src/main/webapp/scripts/forum/thread/new-thread.controller.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",

"./src/main/webapp/scripts/directives/user-sidebar/user-sidebar.directive.js",

"./src/main/webapp/scripts/directives/user-details/user-details.directive.js",

"./src/main/webapp/scripts/directives/paginator/paginator.directive.js",
Expand All @@ -101,6 +107,12 @@ module.exports = function(config) {

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

"./src/main/webapp/scripts/directives/dropdown/drop-down-menu.directive.js",

"./src/main/webapp/scripts/directives/combobox-item/combobox-item.directive.js",

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

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

"./src/main/webapp/scripts/directives/avatar-gallery/avatar-gallery.directive.js",
Expand Down Expand Up @@ -147,6 +159,8 @@ module.exports = function(config) {

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

"./src/main/webapp/scripts/forum/message-editor.service.js",

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

"./src/main/webapp/scripts/forum/forum.controller.js",
Expand Down Expand Up @@ -201,6 +215,12 @@ module.exports = function(config) {

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

"./src/main/webapp/scripts/directives/combobox/combobox.directive.html",

"./src/main/webapp/scripts/directives/combobox-item/combobox-item.directive.html",

"./src/main/webapp/scripts/directives/dropdown/drop-down-menu.directive.html",

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

"./src/main/webapp/scripts/directives/left-panel/left-panel.directive.html",
Expand All @@ -211,12 +231,14 @@ module.exports = function(config) {

"./src/main/webapp/scripts/directives/user-details/user-details.directive.html",

"./src/main/webapp/scripts/directives/user-name-icon/user-name-icon.directive.html",

"./src/main/webapp/scripts/directives/user-sidebar/user-sidebar.directive.html",

"./src/main/webapp/scripts/directives/user-name-icon/user-name-icon.directive.html",

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

"./src/main/webapp/scripts/forum/thread/new-thread.html",

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

"./src/main/webapp/scripts/modal/templates/modalAvatarGallery.html",
Expand Down Expand Up @@ -275,12 +297,14 @@ module.exports = function(config) {

"./src/main/webapp/scripts/widget-templates/user-profile/summary.html",

"./src/main/webapp/scripts/directives/forms/message-editor/message-editor.directive.html",

"./src/main/webapp/scripts/directives/forms/date-selector/date-selector.directive.html",

"./src/main/webapp/scripts/directives/forms/user-search/user-search.directive.html",

"./src/main/webapp/scripts/directives/forms/message-editor/message-editor.directive.html",

"./src/main/webapp/scripts/forum/thread/move/move-thread.html",

"./src/main/webapp/scripts/users/user-profile/mobile/user-profile-mobile-nav.html"

],
Expand Down
28 changes: 10 additions & 18 deletions 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>2.0.0-Armos</version>
<version>2.1.0-Beamos</version>
<packaging>war</packaging>

<name>forum</name>
Expand All @@ -14,7 +14,7 @@
<parent>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-parent</artifactId>
<version>2.1.2.RELEASE</version>
<version>2.3.4.RELEASE</version>
<relativePath/> <!-- lookup parent from repository -->
</parent>

Expand Down Expand Up @@ -70,14 +70,18 @@
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-mail</artifactId>
</dependency>


<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-security</artifactId>
</dependency>
<!--<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-thymeleaf</artifactId>
</dependency>-->

<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-oauth2-resource-server</artifactId>
</dependency>

<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-web</artifactId>
Expand All @@ -89,18 +93,6 @@
</exclusions>
</dependency>

<dependency>
<groupId>org.springframework.security.extensions</groupId>
<artifactId>spring-security-saml2-core</artifactId>
<version>1.0.3.RELEASE</version>
</dependency>

<dependency>
<groupId>com.github.ulisesbocchio</groupId>
<artifactId>spring-boot-security-saml</artifactId>
<version>1.16</version>
</dependency>

<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-websocket</artifactId>
Expand Down
13 changes: 13 additions & 0 deletions src/main/database/bridges/BR_FORUM_PERMISSIONS.sql
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
CREATE TABLE `BR_MEMBER_GROUP_FORUM` (
`FORUM_ID` SMALLINT(5) UNSIGNED NOT NULL DEFAULT '0',
`PERMISSION_ID` INT(11) NOT NULL DEFAULT '0',
`READ_FLAG` BIT(1) NOT NULL DEFAULT b'0',
`WRITE_FLAG` BIT(1) NOT NULL DEFAULT b'0',
PRIMARY KEY (`FORUM_ID`, `PERMISSION_ID`),
INDEX `FK_BR_MEMBER_GROUP_FORUM_PERMISSION_ID` (`PERMISSION_ID`),
CONSTRAINT `FK_BR_MEMBER_GROUP_FORUM_PERMISSION_ID` FOREIGN KEY (`PERMISSION_ID`) REFERENCES `PERMISSIONS` (`PERMISSIONS_ID`),
CONSTRAINT `FK_BR_MEMBER_GROUP_FORUM_FORUM` FOREIGN KEY (`FORUM_ID`) REFERENCES `FORUM` (`FORUM_ID`)
)
COLLATE='latin1_swedish_ci'
ENGINE=InnoDB
;
8 changes: 7 additions & 1 deletion src/main/database/lookups/LKUP_ALL_VIEW.SQL
Original file line number Diff line number Diff line change
Expand Up @@ -80,4 +80,10 @@ select 'LKUP_PM_NOTIF' AS LKUP_TABLE,
'LKUP_PM_NOTIF' AS LKUP_NAME,
LKUP_PM_NOTIF.LKUP_PM_NOTIF_ID AS LKUP_ID,
LKUP_PM_NOTIF.DESC AS LKUP_DESC
FROM LKUP_PM_NOTIF AS LKUP_PM_NOTIF
FROM LKUP_PM_NOTIF AS LKUP_PM_NOTIF
union
SELECT 'LKUP_CATEGORY_VIEW' AS LKUP_TABLE,
'LKUP_CATEGORY' AS LKUP_NAME,
LKUP_CATEGORY_VIEW.CATEGORY_ID AS LKUP_ID,
LKUP_CATEGORY_VIEW.NAME AS LKUP_DESC
FROM LKUP_CATEGORY_VIEW
22 changes: 22 additions & 0 deletions src/main/database/tables/POST_CONTENT.sql
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
CREATE TABLE `THREAD` (
`THREAD_ID` INT(11) NOT NULL,
`NAME` VARCHAR(128) NOT NULL,
`THREAD_STARTER_ID` INT(11) NOT NULL,
`VIEWS` INT(10) UNSIGNED NOT NULL DEFAULT '0',
`LATEST_POST_ID` INT(11) NOT NULL DEFAULT '0',
`POST_ICON_ID` INT(11) NULL DEFAULT NULL,
`NEW_POSTS_FLAG` BIT(1) NOT NULL DEFAULT b'0',
`POST_STATUS_ID` INT(11) NOT NULL DEFAULT '0',
`LOCKED_FLAG` BIT(1) NOT NULL DEFAULT b'0',
`STICKY_FLAG` BIT(1) NOT NULL DEFAULT b'0',
`POLL_FLAG` BIT(1) NOT NULL DEFAULT b'0',
`PARENT_FORUM_ID` SMALLINT(5) UNSIGNED NOT NULL,
PRIMARY KEY (`THREAD_ID`),
INDEX `FK_THREAD_USERS_THREAD_STARTER_ID` (`THREAD_STARTER_ID`),
INDEX `FK_THREAD_FORUM_PARENT_FORUM_ID` (`PARENT_FORUM_ID`),
CONSTRAINT `FK_THREAD_FORUM_PARENT_FORUM_ID` FOREIGN KEY (`PARENT_FORUM_ID`) REFERENCES `FORUM` (`FORUM_ID`) ON UPDATE CASCADE ON DELETE CASCADE,
CONSTRAINT `FK_THREAD_USERS_THREAD_STARTER_ID` FOREIGN KEY (`THREAD_STARTER_ID`) REFERENCES `users` (`USERS_ID`) ON UPDATE CASCADE ON DELETE CASCADE
)
COLLATE='latin1_swedish_ci'
ENGINE=InnoDB
;
18 changes: 10 additions & 8 deletions src/main/database/tables/THREAD.SQL
Original file line number Diff line number Diff line change
Expand Up @@ -2,18 +2,20 @@ CREATE TABLE `THREAD` (
`THREAD_ID` INT(11) NOT NULL,
`NAME` VARCHAR(128) NOT NULL,
`THREAD_STARTER_ID` INT(11) NOT NULL,
`VIEWS` INT(10) UNSIGNED NOT NULL,
`LATEST_POST_ID` INT(11) NOT NULL,
`POST_ICON_ID` INT(11) NOT NULL,
`NEW_POSTS_FLAG` BIT(1) NOT NULL,
`POST_STATUS_ID` INT(11) NOT NULL,
`LOCKED_FLAG` BIT(1) NOT NULL,
`STICKY_FLAG` BIT(1) NOT NULL,
`POLL_FLAG` BIT(1) NOT NULL,
`VIEWS` INT(10) UNSIGNED NOT NULL DEFAULT '0',
`LATEST_POST_ID` INT(11) NULL DEFAULT NULL,
`POST_ICON_ID` INT(11) NULL DEFAULT NULL,
`NEW_POSTS_FLAG` BIT(1) NOT NULL DEFAULT b'0',
`POST_STATUS_ID` INT(11) NOT NULL DEFAULT '0',
`LOCKED_FLAG` BIT(1) NOT NULL DEFAULT b'0',
`STICKY_FLAG` BIT(1) NOT NULL DEFAULT b'0',
`POLL_FLAG` BIT(1) NOT NULL DEFAULT b'0',
`PARENT_FORUM_ID` SMALLINT(5) UNSIGNED NOT NULL,
PRIMARY KEY (`THREAD_ID`),
INDEX `FK_THREAD_USERS_THREAD_STARTER_ID` (`THREAD_STARTER_ID`),
INDEX `FK_THREAD_FORUM_PARENT_FORUM_ID` (`PARENT_FORUM_ID`),
INDEX `FK_THREAD_THREAD_POST_LATEST_POST_ID` (`LATEST_POST_ID`),
CONSTRAINT `FK_THREAD_THREAD_POST_LATEST_POST_ID` FOREIGN KEY (`LATEST_POST_ID`) REFERENCES `THREAD_POST` (`THREAD_POST_ID`),
CONSTRAINT `FK_THREAD_FORUM_PARENT_FORUM_ID` FOREIGN KEY (`PARENT_FORUM_ID`) REFERENCES `FORUM` (`FORUM_ID`) ON UPDATE CASCADE ON DELETE CASCADE,
CONSTRAINT `FK_THREAD_USERS_THREAD_STARTER_ID` FOREIGN KEY (`THREAD_STARTER_ID`) REFERENCES `users` (`USERS_ID`) ON UPDATE CASCADE ON DELETE CASCADE
)
Expand Down
15 changes: 15 additions & 0 deletions src/main/database/tables/THREAD_POST.sql
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
CREATE TABLE `THREAD_POST` (
`THREAD_POST_ID` INT(11) NOT NULL AUTO_INCREMENT,
`THREAD_ID` INT(11) NOT NULL,
`AUTHOR_ID` INT(11) NOT NULL,
`CREATED_TS` TIMESTAMP NOT NULL DEFAULT CURRENT_TIMESTAMP,
PRIMARY KEY (`THREAD_POST_ID`),
INDEX `THREAD_POST_THREAD_THREAD_ID` (`THREAD_ID`),
INDEX `THREAD_POST_USERS_AUTHOR_ID` (`AUTHOR_ID`),
CONSTRAINT `THREAD_POST_THREAD_THREAD_ID` FOREIGN KEY (`THREAD_ID`) REFERENCES `THREAD` (`THREAD_ID`),
CONSTRAINT `THREAD_POST_USERS_AUTHOR_ID` FOREIGN KEY (`AUTHOR_ID`) REFERENCES `users` (`USERS_ID`)
)
COLLATE='latin1_swedish_ci'
ENGINE=InnoDB
AUTO_INCREMENT=5
;
2 changes: 1 addition & 1 deletion src/main/database/views/FORUM_PERMISSION_VIEW.sql
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
SELECT F.FORUM_ID,
MGF.MEMBER_GROUP_ID,
MGF.PERMISSION_ID,
MGF.READ_FLAG,
MGF.WRITE_FLAG,
F.NAME,
Expand Down
4 changes: 2 additions & 2 deletions src/main/database/views/MEMBER_LISTING_VIEW.sql
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
CREATE OR REPLACE VIEW MEMBER_LISTING_VIEW AS
SELECT U.USERS_ID, U.DISPLAY_NAME, E.EMAIL_ADDRESS, U.LAST_LOGIN, U.DATE_REGISTERED, LKGS.GROUP_NAME, T.LKUP_TIMEZONES_ID, T.TIME_ZONE
SELECT U.USERS_ID, U.DISPLAY_NAME, E.EMAIL_ADDRESS, U.LAST_LOGIN, U.DATE_REGISTERED, LKGS.GROUP_NAME, T.LKUP_TIMEZONES_ID, T.TIME_ZONE, U.ACTIVE_FLAG, IP.IP_ADDRESS
FROM users U
JOIN LKUP_MEMBER_GROUP LKGP ON LKGP.MEMBER_GROUP_ID = U.PRIMARY_MEMBER_GROUP_ID
JOIN LKUP_MEMBER_GROUP LKGS ON LKGS.MEMBER_GROUP_ID = LKGP.MEMBER_GROUP_ID
JOIN LKUP_TIMEZONES T ON T.LKUP_TIMEZONES_ID = U.TIME_OFFSET
LEFT JOIN USER_CONTACT_SETTINGS C ON C.USERS_ID = U.USERS_ID
LEFT JOIN EMAIL_ADDRESS E ON E.EMAIL_ADDRESS_ID = C.EMAIL_ADDRESS_ID
WHERE U.ACTIVE_FLAG = 1
LEFT JOIN IP_ADDRESS IP ON U.PRIMARY_IP = IP.IP_ADDRESS_ID
ORDER BY U.DISPLAY_NAME ASC
21 changes: 21 additions & 0 deletions src/main/database/views/TOPIC_VIEW.sql
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
SELECT T.THREAD_ID,
T.NAME,
T.THREAD_STARTER_ID,
T.VIEWS,
T.LATEST_POST_ID,
T.POST_ICON_ID,
T.NEW_POSTS_FLAG,
T.POST_STATUS_ID,
T.LOCKED_FLAG,
T.STICKY_FLAG,
T.POLL_FLAG,
T.PARENT_FORUM_ID,
TP.AUTHOR_ID AS LATEST_POST_AUTHOR_ID,
US.DISPLAY_NAME AS AUTHOR_NAME,
UR.DISPLAY_NAME AS LATEST_AUTHOR_NAME,
PC.POST_DATA AS LATEST_POST_DATA
FROM THREAD T
JOIN users US ON T.THREAD_STARTER_ID = US.USERS_ID
JOIN THREAD_POST TP ON TP.THREAD_POST_ID = T.LATEST_POST_ID
JOIN POST_CONTENT PC ON PC.THREAD_POST_ID = TP.THREAD_POST_ID AND PC.CURRENT_FLAG = 1
JOIN users UR ON UR.USERS_ID = TP.AUTHOR_ID
28 changes: 28 additions & 0 deletions src/main/java/com/zfgc/AuthFailureHandler.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
package com.zfgc;

import java.io.IOException;

import javax.servlet.ServletException;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;

import org.apache.logging.log4j.LogManager;
import org.apache.logging.log4j.Logger;
import org.springframework.security.core.AuthenticationException;
import org.springframework.security.web.authentication.AuthenticationFailureHandler;
import org.springframework.stereotype.Component;

@Component
public class AuthFailureHandler implements AuthenticationFailureHandler {

private Logger LOGGER = LogManager.getLogger(AuthFailureHandler.class);

@Override
public void onAuthenticationFailure(HttpServletRequest request, HttpServletResponse response,
AuthenticationException exception) throws IOException, ServletException {

LOGGER.debug(exception.getMessage());

}

}
Loading

0 comments on commit e2a3077

Please sign in to comment.