Refactor CMS life cycle.
[lgpl/argeo-commons.git] / org.argeo.cms / src / org / argeo / cms / auth / CurrentUser.java
index afb6360b476450401ad9fa06f638f01063f51558..85a4824646bec37124c8cefc79627240165a435a 100644 (file)
@@ -13,12 +13,12 @@ import java.util.UUID;
 import javax.security.auth.Subject;
 import javax.security.auth.x500.X500Principal;
 
+import org.argeo.api.cms.CmsConstants;
 import org.argeo.api.cms.CmsSession;
 import org.argeo.api.cms.CmsSessionId;
-import org.argeo.api.cms.CmsConstants;
 import org.argeo.cms.internal.auth.CmsSessionImpl;
 import org.argeo.cms.internal.auth.ImpliedByPrincipal;
-import org.argeo.cms.internal.kernel.Activator;
+import org.argeo.cms.internal.runtime.CmsContextImpl;
 import org.osgi.service.useradmin.Authorization;
 
 /**
@@ -107,7 +107,7 @@ public final class CurrentUser {
        public final static Locale locale(Subject subject) {
                Set<Locale> locales = subject.getPublicCredentials(Locale.class);
                if (locales.isEmpty()) {
-                       Locale defaultLocale = Activator.getNodeState().getDefaultLocale();
+                       Locale defaultLocale = CmsContextImpl.getCmsContext().getDefaultLocale();
                        return defaultLocale;
                } else
                        return locales.iterator().next();
@@ -152,7 +152,7 @@ public final class CurrentUser {
                else
                        return false;
                CmsSessionImpl cmsSession = CmsSessionImpl.getByUuid(nodeSessionId.toString());
-               
+
                // FIXME logout all views
                // TODO check why it is sometimes null
                if (cmsSession != null)