mirror of
https://github.com/apache/struts.git
synced 2026-08-31 11:24:28 +00:00
WW-1353 Refactor MailReader to use namespaces and conventional, finely-grained actions with no aliases. (Refactoring for wildcards is next.)
git-svn-id: https://svn.apache.org/repos/asf/struts/struts2/trunk@428196 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
@@ -1,16 +1,19 @@
|
||||
package mailreader2;
|
||||
|
||||
import com.opensymphony.xwork2.interceptor.Interceptor;
|
||||
import com.opensymphony.xwork2.ActionInvocation;
|
||||
import com.opensymphony.xwork2.Action;
|
||||
import java.util.Map;
|
||||
import com.opensymphony.xwork2.ActionInvocation;
|
||||
import com.opensymphony.xwork2.interceptor.Interceptor;
|
||||
import org.apache.struts.apps.mailreader.dao.User;
|
||||
|
||||
public class AuthenticationInterceptor implements Interceptor {
|
||||
import java.util.Map;
|
||||
|
||||
public void destroy () {}
|
||||
public class AuthenticationInterceptor implements Interceptor {
|
||||
|
||||
public void init() {}
|
||||
public void destroy() {
|
||||
}
|
||||
|
||||
public void init() {
|
||||
}
|
||||
|
||||
public String intercept(ActionInvocation actionInvocation) throws Exception {
|
||||
|
||||
@@ -18,12 +21,11 @@ public class AuthenticationInterceptor implements Interceptor {
|
||||
|
||||
User user = (User) session.get(Constants.USER_KEY);
|
||||
|
||||
boolean isAuthenticated = (null!=user) && (null!=user.getDatabase());
|
||||
boolean isAuthenticated = (null != user) && (null != user.getDatabase());
|
||||
|
||||
if (!isAuthenticated) {
|
||||
return Action.LOGIN;
|
||||
}
|
||||
else {
|
||||
return Action.LOGIN;
|
||||
} else {
|
||||
return actionInvocation.invoke();
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user