summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorBjörn Hagemeister2014-10-09 15:46:28 +0200
committerBjörn Hagemeister2014-10-09 15:46:28 +0200
commitde692b132919bbae023c9c6021b91477481cd222 (patch)
tree495b755e43a2c3e9324e350ba77549e2b746a0a9
parentImplemented publishUser(sessionId, UserInfo) in ApiServer. (diff)
downloadmasterserver-de692b132919bbae023c9c6021b91477481cd222.tar.gz
masterserver-de692b132919bbae023c9c6021b91477481cd222.tar.xz
masterserver-de692b132919bbae023c9c6021b91477481cd222.zip
Added update option in DbUser.java plus added deleted globals.properties.example file again.
-rw-r--r--config/global.properties.example78
-rw-r--r--src/main/java/org/openslx/imagemaster/db/DbUser.java2
2 files changed, 79 insertions, 1 deletions
diff --git a/config/global.properties.example b/config/global.properties.example
new file mode 100644
index 0000000..b8e79d5
--- /dev/null
+++ b/config/global.properties.example
@@ -0,0 +1,78 @@
+#fill in properties and rename to global.properties
+
+#####################
+# Main #
+#####################
+
+# the dir where the images are stored
+image_dir=/tmp
+
+#####################
+# LDAP #
+#####################
+
+# the port of the LDAP server
+ldap_port=636
+
+# the host address of the LDAP server
+ldap_host=bwservices-test.vm.uni-freiburg.de
+
+# SSL usage
+ldap_ssl=true
+
+# bind query (don't forget to escape \= and use a % for the username
+eplacement
+ldap_bind_query=uid\=%,ou\=users,dc\=bwlehrpool,dc\=uni-freiburg,dc\=de
+
+# search baseDn
+ldap_search_base_dn=ou\=users,dc\=bwlehrpool,dc\=uni-freiburg,dc\=de
+
+# search filter (use a % for the username replacement
+ldap_search_filter=(&(objectclass\=person)(|(uid=%)(cn=%)))
+
+# ldap keystore with public key
+ldap_keystore_path=./config/ldap.jks
+ldap_keystore_password=changeit
+
+#####################
+# Session #
+#####################
+
+# session timeout for users (in seconds)
+session_timeout_user=600
+
+# session timeout for servers (in seconds)
+session_timeout_server=600
+
+#####################
+# Ssl Socket #
+#####################
+
+# port that is used for data connection between satellite and master
+ssl_socket_port=56456
+
+# timeout for kicking idling clients (in minutes)
+ssl_socket_timeout=1
+
+# keystore (.jks format)
+ssl_keystore_file=./config/sslsocket.jks
+
+# keystore alias
+ssl_keystore_alias=alias
+
+# keystore password
+ssl_keystore_password=password
+
+# how often should the masterserver request a block
+# from the satellite if the check sum fails
+# until an error is sent
+ssl_socket_transmit_times=20
+
+#####################
+# CRC Scheduling #
+#####################
+
+# how often will the crc scheduler check the crc sums of uploading images in
+econds
+# minimum of 60 s recommended
+crc_scheduling_interval=60
diff --git a/src/main/java/org/openslx/imagemaster/db/DbUser.java b/src/main/java/org/openslx/imagemaster/db/DbUser.java
index 1806f1d..23ee6d5 100644
--- a/src/main/java/org/openslx/imagemaster/db/DbUser.java
+++ b/src/main/java/org/openslx/imagemaster/db/DbUser.java
@@ -85,7 +85,7 @@ public class DbUser extends User
public static boolean insertOrUpdate(UserInfo userInfo) {
log.debug( "Inserted user '" + userInfo.userId + "' into db." );
int ret = MySQL.update(
- "INSERT INTO user (organizationid, firstname, lastname, email) VALUES (?, ?, ?, ?)",
+ "INSERT INTO user (organizationid, firstname, lastname, email) VALUES (?, ?, ?, ?) ON DUPLICATE KEY UPDATE organizationid=VALUES(organizationid), firstname=VALUES(firstname), lastname=VALUES(lastname), email=VALUES(email)",
userInfo.organizationId, userInfo.firstName, userInfo.lastName, userInfo.eMail );
return (ret != 0);
}