Browse Source

Diagnosetool für Sessions

master
Meikel Bisping 6 months ago
parent
commit
b5ff6e74ba
  1. 100
      xml/diagnosetool_session.jsp

100
xml/diagnosetool_session.jsp

@ -0,0 +1,100 @@ @@ -0,0 +1,100 @@
<%@ page import="de.superx.common.*" %>
<%@ page import ="org.dbforms.config.DbFormsConfigRegistry,java.sql.Connection,java.sql.Statement,java.sql.ResultSet" %>
<%
HttpSession s=request.getSession(false);
if (s!=null&&s.getAttribute("user")!=null)
{
String mandantenid="";
Object mandantobject=s.getAttribute("MandantenID");
if(mandantobject != null)
mandantenid=mandantobject.toString();
//der superx-Default-Mandant ist bei dbforms ein Leerstring
if(mandantenid.equals("default"))
mandantenid="";
//mandantenid="";//TEST
out.println("<html><body><p>sessiontype="+s.getAttribute("sessiontype")+" mandant:"+mandantobject+"</p>");
out.println("<p>userid "+((SxUser)s.getAttribute("user")).getId()+"");
out.println("username "+((SxUser)s.getAttribute("user")).getName()+"");
out.println("admin "+((SxUser)s.getAttribute("user")).isAdmin()+"</p>");
Object userid=s.getAttribute("UserID");
out.println("<p>userid in session "+userid+"</p>");
out.println("<p>basicmap "+((SxUser)s.getAttribute("user")).getBasicMap()+"</p>");
SxFinRechte f=(SxFinRechte) ((SxUser)s.getAttribute("user")).getBasicMap().get("SxFinRechte");
Sichten sichten=((SxUser)s.getAttribute("user")).getSichten();
java.util.LinkedList l=new java.util.LinkedList();
l.add("");//kostenstellenrechte
l.add("1.7.2024");
out.println("<p>finrechte "+f.exec(l)+"</p>");
Connection conmm=null;
Statement st5;
ResultSet l_rset5;
try {
conmm = DbFormsConfigRegistry.instance().lookup().getConnection(mandantenid);
st5=conmm.createStatement();
String sql = "select ch110_institut from user_institution where userid="+userid;
l_rset5 = st5.executeQuery(sql);
StringBuffer buf=new StringBuffer();
while (l_rset5.next())
{
buf.append(l_rset5.getObject(1)+",");
}
l_rset5.close();
out.println("<p> user_institution:"+buf);
buf=new StringBuffer();
sql = "select * from fin_user_kam where userid="+userid;
l_rset5 = st5.executeQuery(sql);
String names[] ={"tid" , "userid ", "buchungsab_fb", "projnr_ins ", "kapitel ", "dr ", "titel ",
"untertitel ", "kostenstellen ", "ins2 ", "ins3 ", "gueltig_von ", "gueltig_bis "};
buf=new StringBuffer("<table border=1><tr>");
for (int i=1;i<14;i++) buf.append("<td>"+names[i-1].trim()+"</td>");
buf.append("</tr>");
while (l_rset5.next())
{
buf.append("<tr>");
for (int i=1;i<14;i++)
buf.append("<td>"+l_rset5.getObject(i)+"</td>");
buf.append("</tr>");
}
buf.append("</table>");
l_rset5.close();
out.println("<p> fin_user_kam:"+buf);
st5.close();
conmm.close();
}
catch (Exception e) {
out.print("<html><body>Fehler bei Datenverbindung: "+e+ " MandantenID"+mandantenid);
}
out.println("<p> <b>Session gesamt</b><br>");
for (java.util.Enumeration en=s.getAttributeNames();en.hasMoreElements();)
{
String n=(String)en.nextElement();
out.println(n+":"+s.getAttribute(n)+"<br>");
}
out.println("</p>");
out.println("<p> <b>Sichten</b><br>Erst bei Bedarf eingelesen<br>");
for (java.util.Iterator it=sichten.iterator();it.hasNext();)
{
AbstractSicht sicht=(AbstractSicht)it.next();
out.println(sicht.getArt()+" "+sicht.getName()+
"<br>");
out.println("</body></html>");
}
}
else
{
out.println("<html><body>keine Session</body></html>");
}
%>
Loading…
Cancel
Save