-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathConfigure.jsp
More file actions
33 lines (30 loc) · 966 Bytes
/
Configure.jsp
File metadata and controls
33 lines (30 loc) · 966 Bytes
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
<%@page import="java.io.FileOutputStream"%>
<%@ include file="/header.jsp" %>
<%
if(session.getAttribute("isLoggedIn")!=null)
{
%>
<form action="Configure.jsp" method="POST">
<table>
<tr><td>Website Title:</td> <td><input type="text" name="siteTitle" value=""/></td></tr>
<tr><td></td><td><input type="submit" name="save" value="save"/></td></tr>
</table>
</form>
<%
if(request.getParameter("save")!=null)
{
Properties props=new Properties();
props.load(new FileInputStream(configPath));
props.setProperty("siteTitle",request.getParameter("siteTitle"));
FileOutputStream fileout = new FileOutputStream(configPath);
props.store(fileout, null);
fileout.close();
out.print("<b class='success'> Configuration saved </b>");
}
}
else
{
out.print("<b style='color:red'> x You Are not Authorized to view this Page x </b>");
}
%>
<%@ include file="/footer.jsp" %>