Fix [ 1892384 ] Bug - not saving info on AD_Session

This commit is contained in:
Carlos Ruiz 2008-02-13 04:29:00 +00:00
parent c6e4203274
commit 4b874675ef
1 changed files with 16 additions and 0 deletions

View File

@ -19,9 +19,14 @@ package org.adempiere.webui;
import java.util.Properties; import java.util.Properties;
import javax.servlet.http.HttpSession;
import org.adempiere.webui.session.SessionManager; import org.adempiere.webui.session.SessionManager;
import org.compiere.model.MSession;
import org.compiere.util.Env; import org.compiere.util.Env;
import org.compiere.util.Language; import org.compiere.util.Language;
import org.zkoss.zk.ui.Executions;
import org.zkoss.zk.ui.Session;
import org.zkoss.zk.ui.event.ClientInfoEvent; import org.zkoss.zk.ui.event.ClientInfoEvent;
import org.zkoss.zk.ui.event.Event; import org.zkoss.zk.ui.event.Event;
import org.zkoss.zk.ui.event.EventListener; import org.zkoss.zk.ui.event.EventListener;
@ -103,10 +108,21 @@ public class AdempiereWebUI extends Window implements EventListener
Language language = Language.getLanguage(langLogin); Language language = Language.getLanguage(langLogin);
Env.verifyLanguage(ctx, language); Env.verifyLanguage(ctx, language);
// Create adempiere Session - user id in ctx
Session currSess = Executions.getCurrent().getDesktop().getSession();
HttpSession httpSess = (HttpSession) currSess.getNativeSession();
MSession.get (ctx, currSess.getClientAddr(),
currSess.getClientHost(), httpSess.getId() );
} }
public void logout() public void logout()
{ {
MSession mSession = MSession.get(Env.getCtx(), false);
if (mSession != null) {
mSession.logout();
}
SessionManager.clearSession(); SessionManager.clearSession();
super.getChildren().clear(); super.getChildren().clear();
loginDesktop = new WLogin(this); loginDesktop = new WLogin(this);