%@ include file="/uni_lang.jsp" %>
<%@ page language = "java" errorPage = "common_error.jsp" session = "true" %>
<%@ page import = "java.sql.*" %>
<%@ page import = "SeBase.*" %>
<%
connectionpool = new SeBase.DataConnection(trans);
%>
<%
convert = new SeBase.Conversion(trans);
%>
<%-- This is Test Drive Home Page --%>
<%
//For CSS-Mobile-Responsive-Design
String strTdEditorMode = request.getParameter("hidden_td_mode");
if(strTdEditorMode!=null && strTdEditorMode.equals("responsive_design")) {
session.setAttribute("s_visited_module_id","1");
session.setAttribute("s_site_wizard_visited","VISITED");
}
// if reseller id not present then deny access
boolean f_b_deny_access = false;
String l_str_brand_name = (String)session.getAttribute("s_r_brand_name");
String f_str_user_type = null; // to store user type
String f_str_user_context = null; // to store user context
String f_str_module_name = null; // to store module name
String f_str_module_desc = null; // to store module description
String f_str_module_http_root_path = null; // to store module's http root path
String f_str_module_wel_page_name = null; // to store module welcome page's name
String f_str_module_congrats = null; // to store congrats messgae
String f_str_output = null; // to store output
String f_str_source = null; // to store source reference path
String f_str_script_output = null; // to store script output
String f_str_site_wizard_visited = null; // to store site wizard visited mode
String f_str_query = null; // to store query string
String f_str_visited_module_id = null; // to store object representation of module id
String f_str_cong_mesg = ""; // to store congratulations message
SeBaseGlobal f_obj_sbg = SeBaseGlobal.getInstance(trans); // to store SeBaseGlobal instance
int f_int_visited_module_id = -1; // to store visited module id
int f_int_module_id = -1; // to store module id
boolean f_b_session_invalidation_flag = true;// to store session invalidation mode
boolean f_b_congrats_display_flag = false; // to store congrats messge mode
boolean f_b_display_flag = false; // to store display mode
boolean f_b_forward = false;
Connection f_obj_conn = null; // to store connection object
Statement f_obj_state = null; // to store statement object
ResultSet f_obj_rs = null; // to store result set object
final String F_STR_FORM_EDIT = "/foman/form_edit.jsp"; // constant to refer form edit page
final String F_STR_SHOP_CHOOSELAYOUT = "/shwiz/shop_chooselayout.jsp"; // constant to refer choose layout page
final String F_STR_TESTDRIVE = "TEST DRIVE"; // to represent teset drive mode
final String F_STR_SEPARATOR = "/"; // to represent file separator
final String F_STR_NOT_VISITED = "NOT VISITED"; // to represent site wizard not visited mode
final String F_STR_VISITED = "VISITED"; // to represent site wizard visited mode
final String F_STR_MINUS_ONE = "-1"; // to represent minus one
f_str_output = "";
f_str_script_output = "";
session.removeAttribute("s_popular_gen");
session.removeAttribute("s_all_gen");
// Included since session validation performed
boolean f_bln_logo_flag=true;
// Start include /image_ref.jsp
%>
<%@ include file="/image_ref.jsp" %>
<%
l_str_design_id = request.getParameter("design_id");
if ((l_str_design_id == null) && (session.getAttribute("s_r_init_design") != null))
{
l_str_design_id = (String)session.getAttribute("s_r_init_design");
}
if(l_str_design_id != null && !l_str_design_id.equals("") && !l_str_design_id.equals("null"))
{
l_int_design_id = Integer.parseInt(l_str_design_id);
}
l_obj_cookie = new Cookie("c_design_id",l_str_design_id);
response.addCookie(l_obj_cookie);
}
f_bln_logo_flag = bln_logo_flag;
}
// End include /image_ref.jsp
/* This code commented since to remove session expire occurs due to checking of cookie from html page
if(request.getHeader("Cookie") == null)
{ // if cookie not present
response.sendRedirect("common_authenticate.jsp");
} // end-of-if cookie not present
else
{ // else cookie present
*/
if (session == null){ // if session is null
f_b_session_invalidation_flag = true;
} // end-of-if session is null
else if ((session != null) && (!(session.isNew()))){
// else if session is not null and not new
f_str_user_type = (String)session.getAttribute("s_user_type");
f_str_user_context = (String)session.getAttribute("s_user_context");
if (f_str_user_type != null){ // if user type is not null
if (f_str_user_type.trim().equals(f_obj_sbg.A_STR_GUEST)){ // if user type is guest
if (f_str_user_context != null){ // if user context is not null
if (f_str_user_context.trim().equals(F_STR_TESTDRIVE)){ // if user context is testdrive
f_b_session_invalidation_flag = false;
} // end-of-if user context is testdrive
} // end-of-if user context is not null
} // end-of-if user type is guest
} // end-of-if user type is not null
} //end-of-else if session is not null and not new
if(f_b_session_invalidation_flag){ // if session invalidation flag is true
if (session != null){ // if session is not null
// session.invalidate();
String[] l_arr_str_ses_names = session.getValueNames();
if (l_arr_str_ses_names != null)
{
int l_int_ses_cnt = 0;
int l_int_ses_len = l_arr_str_ses_names.length;
// for getting session values
while(l_int_ses_cnt < l_int_ses_len)
{
session.removeValue(l_arr_str_ses_names[l_int_ses_cnt]);
if(session.getAttribute(l_arr_str_ses_names[l_int_ses_cnt]) != null)
{
session.removeAttribute(l_arr_str_ses_names[l_int_ses_cnt]);
}
l_int_ses_cnt++;
}
}
} // end-of-if session is not null
else
{
session = request.getSession(true);
}
} // end-of-if session invalidation flag is true
// Included since session validation performed
session.setAttribute("s_logo_enable", new Boolean(f_bln_logo_flag));
l_obj_cookie = new Cookie("c_reseller_id",l_str_reseller_id);
//l_obj_cookie.setMaxAge(-1);
response.addCookie(l_obj_cookie);
l_obj_cookie = new Cookie("c_mode",l_str_mode);
//l_obj_cookie.setMaxAge(-1);
response.addCookie(l_obj_cookie);
session.setAttribute("s_user_type",f_obj_sbg.A_STR_GUEST);
session.setAttribute("s_user_context",F_STR_TESTDRIVE);
session.setAttribute("s_module_id",F_STR_MINUS_ONE);
f_str_site_wizard_visited = (String)session.getAttribute("s_site_wizard_visited");
// if site wizard visited is null or in visited mode
if((f_str_site_wizard_visited == null) || (f_str_site_wizard_visited != null && !(f_str_site_wizard_visited.trim().equals(F_STR_VISITED)))){
session.setAttribute("s_site_wizard_visited",F_STR_NOT_VISITED);
session.setAttribute("s_next_module","");
f_b_forward = false;
} // end-of-if site wizard visited is null or in visited mode
else if((f_str_site_wizard_visited != null) || (f_str_site_wizard_visited.trim().equals(F_STR_VISITED))){
String l_str_next_module = null;
l_str_next_module = (String)session.getAttribute("s_next_module");
if((l_str_next_module == null) || ((l_str_next_module != null) && (l_str_next_module.trim().equals("")))){
f_b_forward = false;
}
else{
f_b_forward = true;
}
}
if(!f_b_forward){
// if access allowed
if (!f_b_deny_access)
{
%>
<%@ include file="/image_ref_ui.jsp" %>
<%
// if access allowed
if (!f_b_deny_access)
{
%>
<%@ include file="/image_ref_ses.jsp" %>
<%
} // access denied ----1111
} // access denied
if (f_b_deny_access)
{
//session.setAttribute("s_header_links", "n");
//session.setAttribute("s_sub_navig", "n");
session.setAttribute("s_title", trans.getPropValue("Var13307"));
%>
<%
}
else
{
response.sendRedirect("/sebase/tdrive.jsp");
} // if (!f_b_deny_access)
}
// } // end-of-else cookie present
%>