📄 logonform.java
字号:
/*
* SSL-Explorer
*
* Copyright (C) 2003-2006 3SP LTD. All Rights Reserved
*
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License
* as published by the Free Software Foundation; either version 2 of
* the License, or (at your option) any later version.
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public
* License along with this program; if not, write to the Free Software
* Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
*/
package com.sslexplorer.security.forms;
import javax.servlet.http.HttpServletRequest;
import org.apache.struts.Globals;
import org.apache.struts.action.ActionErrors;
import org.apache.struts.action.ActionMapping;
import org.apache.struts.action.ActionMessage;
import com.sslexplorer.core.forms.CoreForm;
import com.sslexplorer.security.Constants;
import com.sslexplorer.security.User;
public class LogonForm extends CoreForm {
private String username;
private String password;
private boolean sessionLocked;
private boolean hasMoreAuthenticationSchemes;
private int currentModuleIndex;
private boolean obfuscatedMode = false;
private boolean newSignOn = false;
/**
* @return Returns the password.
*/
public String getPassword() {
return password;
}
/**
* @param password The password to set.
*/
public void setPassword(String password) {
this.password = password.trim();
}
/**
* @return Returns the username.
*/
public String getUsername() {
return username;
}
/**
* @param username The username to set.
*/
public void setUsername(String username) {
this.username = username.trim();
}
/* (non-Javadoc)
* @see org.apache.struts.action.ActionForm#reset(org.apache.struts.action.ActionMapping, javax.servlet.http.HttpServletRequest)
*/
public void reset(ActionMapping mapping, HttpServletRequest request) {
User sessionLockUser = (User)request.getSession().getAttribute(Constants.SESSION_LOCKED);
sessionLocked = sessionLockUser != null;
username = sessionLocked ? sessionLockUser.getPrincipalName() : null;
password = null;
hasMoreAuthenticationSchemes = false;
}
public boolean getUsernameRequired() {
if (obfuscatedMode){
return false;
}
else{
return !getSessionLocked() && currentModuleIndex == 0;
}
}
/**
* @return Returns the sessionLocked.
*/
public boolean getSessionLocked() {
return sessionLocked;
}
/**
* @param sessionLocked The sessionLocked to set.
*/
public void setSessionLocked(boolean sessionLocked) {
this.sessionLocked = sessionLocked;
}
public boolean getHasMoreAuthenticationSchemes() {
return hasMoreAuthenticationSchemes;
}
public void setHasMoreAuthenticationSchemes(boolean hasMoreAuthenticationSchemes) {
this.hasMoreAuthenticationSchemes = hasMoreAuthenticationSchemes;
}
/**
* @param currentModuleIndex
*/
public void setCurrentModuleIndex(int currentModuleIndex) {
this.currentModuleIndex = currentModuleIndex;
}
public boolean isObfuscatedMode() {
return obfuscatedMode;
}
public void setObfuscatedMode(boolean obfuscatedMode) {
this.obfuscatedMode = obfuscatedMode;
}
public boolean isNewSignOn() {
return newSignOn;
}
public void setNewSignOn(boolean newSignOn) {
this.newSignOn = newSignOn;
}
}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -