summaryrefslogtreecommitdiffstats
path: root/dozentenmodul/src/main/java/org/openslx/dozmod/Config.java
diff options
context:
space:
mode:
authorSteffen Ritter2018-06-15 11:59:45 +0200
committerSteffen Ritter2018-06-15 11:59:45 +0200
commit34a919c138ef29fa3a4f515d466a984e85e1ad1d (patch)
treeac645a5eb042c47fe21eb196c42dc14240c3e2d7 /dozentenmodul/src/main/java/org/openslx/dozmod/Config.java
parentAdd support for LDAP lecture filters (diff)
downloadtutor-module-34a919c138ef29fa3a4f515d466a984e85e1ad1d.tar.gz
tutor-module-34a919c138ef29fa3a4f515d466a984e85e1ad1d.tar.xz
tutor-module-34a919c138ef29fa3a4f515d466a984e85e1ad1d.zip
[client] Add privacy notice window
Diffstat (limited to 'dozentenmodul/src/main/java/org/openslx/dozmod/Config.java')
-rwxr-xr-xdozentenmodul/src/main/java/org/openslx/dozmod/Config.java26
1 files changed, 26 insertions, 0 deletions
diff --git a/dozentenmodul/src/main/java/org/openslx/dozmod/Config.java b/dozentenmodul/src/main/java/org/openslx/dozmod/Config.java
index 7a3db999..efa59fe2 100755
--- a/dozentenmodul/src/main/java/org/openslx/dozmod/Config.java
+++ b/dozentenmodul/src/main/java/org/openslx/dozmod/Config.java
@@ -10,6 +10,7 @@ import java.util.Properties;
import org.apache.log4j.Logger;
import org.openslx.dozmod.gui.window.DisclaimerWindow;
+import org.openslx.dozmod.gui.window.PrivacyNoticeWindow;
import org.openslx.dozmod.util.OSHelper;
import org.openslx.util.QuickTimer;
import org.openslx.util.QuickTimer.Task;
@@ -212,6 +213,31 @@ public class Config {
}
/**
+ * Returns the value of 'privacy.accepted_version'
+ *
+ * @return version of the privacy notice the user accepted, 0 otherwise.
+ */
+ public static int getPrivacyAgreement() {
+ int savedVersion = getInteger("privacy.accepted_version", 0);
+ // check if we have a saved version and if it is larger than
+ // the current version. If it is, reset it to 0.
+ if (savedVersion != 0 && Math.abs(savedVersion - PrivacyNoticeWindow.PRIVACY_VERSION) != 0) {
+ setPrivacyAgreement(0);
+ return 0;
+ }
+ return savedVersion;
+ }
+
+ /**
+ * Sets the value of 'privacy.accepted_version' to the given value
+ *
+ * @return true if it succeeded, false otherwise
+ */
+ public static void setPrivacyAgreement(int value) {
+ setInteger("privacy.accepted_version", value);
+ }
+
+ /**
* Returns the value of 'notice.virtualizer'
*
* @return value of 'notice.virtualizer' if set, false otherwise