Commit 3c29d0e7 by Tuukka Kivilahti

kuvanotto ja sessiohäsmäkkä korjattu pääosin

1 parent c67cbe61
......@@ -12,9 +12,12 @@
</f:metadata>
<ui:define name="topbar">
<h:link styleClass="userbackbutton" outcome="/admin/adduser/index">
<div>#{i18n['adduser.back']}</div>
</h:link>
<h:form>
<h:commandLink styleClass="userbackbutton" action="#{userView.incomingPhotoReady}" value="Valmis">
<div>#{i18n['adduser.back']}</div>
</h:commandLink>
</h:form>
</ui:define>
<ui:define name="content">
......@@ -35,7 +38,7 @@
<div id="webcamcontainer">
<div id="count" />
<p:photoCam widgetVar="pc" listener="#{userView.oncapture}" update="@all" />
<p:photoCam widgetVar="pc" listener="#{userView.oncapture}" update="@all" />
<!-- <p:commandButton type="button" value="Capture" onclick="dophoto(pc)" />
-->
</div>
......@@ -44,15 +47,17 @@
</h:form>
</div>
<div style="">
<h:link style="margin: 0 auto; font-size: 3em;" outcome="/admin/adduser/index" value="Valmis"/>
<h:form>
<h:commandLink style="margin: 0 auto; font-size: 3em;" action="#{userView.incomingPhotoReady}" value="Valmis" />
</h:form>
</div>
<script>
function dophoto(pc) {
docount(5,pc);
docount(5, pc);
}
function docount(count,pc) {
function docount(count, pc) {
$('#count').html(count);
$('#count').css("opacity", 1);
$('#count').css("font-size", "28pt");
......@@ -63,9 +68,9 @@
}, 1500, function() {
if (count > 1)
docount(count - 1, pc);
if (count == 1) {
if (count == 1) {
pc.capture();
}
}
});
}
......
......@@ -84,6 +84,22 @@ public class AuthView extends GenericCDIView {
return "/frontpage";
}
public void executeLogoutNoRedirect() {
HttpServletRequest req = getRequest();
if (permbean.isLoggedIn()) {
try {
req.logout();
} catch (ServletException e) {
logger.warn("Error executing logout", e);
}
}
req.getSession().invalidate();
}
public void executeLogin() {
executeLogin(null);
......
......@@ -393,7 +393,7 @@ public class UserView extends GenericCDIView {
public String createUserAdduserView() {
userbean.createNewUser(user, getPassword());
// authView.executeAdduserAutoLogin(user, getPassword());
authView.executeAdduserAutoLogin(user, getPassword());
return "/admin/adduser/update";
}
......@@ -402,6 +402,14 @@ public class UserView extends GenericCDIView {
canSave = permbean.hasPermission(UserPermission.MODIFY);
return "/useradmin/edit";
}
// /admin/adduser/index
public String incomingPhotoReady() {
authView.executeLogoutNoRedirect();
navihandler.forward("/admin/adduser/index?faces-redirect=true");
return "/admin/adduser/index";
}
public void setUserid(Integer userid) {
this.userid = userid;
......
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!