Subversion Repositories SmartDukaan

Rev

Rev 3389 | Rev 5148 | Go to most recent revision | Show entire file | Ignore whitespace | Details | Blame | Last modification | View Log | RSS feed

Rev 3389 Rev 3936
Line 13... Line 13...
13
import javax.servlet.http.HttpServletRequest;
13
import javax.servlet.http.HttpServletRequest;
14
import javax.servlet.http.HttpSession;
14
import javax.servlet.http.HttpSession;
15
 
15
 
16
import org.apache.struts2.convention.annotation.InterceptorRef;
16
import org.apache.struts2.convention.annotation.InterceptorRef;
17
import org.apache.struts2.convention.annotation.InterceptorRefs;
17
import org.apache.struts2.convention.annotation.InterceptorRefs;
-
 
18
import org.apache.struts2.convention.annotation.Result;
-
 
19
import org.apache.struts2.convention.annotation.Results;
18
import org.apache.struts2.interceptor.ServletRequestAware;
20
import org.apache.struts2.interceptor.ServletRequestAware;
19
import org.json.JSONObject;
21
import org.json.JSONObject;
20
import org.slf4j.Logger;
22
import org.slf4j.Logger;
21
import org.slf4j.LoggerFactory;
23
import org.slf4j.LoggerFactory;
22
 
24
 
23
@InterceptorRefs({
25
@InterceptorRefs({
24
    @InterceptorRef("defaultStack"),
26
    @InterceptorRef("defaultStack"),
25
    @InterceptorRef("login")
27
    @InterceptorRef("login")
26
})
28
})
-
 
29
@Results({
-
 
30
    @Result(name="authfail", type="redirectAction", params = {"actionName" , "reports"})
-
 
31
})
27
public class PromotionsController implements ServletRequestAware {
32
public class PromotionsController implements ServletRequestAware {
28
	
33
	
29
	private static Logger log = LoggerFactory.getLogger(PromotionsController.class);
34
	private static Logger log = LoggerFactory.getLogger(PromotionsController.class);
30
	
35
	
31
	private HttpServletRequest request;
36
	private HttpServletRequest request;
Line 41... Line 46...
41
		this.session = req.getSession();
46
		this.session = req.getSession();
42
	}
47
	}
43
	
48
	
44
	public String index() {
49
	public String index() {
45
        if (!ReportsUtils.canAccessReport((Long) session.getAttribute(ReportsUtils.ROLE), request.getServletPath()))	{
50
        if (!ReportsUtils.canAccessReport((Long) session.getAttribute(ReportsUtils.ROLE), request.getServletPath()))	{
46
            return "exception";
51
            return "authfail";
47
        }
52
        }
48
		try {
53
		try {
49
			PromotionClient promotionServiceClient = new PromotionClient();
54
			PromotionClient promotionServiceClient = new PromotionClient();
50
			promotionClient = promotionServiceClient.getClient();
55
			promotionClient = promotionServiceClient.getClient();
51
			
56