Benutzerverwaltung: Search mit authorisiertem User : OK.
diff --git a/KustvaktBaseServer.launch b/KustvaktBaseServer.launch
new file mode 100644
index 0000000..c6defd1
--- /dev/null
+++ b/KustvaktBaseServer.launch
@@ -0,0 +1,14 @@
+<?xml version="1.0" encoding="UTF-8" standalone="no"?>
+<launchConfiguration type="org.eclipse.jdt.launching.localJavaApplication">
+<listAttribute key="org.eclipse.debug.core.MAPPED_RESOURCE_PATHS">
+<listEntry value="/Kustvakt-core/src/main/java/de/ids_mannheim/korap/web/KustvaktBaseServer.java"/>
+</listAttribute>
+<listAttribute key="org.eclipse.debug.core.MAPPED_RESOURCE_TYPES">
+<listEntry value="1"/>
+</listAttribute>
+<booleanAttribute key="org.eclipse.debug.ui.ATTR_LAUNCH_IN_BACKGROUND" value="false"/>
+<stringAttribute key="org.eclipse.jdt.launching.CLASSPATH_PROVIDER" value="org.eclipse.m2e.launchconfig.classpathProvider"/>
+<stringAttribute key="org.eclipse.jdt.launching.MAIN_TYPE" value="de.ids_mannheim.korap.web.KustvaktBaseServer"/>
+<stringAttribute key="org.eclipse.jdt.launching.PROJECT_ATTR" value="Kustvakt-core"/>
+<stringAttribute key="org.eclipse.jdt.launching.SOURCE_PATH_PROVIDER" value="org.eclipse.m2e.launchconfig.sourcepathProvider"/>
+</launchConfiguration>
diff --git a/db.sqlite b/db.sqlite
new file mode 100644
index 0000000..148055d
--- /dev/null
+++ b/db.sqlite
Binary files differ
diff --git a/doDebugg.bat b/doDebugg.bat
new file mode 100644
index 0000000..f36762a
--- /dev/null
+++ b/doDebugg.bat
@@ -0,0 +1,9 @@
+: skript zum Remote Debuggen von eclipse's Debugger aus.
+
+set OPTS=-Xdebug -Xnoagent -Djava.compiler=NONE -Xrunjdwp:transport=dt_socket,server=y,suspend=n,address=5005
+set JAR=-jar target/Kustvakt-core-0.59.7.jar
+
+java %OPTS% %JAR%
+
+
+
diff --git a/pom.xml b/pom.xml
index ebbc721..1f9be55 100644
--- a/pom.xml
+++ b/pom.xml
@@ -432,7 +432,8 @@
<dependency>
<groupId>org.flywaydb</groupId>
<artifactId>flyway-core</artifactId>
- <version>3.2.1</version>
+ <!-- version>3.2.1</version -->
+ <version>4.0</version>
</dependency>
<dependency>
diff --git a/src/main/java/de/ids_mannheim/korap/handlers/EntityDao.java b/src/main/java/de/ids_mannheim/korap/handlers/EntityDao.java
index 8829064..5c23916 100644
--- a/src/main/java/de/ids_mannheim/korap/handlers/EntityDao.java
+++ b/src/main/java/de/ids_mannheim/korap/handlers/EntityDao.java
@@ -53,10 +53,28 @@
// usersettings are fetched plus basic account info, no details, since i rarely use them anyway!
@Override
public User getAccount (String username) throws KustvaktException {
+
+ Boolean bDEBUG = true;
Map<String, String> namedParameters = Collections
.singletonMap("username", username);
final String sql = "select a.* from korap_users as a where a.username=:username;";
User user;
+
+ // Debug by FB
+ if ( bDEBUG == true )
+ { // User cannot be found in SQL DB since LDAP Authentication,
+ // so create a User Object here.
+ // TODO: what more data should be stored into it?
+ // 28.04.17/FB
+ user = new KorAPUser();
+ user.setUsername(username);
+ return user;
+ }
+ if( username.equalsIgnoreCase("bodmer") == true )
+ {
+ return null;
+ }
+ //
try {
user = this.jdbcTemplate.queryForObject(sql, namedParameters,
new RowMapperFactory.UserMapper());
diff --git a/src/main/java/de/ids_mannheim/korap/interfaces/AuthenticationManagerIface.java b/src/main/java/de/ids_mannheim/korap/interfaces/AuthenticationManagerIface.java
index d5af729..e110a5b 100644
--- a/src/main/java/de/ids_mannheim/korap/interfaces/AuthenticationManagerIface.java
+++ b/src/main/java/de/ids_mannheim/korap/interfaces/AuthenticationManagerIface.java
@@ -32,6 +32,15 @@
protected AuthenticationIface getProvider (String key, String default_iface) {
+
+ // Debug FB: loop a Map
+ /*
+ for (Map.Entry<String, AuthenticationIface> entry : this.providers.entrySet())
+ {
+ System.out.println("Debug: provider: Key : " + entry.getKey() + " Value : " + entry.getValue());
+ }
+ */
+
AuthenticationIface iface = this.providers.get(key != null ? key
.toLowerCase() : "none");
// todo: configurable authentication schema
diff --git a/src/main/java/de/ids_mannheim/korap/web/service/full/ResourceService.java b/src/main/java/de/ids_mannheim/korap/web/service/full/ResourceService.java
index a13958e..bbca24a 100644
--- a/src/main/java/de/ids_mannheim/korap/web/service/full/ResourceService.java
+++ b/src/main/java/de/ids_mannheim/korap/web/service/full/ResourceService.java
@@ -475,7 +475,8 @@
@QueryParam("offset") Integer pageIndex,
@QueryParam("page") Integer pageInteger,
@QueryParam("cq") String cq, @QueryParam("engine") String engine) {
- TokenContext context = (TokenContext) securityContext
+
+ TokenContext context = (TokenContext) securityContext
.getUserPrincipal();
KustvaktConfiguration.BACKENDS eng = this.config.chooseBackend(engine);
User user;
diff --git a/src/main/resources/default-config.xml b/src/main/resources/default-config.xml
index edc741d..be9f080 100644
--- a/src/main/resources/default-config.xml
+++ b/src/main/resources/default-config.xml
@@ -83,9 +83,9 @@
<property name="username" value="${jdbc.username}"/>
<property name="password" value="${jdbc.password}"/>
<!-- relevant for single connection datasource and sqlite -->
- <!-- <property name="suppressClose">
+ <property name="suppressClose">
<value>true</value>
- </property> -->
+ </property>
<!--<property name="initialSize" value="2"/>-->
<!--<property name="poolPreparedStatements" value="true"/>-->
</bean>