Skip to content

Commit b735c82

Browse files
authored
Merge pull request #1727 from zfi/release_1.4.504
Updates to offline BP. Disables account and project creation.
2 parents 1311042 + 7a344ef commit b735c82

File tree

11 files changed

+154
-137
lines changed

11 files changed

+154
-137
lines changed

README.md

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -94,3 +94,13 @@ Example projects
9494
9. Musical Instrument control of something
9595
10. RF tilt video game controller ( mx2125 )
9696
11. Light sensor
97+
98+
99+
zefi@mac-2272 cs-server % catalina run
100+
Using CATALINA_BASE: /usr/local/Cellar/tomcat/9.0.38/libexec
101+
Using CATALINA_HOME: /usr/local/Cellar/tomcat/9.0.38/libexec
102+
Using CATALINA_TMPDIR: /usr/local/Cellar/tomcat/9.0.38/libexec/temp
103+
Using JRE_HOME: /usr/local/opt/openjdk
104+
Using CLASSPATH: /usr/local/Cellar/tomcat/9.0.38/libexec/bin/bootstrap.jar:/usr/local/Cellar/tomcat/9.0.38/libexec/bin/tomcat-juli.jar
105+
Using CATALINA_OPTS:
106+
NOTE: Picked up JDK_JAVA_OPTIONS: --add-opens=java.base/java.lang=ALL-UNNAMED --add-opens=java.base/java.io=ALL-UNNAMED --add-opens=java.rmi/sun.rmi.transport=ALL-UNNAMED

pom.xml

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,9 +18,12 @@
1818
<!-- jOOQ version 3.7 and above requires Java 1.8.x JDK -->
1919
<jooq-version>3.7.4</jooq-version>
2020
<gson.version>2.8.5</gson.version>
21-
<shiro-version>1.5.0</shiro-version>
21+
<shiro-version>1.6.0</shiro-version>
2222
<metrics-version>3.1.0</metrics-version>
2323
<jersey.version>1.19</jersey.version>
24+
<tomcat.url>http://localhost:8080/manager/text</tomcat.url>
25+
<tomcat.username>admin</tomcat.username>
26+
<tomcat.password>admin</tomcat.password>
2427
</properties>
2528

2629
<build>

src/main/java/com/parallax/server/blocklyprop/jsp/Properties.java

Lines changed: 19 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -49,13 +49,12 @@ public static Configuration getConfiguration() {
4949
* <p>
5050
* This method supports the "offline" mode which assumes that there is
5151
* no Internet connectivity available.
52-
*
53-
* @param file
5452
*
55-
* @return
53+
* @param file - Find a file
54+
* @return string
5655
*/
5756
public static String getDownloadFilesBaseUrl(String file) {
58-
if (configuration.getBoolean("offline.enabled") == true) {
57+
if (configuration.getBoolean("offline.enabled")) {
5958
return configuration.getString("offline.downloadfiles.baseurl") + (file.startsWith("/") ? "" : "/") + file;
6059
} else {
6160
return configuration.getString("downloadfiles.baseurl") + (file.startsWith("/") ? "" : "/") + file;
@@ -64,15 +63,15 @@ public static String getDownloadFilesBaseUrl(String file) {
6463

6564
public static boolean isOauthEnabled(String oauthProvider) {
6665
// Disable Oauth if we are running offline
67-
if (configuration.getBoolean("offline.enabled") == true) {
68-
return false;
66+
if (configuration.getBoolean("offline.enabled")) {
67+
return false;
6968
} else {
7069
return configuration.getBoolean("oauth." + oauthProvider + ".enabled", true);
7170
}
7271
}
73-
72+
7473
//
75-
74+
7675
/**
7776
* Obtain the state of experimental menu items.
7877
* <p>
@@ -81,25 +80,25 @@ public static boolean isOauthEnabled(String oauthProvider) {
8180
* contained in the application properties file will trigger the menu
8281
* system to expose experimental menu items. If this option is off or
8382
* missing, the experimental menu items will be disabled.
84-
*
85-
* @param state
86-
* @return
83+
*
84+
* @param state - True if experimental menu is enabled
85+
* @return boolean
8786
*/
8887
public static boolean isExperimentalMenu(Boolean state) {
8988
try {
90-
if (configuration.getBoolean("experimental.menu") == true) {
89+
if (state && configuration.getBoolean("experimental.menu")) {
9190
return true;
9291
}
9392
} catch (java.util.NoSuchElementException ex) {
9493
return false;
9594
}
96-
95+
9796
return false;
9897
}
9998

10099
public static boolean isCoppaRestricted() {
101100
LoggerFactory.getLogger(Properties.class).info("Checking for COPPA restrictions");
102-
101+
103102
// Get the current user context
104103
User user = BlocklyPropSecurityUtils.getUserInfo();
105104
LoggerFactory.getLogger(Properties.class).info("Completed call to getUserInfo()");
@@ -110,12 +109,12 @@ public static boolean isCoppaRestricted() {
110109
LoggerFactory.getLogger(Properties.class).info("Anonymous user. No COPPA restrictions");
111110
return false;
112111
}
113-
114-
// LoggerFactory.getLogger(Properties.class).info("User screen name is: {}.", user.getScreenname());
115-
// LoggerFactory.getLogger(Properties.class).info("User COPPA requirement: {}.", user.isCoppaEligible());
116-
// LoggerFactory.getLogger(Properties.class).info("User COPPA month: {}.", user.getBirthMonth());
117-
// LoggerFactory.getLogger(Properties.class).info("User COPPA year: {}.", user.getBirthYear());
118-
112+
113+
LoggerFactory.getLogger(Properties.class).info("User screen name is: {}.", user.getScreenname());
114+
LoggerFactory.getLogger(Properties.class).info("User COPPA requirement: {}.", user.isCoppaEligible());
115+
LoggerFactory.getLogger(Properties.class).info("User COPPA month: {}.", user.getBirthMonth());
116+
LoggerFactory.getLogger(Properties.class).info("User COPPA year: {}.", user.getBirthYear());
117+
119118
return user.isCoppaEligible();
120119
}
121120
}

0 commit comments

Comments
 (0)