Commit f8a3c834 by Tuomas Riihimäki

Random stuff

1 parent d5470a06
...@@ -5,7 +5,7 @@ ...@@ -5,7 +5,7 @@
xmlns:c="http://java.sun.com/jsp/jstl/core" xmlns:c="http://java.sun.com/jsp/jstl/core"
> >
<f:view locale="#{sessionHandler.locale}"> <f:view locale="#{sessionHandler.locale}" >
<ui:insert name="metadata" /> <ui:insert name="metadata" />
<h:head> <h:head>
...@@ -17,7 +17,7 @@ ...@@ -17,7 +17,7 @@
<link rel="stylesheet" type="text/css" href="#{request.contextPath}/resources/style/insomnia1/style.css" /> <link rel="stylesheet" type="text/css" href="#{request.contextPath}/resources/style/insomnia1/style.css" />
<ui:insert name="headerdata" /> <ui:insert name="headerdata" />
</h:head> </h:head>
<h:body> <h:body >
<div id="wrapper"> <div id="wrapper">
......
...@@ -5,16 +5,19 @@ ...@@ -5,16 +5,19 @@
xmlns:ui="http://java.sun.com/jsf/facelets" xmlns:ui="http://java.sun.com/jsf/facelets"
xmlns:h="http://java.sun.com/jsf/html" xmlns:h="http://java.sun.com/jsf/html"
xmlns:f="http://java.sun.com/jsf/core" xmlns:f="http://java.sun.com/jsf/core"
xmlns:orgrole="http://java.sun.com/jsf/composite/cditools/orgrole" xmlns:c="http://java.sun.com/jsp/jstl/core"
xmlns:c="http://java.sun.com/jsp/jstl/core"> xmlns:p="http://primefaces.org/ui"
>
<h:body> <h:body>
<ui:composition <ui:composition
template="/layout/#{sessionHandler.layout}/template.xhtml"> template="/layout/#{sessionHandler.layout}/template.xhtml">
<ui:param name="thispage" value="page.orgrole.list" /> <ui:param name="thispage" value="page.orgrole.list" />
<f:metadata> <f:metadata>
<f:event type="preRenderView" <f:event type="preRenderView" listener="#{orgRoleView.permissionList()}" />
listener="#{orgRoleView.permissionList()}" />
</f:metadata> </f:metadata>
<ui:define name="title">
<h1>#{i18n['foodwave.template.edit.title']}</h1>
</ui:define>
<ui:define name="content"> <ui:define name="content">
<orgrole:list /> <orgrole:list />
</ui:define> </ui:define>
......
<!DOCTYPE html <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"> "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xmlns:ui="http://java.sun.com/jsf/facelets" xmlns:h="http://java.sun.com/jsf/html" xmlns:f="http://java.sun.com/jsf/core" <html xmlns="http://www.w3.org/1999/xhtml" xmlns:ui="http://java.sun.com/jsf/facelets" xmlns:h="http://java.sun.com/jsf/html" xmlns:f="http://java.sun.com/jsf/core"
xmlns:users="http://java.sun.com/jsf/composite/tools/user" xmlns:c="http://java.sun.com/jsp/jstl/core"> xmlns:c="http://java.sun.com/jsp/jstl/core">
<h:body> <h:body>
<ui:composition template="/layout/#{sessionHandler.layout}/template.xhtml"> <ui:composition template="/resources/#{sessionHandler.layout}/template.xhtml">
<ui:param name="thispage" value="page.eventorg.edit" /> <ui:define name="page">
<ui:define name="content">
#{sessionHandler.flushCache()} #{sessionHandler.flushCache()}
<h:form>
<h:commandButton action="#{testView.resetMenu()}" value="Reset to newui menu" onclick="return confirm('THIS WILL RESET ALL MODIFICATIONS TO DEFAULT MENU!!\n Are you really sure?!');" />
<h:commandButton action="#{testView.resetOldMenu()}" value="Reset to old menu" onclick="return confirm('THIS WILL RESET ALL MODIFICATIONS TO DEFAULT MENU!!\n Are you really sure?!');" />
</h:form>
</ui:define> </ui:define>
</ui:composition> </ui:composition>
</h:body> </h:body>
</html> </html>
\ No newline at end of file
...@@ -10,7 +10,6 @@ import java.util.TimeZone; ...@@ -10,7 +10,6 @@ import java.util.TimeZone;
import javax.ejb.EJB; import javax.ejb.EJB;
import javax.enterprise.context.RequestScoped; import javax.enterprise.context.RequestScoped;
import javax.faces.context.FacesContext; import javax.faces.context.FacesContext;
import javax.inject.Inject;
import javax.inject.Named; import javax.inject.Named;
import javax.servlet.http.HttpServletRequest; import javax.servlet.http.HttpServletRequest;
...@@ -34,10 +33,10 @@ import fi.insomnia.bortal.model.LanEventPropertyKey; ...@@ -34,10 +33,10 @@ import fi.insomnia.bortal.model.LanEventPropertyKey;
public class SessionHandler { public class SessionHandler {
private static final Logger logger = LoggerFactory.getLogger(SessionHandler.class); private static final Logger logger = LoggerFactory.getLogger(SessionHandler.class);
//
@Inject // @Inject
private HttpServletRequest httprequest; // private HttpServletRequest httprequest;
//
@EJB @EJB
private RoleBeanLocal rolebean; private RoleBeanLocal rolebean;
@EJB @EJB
......
...@@ -54,7 +54,7 @@ public abstract class GenericCDIView implements Serializable { ...@@ -54,7 +54,7 @@ public abstract class GenericCDIView implements Serializable {
ret = requirePermissions(externalChecks); ret = requirePermissions(externalChecks);
} }
if (!ret) { if (!ret) {
logger.info("Permission required failed for {}", perm.getFullName()); logger.info("Permission required failed for {} Permission: {} (or extrachecks)", perm.getFullName(), perm);
} }
......
...@@ -77,15 +77,15 @@ public class PollView extends GenericCDIView { ...@@ -77,15 +77,15 @@ public class PollView extends GenericCDIView {
if (super.requirePermissions(PollPermission.ANSWER) && poll == null) { if (super.requirePermissions(PollPermission.ANSWER) && poll == null) {
thisPage = 1; thisPage = 1;
poll = pollBean.find(pollId); poll = pollBean.find(pollId);
if (super.requirePermissions(poll != null && poll.getQuestions() != null && !poll.getQuestions().isEmpty())) logger.debug("Initializing poll with id {} , poll {}", pollId, poll);
if (!super.requirePermissions(poll != null && poll.getQuestions() != null && !poll.getQuestions().isEmpty()))
{ {
return; return;
} }
logger.debug("initializing poll questions {}", poll.getQuestions());
pages = new HashMap<Integer, List<QuestionWrapper>>(); pages = new HashMap<Integer, List<QuestionWrapper>>();
logger.info("initializing poll {}", poll); for (PollQuestion q : poll.getQuestions()) {
for (PollQuestion q : getPoll().getQuestions()) {
if (!getPages().containsKey(q.getPage())) { if (!getPages().containsKey(q.getPage())) {
......
...@@ -32,17 +32,15 @@ public class AuthView extends GenericCDIView { ...@@ -32,17 +32,15 @@ public class AuthView extends GenericCDIView {
@Inject @Inject
private NavigationHandler navihandler; private NavigationHandler navihandler;
@EJB @EJB
private transient BootstrapBeanLocal bootStrapBean; private transient BootstrapBeanLocal bootStrapBean;
private HttpServletRequest getRequest() { private HttpServletRequest getRequest() {
FacesContext facesContext = FacesContext.getCurrentInstance(); FacesContext facesContext = FacesContext.getCurrentInstance();
ExternalContext externalContext = facesContext. ExternalContext externalContext = facesContext.getExternalContext();
getExternalContext();
Object request = externalContext.getRequest(); Object request = externalContext.getRequest();
return request instanceof HttpServletRequest ? return request instanceof HttpServletRequest ? (HttpServletRequest) request : null;
(HttpServletRequest) request : null;
} }
public void executeLogout() { public void executeLogout() {
...@@ -60,9 +58,9 @@ public class AuthView extends GenericCDIView { ...@@ -60,9 +58,9 @@ public class AuthView extends GenericCDIView {
} }
public void executeLogin() { public void executeLogin() {
bootStrapBean.saneDefaults(); bootStrapBean.saneDefaults();
if (login == null || password == null || login.isEmpty() || password.isEmpty()) { if (login == null || password == null || login.isEmpty() || password.isEmpty()) {
return; return;
} }
...@@ -99,10 +97,10 @@ public class AuthView extends GenericCDIView { ...@@ -99,10 +97,10 @@ public class AuthView extends GenericCDIView {
} }
} }
return; return;
} }
public String executeLoginAction() { public String executeLoginAction() {
executeLogin(); executeLogin();
return null; return null;
......
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!