<%@page pageEncoding="utf-8" contentType="text/html; charset=UTF-8" %> <%@ page import ="org.dbforms.config.DbFormsConfigRegistry,java.sql.Connection,java.sql.Statement,java.sql.ResultSet" %> <% String mandantenid="default"; //Ermittlung der Mandantenid zuerst aus Session, //wenn leer (d.h. User ist noch nicht angemeldet) //dann über request-Parameter Object mandantobject=request.getSession().getAttribute("MandantenID"); if(mandantobject != null) mandantenid=mandantobject.toString(); String mandantparam=request.getParameter("MandantenID"); if(mandantparam !=null && !mandantenid.equals("")) mandantenid=mandantparam; StringBuffer defaultReport=new StringBuffer(); String defaultReportParam=request.getParameter("report_id"); String defaultMandantenIDParam=request.getParameter("MandantID"); StringBuffer LinkMandantenID=new StringBuffer(""); String MandantenID_Login=mandantenid; LinkMandantenID.append(""); defaultReport.append("?a=b"); if(defaultReportParam != null && !defaultReportParam.toString().equals("")) defaultReport.append("&report_id="+defaultReportParam.toString()); if((defaultMandantenIDParam == null || defaultMandantenIDParam.toString().equals("")) && !mandantenid.equals("default")) { defaultMandantenIDParam=mandantenid; } if(defaultMandantenIDParam != null && !defaultMandantenIDParam.toString().equals("")) { defaultReport.append("&MandantID="+defaultMandantenIDParam.toString()); LinkMandantenID.append("");//"/"+defaultMandantenIDParam.toString()); MandantenID_Login=defaultMandantenIDParam.toString(); } //Daten aus Datenbank werden in Variablen gespeichert Connection conmm=null; //out.println("Getting Connection for mandantenid="+mandantenid); try { conmm = DbFormsConfigRegistry.instance().lookup().getConnection(mandantenid); //System.out.println("Got Connection"); Statement st; st=conmm.createStatement(); ResultSet rs; String hs_logo=""; rs = st.executeQuery("select trim(contents_short) from sx_captions where id='REPORT_LOGO_FILE' and contents_short is not null and trim(contents_short) != '' "); while (rs.next()) { if(rs.getObject(1) !=null) hs_logo=rs.getObject(1).toString(); } //System.out.println("hs_logo="+hs_logo); String hs_link=""; rs = st.executeQuery("select contents_short from sx_captions where id='REPORT_HEADING_URL'"); while (rs.next()) { if(rs.getObject(1) !=null) hs_link=rs.getObject(1).toString(); } //System.out.println("hs_link="+hs_link); String hs_inst=""; rs = st.executeQuery("select contents_short from sx_captions where id='REPORT_HEADING_INSTITUTION'"); while (rs.next()) { if(rs.getObject(1) !=null) hs_inst=rs.getObject(1).toString(); } //System.out.println("hs_inst="+hs_inst); StringBuffer portlet=new StringBuffer(); rs = st.executeQuery("select name,class,icon,content,sortnr_initial,tid from sx_portlet where today() between gueltig_von and gueltig_bis and type='HTML' and (visible != 'false' or visible is null) order by sortnr_initial,tid"); while (rs.next()) { if(rs.getObject(1) !=null && rs.getObject(2) !=null && rs.getObject(3) !=null && rs.getObject(4) !=null) portlet.append("

"+ rs.getObject(1) +"

"+ rs.getString(4) +"
"); } //System.out.println("portlet="+portlet.toString()); StringBuffer portletall=new StringBuffer(); rs = st.executeQuery("select name,class,icon,content,visible,sortnr_initial,tid from sx_portlet where today() between gueltig_von and gueltig_bis and type='HTML' and visible='all' order by sortnr_initial,tid"); while (rs.next()) { if(rs.getObject(1) !=null && rs.getObject(2) !=null && rs.getObject(3) !=null && rs.getObject(4) !=null) portletall.append("

"+ rs.getObject(1) +"

"+ rs.getString(4) +"
"); } //System.out.println("portletall="+portletall.toString()); StringBuffer menu=new StringBuffer(); rs = st.executeQuery("select caption,content,comment from sx_repository where art='WELCOME_LINK' and today() between gueltig_seit and gueltig_bis and aktiv=1 order by sort1"); while (rs.next()) { if(rs.getObject(1) !=null && rs.getObject(2) !=null && rs.getObject(3) !=null) { if (mandantenid.toString().equals("default")) { menu.append("
  • "+ rs.getObject(1) +"
  • "); } else { String welcome_link=rs.getString(2); if(welcome_link.indexOf("?") >-1) welcome_link+="&MandantID="+ mandantenid.toString(); else welcome_link+="?MandantID="+ mandantenid.toString(); menu.append("
  • "+ rs.getObject(1) +"
  • "); } } //menu.append("
  • "+ rs.getObject(1) +"
  • "); } //System.out.println("menu="+menu.toString()); String custom_css=""; rs = st.executeQuery("select content from sx_repository where id='CUSTOM_CSS' and today() between gueltig_seit and gueltig_bis and aktiv=1"); while (rs.next()) { if(rs.getObject(1) !=null) custom_css=rs.getString(1); } rs.close(); st.close(); conmm.close(); %> SuperX <% if (request.getParameter("logoff") != null&&request.getSession()!=null) { request.getSession().invalidate(); }; if (request.getSession()!=null&&request.getSession().getAttribute("sessiontype")!=null&&request.getSession().getAttribute("sessiontype").equals("superx") && request.getSession().getAttribute("user")!=null) { %>
    <% if (hs_logo.toString()==null || hs_logo.toString()=="") { %> <% }else { %> <% } if (hs_inst.toString()==null || hs_inst.toString()=="") { %>

    Informationssystem der Hochschule

    <% }else { %>

    <%= hs_inst.toString() %>

    <% } %>
    <%= portlet.toString() %> <% }else {%> <% if(request.getRemoteUser() != null) { String username=request.getRemoteUser(); //int ende=username.indexOf("@"); //if(ende >-1) // username=username.substring(0,ende); %> <% } %>
    <% if (hs_logo.toString()==null || hs_logo.toString()=="") { %> <% }else { %> <% } if (hs_inst.toString()==null || hs_inst.toString()=="") { %>

    Informationssystem der Hochschule

    <% }else { %>

    <%= hs_inst.toString() %>

    <% } %>

    Kennung:

    Passwort:


    <%= portletall.toString() %> <%}%> <% } //Check DB connection catch (Exception e) { out.print("Fehler bei Datenverbindung: "+e+ " MandantID"+mandantenid); } %>