forked from CxTyler/JVL_Actions
-
Notifications
You must be signed in to change notification settings - Fork 1
/
DisplayMessage.jsp
46 lines (41 loc) · 1.62 KB
/
DisplayMessage.jsp
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
<%@page import="java.sql.ResultSet"%>
<%@page import="java.sql.Statement"%>
<%@page import="java.sql.Connection"%>
<%@ include file="/header.jsp" %>
<%@ page import="org.cysecurity.cspf.jvl.model.DBConnect"%>
<%
if(session.getAttribute("isLoggedIn")!=null)
{
Connection con=new DBConnect().connect(getServletContext().getRealPath("/WEB-INF/config.properties"));
if(con!=null && !con.isClosed())
{
if(request.getParameter("msgid")!=null)
{
Statement stmt = con.createStatement();
ResultSet rs =null;
rs=stmt.executeQuery("select * from UserMessages where msgid="+request.getParameter("msgid"));
if(rs.next())
{
out.print("<b>Sender:</b> "+rs.getString("sender"));
out.print("<br/><b>Subject:</b>"+rs.getString("subject"));
out.print("<br/><b>Message:</b> <br/>"+rs.getString("msg"));
}
else
{
out.print("No Message Found");
}
}
else
{
out.print("Message Id Parameter is missing");
}
out.print("<br/><br/><a href='"+path+"/vulnerability/Messages.jsp'>Return to Messages >></a>");
out.print("<br/><br/><a href='"+path+"/myprofile.jsp?id="+session.getAttribute("userid")+"'>Return to Profile Page >></a>");
}
}
else
{
out.print("<span style='color:red'>* Please login to send message</span>");
}
%>
<%@ include file="/footer.jsp" %>