logout.java

来自「反ajax原代码」· Java 代码 · 共 58 行

JAVA
58
字号
// Decompiled by Jad v1.5.7g. Copyright 2000 Pavel Kouznetsov.
// Jad home page: http://www.geocities.com/SiliconValley/Bridge/8617/jad.html
// Decompiler options: packimports(3) fieldsfirst ansi 
// Source File Name:   Logout.java

package com.laoer.bbscs.web.action;

import com.laoer.bbscs.bean.UserInfo;
import com.laoer.bbscs.business.IUserInfoService;
import com.laoer.bbscs.business.IUserOnlineService;
import com.laoer.bbscs.sys.SysInfo;
import com.laoer.bbscs.sys.UserInfoCache;
import com.laoer.bbscs.web.servlet.UserCheck;
import com.laoer.comm.util.Util;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import org.apache.struts.action.*;

// Referenced classes of package com.laoer.bbscs.web.action:
//            BaseAction

public class Logout extends BaseAction
{

    public Logout()
    {
    }

    public ActionForward execute(ActionMapping actionMapping, ActionForm actionForm, HttpServletRequest httpServletRequest, HttpServletResponse httpServletResponse)
    {
        UserCheck uc = getUserCheck(httpServletRequest, httpServletResponse);
        UserInfo ui = null;
        if(!uc.isGuest())
        {
            ui = getUserCache().getUserInfoFromCache(uc.getId());
            long atime = Util.getLongTime();
            long ntime = atime - ui.getLoginTime();
            ui.setLogoutTime(atime);
            ui.setStayTime(ui.getStayTime() + ntime);
            getUserInfoService().saveUserInfo(ui);
            uc.addUCookies("", "", (short)-1, 0);
            getUserOnlineService().removeUserOnline(ui.getUsername());
        } else
        {
            getUserOnlineService().removeUserOnline(uc.getUsername());
            uc.addUCookies("", "", (short)-1, 0);
        }
        if(SysInfo.getInstance().getUsepass().equals("y"))
        {
            ActionForward f = new ActionForward(SysInfo.getInstance().getLogouturl(), true);
            return f;
        } else
        {
            return actionMapping.findForward("logout");
        }
    }
}

⌨️ 快捷键说明

复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?