1 package org.campware.cream.modules.screens; 2 3 42 43 import org.apache.turbine.modules.screens.VelocitySecureScreen; 44 import org.apache.turbine.util.RunData; 45 import org.apache.turbine.Turbine; 46 47 import org.apache.velocity.context.Context; 48 49 56 public class SecureScreen extends VelocitySecureScreen 57 { 58 59 public static final int ENTITY=1001; 60 public static final int DOCUMENT=1002; 61 public static final int LOOKUP=1003; 62 public static final int SYSTEM=1004; 63 public static final int REPORT=1005; 64 public static final int UTIL=1006; 65 66 public void doBuildTemplate(RunData data, Context context) 67 { 68 } 69 70 77 protected boolean isAuthorized( RunData data ) throws Exception 78 { 79 boolean isAuthorized = false; 80 81 if (data.getUser().hasLoggedIn()) 82 { 83 isAuthorized = true; 84 } 85 else 86 { 87 data.setScreenTemplate(Turbine.getConfiguration().getString("template.login")); 89 90 isAuthorized = false; 91 } 92 93 95 return isAuthorized; 107 } 108 } 109 | Popular Tags |