From 45ad000a53dfd90d36ff5c74d5900a24e7b2df00 Mon Sep 17 00:00:00 2001 From: ulrich <undisclosed> Date: Sat, 03 Mar 2018 18:19:22 +0000 Subject: [PATCH] Ordner dav in ui.js hinzugefuegt --- src/java/de/uhilger/filecms/pub/SessionManager.java | 12 ++++++++++++ 1 files changed, 12 insertions(+), 0 deletions(-) diff --git a/src/java/de/uhilger/filecms/pub/SessionManager.java b/src/java/de/uhilger/filecms/pub/SessionManager.java index 97bac3d..0a394cc 100644 --- a/src/java/de/uhilger/filecms/pub/SessionManager.java +++ b/src/java/de/uhilger/filecms/pub/SessionManager.java @@ -21,6 +21,7 @@ package de.uhilger.filecms.pub; import de.uhilger.filecms.api.Api; +import java.security.Principal; import java.util.logging.Logger; /** @@ -35,5 +36,16 @@ return "Die aktuelle Sitzung ist nicht mehr gueltig."; } + public String getSessionUser() { + String id = null; + Object p = getRequest().getUserPrincipal(); + if(p instanceof Principal) { + id = ((Principal) p).getName(); + logger.finer("User-ID: " + id); + } else { + logger.finer("getUserPrincipal returned null or no Principal"); + } + return id; + } } -- Gitblit v1.9.3