X-Git-Url: https://git.argeo.org/?a=blobdiff_plain;f=eclipse%2Forg.argeo.cms.e4%2Fsrc%2Forg%2Fargeo%2Fcms%2Fe4%2Fparts%2FEgoDashboard.java;h=f2a73f2102c08bc490a8e54e960fb66bf9db66ca;hb=c2366f32052deada7d96f635e86f745f438f094e;hp=5a805d1e953646da314646793cb16bd87b3b58d2;hpb=b843d903237a2a4192c40d8c933e71137284050b;p=lgpl%2Fargeo-commons.git diff --git a/eclipse/org.argeo.cms.e4/src/org/argeo/cms/e4/parts/EgoDashboard.java b/eclipse/org.argeo.cms.e4/src/org/argeo/cms/e4/parts/EgoDashboard.java index 5a805d1e9..f2a73f210 100644 --- a/eclipse/org.argeo.cms.e4/src/org/argeo/cms/e4/parts/EgoDashboard.java +++ b/eclipse/org.argeo.cms.e4/src/org/argeo/cms/e4/parts/EgoDashboard.java @@ -1,23 +1,18 @@ package org.argeo.cms.e4.parts; -import java.security.AccessController; import java.time.ZonedDateTime; import javax.annotation.PostConstruct; -import javax.security.auth.Subject; import org.argeo.api.cms.CmsSession; import org.argeo.cms.auth.CurrentUser; -import org.argeo.cms.osgi.CmsOsgiUtils; import org.argeo.cms.swt.CmsSwtUtils; import org.eclipse.swt.layout.GridLayout; import org.eclipse.swt.widgets.Composite; -import org.osgi.framework.BundleContext; -import org.osgi.framework.FrameworkUtil; /** A canonical view of the logged in user. */ public class EgoDashboard { - private BundleContext bc = FrameworkUtil.getBundle(EgoDashboard.class).getBundleContext(); +// private BundleContext bc = FrameworkUtil.getBundle(EgoDashboard.class).getBundleContext(); @PostConstruct public void createPartControl(Composite p) { @@ -33,14 +28,14 @@ public class EgoDashboard { CmsSwtUtils.txt(p, role); } - Subject subject = Subject.getSubject(AccessController.getContext()); - if (subject != null) { - CmsSession cmsSession = CmsOsgiUtils.getCmsSession(bc, subject); - ZonedDateTime loggedIndSince = cmsSession.getCreationTime(); - CmsSwtUtils.lbl(p, "Session:"); - CmsSwtUtils.txt(p, cmsSession.getUuid().toString()); - CmsSwtUtils.lbl(p, "Logged in since:"); - CmsSwtUtils.txt(p, loggedIndSince.toString()); - } +// Subject subject = Subject.getSubject(AccessController.getContext()); +// if (subject != null) { + CmsSession cmsSession = CurrentUser.getCmsSession(); + ZonedDateTime loggedIndSince = cmsSession.getCreationTime(); + CmsSwtUtils.lbl(p, "Session:"); + CmsSwtUtils.txt(p, cmsSession.getUuid().toString()); + CmsSwtUtils.lbl(p, "Logged in since:"); + CmsSwtUtils.txt(p, loggedIndSince.toString()); +// } } }