if (op == null)
op = "";
final String operation = op;
ParamBean jParams = initAdminJahiaData(request, response, session);
final JahiaUser user = jParams.getUser();
final JahiaSite site = jParams.getSite();
try {
Boolean accessGranted = (Boolean) session.getAttribute(CLASS_NAME + "accessGranted");
if (accessGranted == null) {
accessGranted = Boolean.FALSE;
}
if (accessGranted) {
Locale uiLocale = (Locale) request.getSession().getAttribute(ProcessingContext.SESSION_UI_LOCALE);
if(request.getParameter("switchUiLocale") != null) {
uiLocale = LanguageCodeConverters.languageCodeToLocale(request.getParameter("switchUiLocale"));
request.getSession().setAttribute(ProcessingContext.SESSION_UI_LOCALE, uiLocale);
user.setProperty("preferredLanguage", uiLocale.toString());
}
Config.set(request, Config.FMT_LOCALIZATION_CONTEXT,
new LocalizationContext(new JahiaResourceBundle(uiLocale, site.getTemplatePackageName()), uiLocale));
AdministrationModulesRegistry modulesRegistry = (AdministrationModulesRegistry) SpringContextSingleton.getInstance().getContext().getBean("administrationModulesRegistry");
AdministrationModule currentModule = modulesRegistry.getServerAdministrationModule(operation);
if (currentModule != null) {
if (hasSitePermission(currentModule.getPermissionName(), site.getSiteKey()) || hasServerPermission(currentModule.getPermissionName())) {
session.setAttribute(CLASS_NAME + "configJahia", Boolean.TRUE);
/** todo clean up this hardcoded mess. Is it even used anymore ? */
if ("sharecomponents".equals(operation) && user.isRoot()) {
request.setAttribute("showAllComponents", Boolean.TRUE);
}
currentModule.service(request, response);
} else if ("sites".equals(operation) && (session.getAttribute(JahiaAdministration.CLASS_NAME + "redirectToJahia") != null)) {