Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 10 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -94,3 +94,13 @@ Example projects
9. Musical Instrument control of something
10. RF tilt video game controller ( mx2125 )
11. Light sensor


zefi@mac-2272 cs-server % catalina run
Using CATALINA_BASE: /usr/local/Cellar/tomcat/9.0.38/libexec
Using CATALINA_HOME: /usr/local/Cellar/tomcat/9.0.38/libexec
Using CATALINA_TMPDIR: /usr/local/Cellar/tomcat/9.0.38/libexec/temp
Using JRE_HOME: /usr/local/opt/openjdk
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
Using CATALINA_OPTS:
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
5 changes: 4 additions & 1 deletion pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -18,9 +18,12 @@
<!-- jOOQ version 3.7 and above requires Java 1.8.x JDK -->
<jooq-version>3.7.4</jooq-version>
<gson.version>2.8.5</gson.version>
<shiro-version>1.5.0</shiro-version>
<shiro-version>1.6.0</shiro-version>
<metrics-version>3.1.0</metrics-version>
<jersey.version>1.19</jersey.version>
<tomcat.url>http://localhost:8080/manager/text</tomcat.url>
<tomcat.username>admin</tomcat.username>
<tomcat.password>admin</tomcat.password>
</properties>

<build>
Expand Down
39 changes: 19 additions & 20 deletions src/main/java/com/parallax/server/blocklyprop/jsp/Properties.java
Original file line number Diff line number Diff line change
Expand Up @@ -49,13 +49,12 @@ public static Configuration getConfiguration() {
* <p>
* This method supports the "offline" mode which assumes that there is
* no Internet connectivity available.
*
* @param file
*
* @return
* @param file - Find a file
* @return string
*/
public static String getDownloadFilesBaseUrl(String file) {
if (configuration.getBoolean("offline.enabled") == true) {
if (configuration.getBoolean("offline.enabled")) {
return configuration.getString("offline.downloadfiles.baseurl") + (file.startsWith("/") ? "" : "/") + file;
} else {
return configuration.getString("downloadfiles.baseurl") + (file.startsWith("/") ? "" : "/") + file;
Expand All @@ -64,15 +63,15 @@ public static String getDownloadFilesBaseUrl(String file) {

public static boolean isOauthEnabled(String oauthProvider) {
// Disable Oauth if we are running offline
if (configuration.getBoolean("offline.enabled") == true) {
return false;
if (configuration.getBoolean("offline.enabled")) {
return false;
} else {
return configuration.getBoolean("oauth." + oauthProvider + ".enabled", true);
}
}

//

/**
* Obtain the state of experimental menu items.
* <p>
Expand All @@ -81,25 +80,25 @@ public static boolean isOauthEnabled(String oauthProvider) {
* contained in the application properties file will trigger the menu
* system to expose experimental menu items. If this option is off or
* missing, the experimental menu items will be disabled.
*
* @param state
* @return
*
* @param state - True if experimental menu is enabled
* @return boolean
*/
public static boolean isExperimentalMenu(Boolean state) {
try {
if (configuration.getBoolean("experimental.menu") == true) {
if (state && configuration.getBoolean("experimental.menu")) {
return true;
}
} catch (java.util.NoSuchElementException ex) {
return false;
}

return false;
}

public static boolean isCoppaRestricted() {
LoggerFactory.getLogger(Properties.class).info("Checking for COPPA restrictions");

// Get the current user context
User user = BlocklyPropSecurityUtils.getUserInfo();
LoggerFactory.getLogger(Properties.class).info("Completed call to getUserInfo()");
Expand All @@ -110,12 +109,12 @@ public static boolean isCoppaRestricted() {
LoggerFactory.getLogger(Properties.class).info("Anonymous user. No COPPA restrictions");
return false;
}
// LoggerFactory.getLogger(Properties.class).info("User screen name is: {}.", user.getScreenname());
// LoggerFactory.getLogger(Properties.class).info("User COPPA requirement: {}.", user.isCoppaEligible());
// LoggerFactory.getLogger(Properties.class).info("User COPPA month: {}.", user.getBirthMonth());
// LoggerFactory.getLogger(Properties.class).info("User COPPA year: {}.", user.getBirthYear());

LoggerFactory.getLogger(Properties.class).info("User screen name is: {}.", user.getScreenname());
LoggerFactory.getLogger(Properties.class).info("User COPPA requirement: {}.", user.isCoppaEligible());
LoggerFactory.getLogger(Properties.class).info("User COPPA month: {}.", user.getBirthMonth());
LoggerFactory.getLogger(Properties.class).info("User COPPA year: {}.", user.getBirthYear());

return user.isCoppaEligible();
}
}
Loading