You are viewing a plain text version of this content. The canonical link for it is here.
Posted to axis-cvs@ws.apache.org by de...@apache.org on 2006/04/18 08:40:52 UTC
svn commit: r394858 -
/webservices/axis2/trunk/java/modules/core/src/org/apache/axis2/transport/http/ListingAgent.java
Author: deepal
Date: Mon Apr 17 23:40:49 2006
New Revision: 394858
URL: http://svn.apache.org/viewcvs?rev=394858&view=rev
Log:
-fixing 580
Modified:
webservices/axis2/trunk/java/modules/core/src/org/apache/axis2/transport/http/ListingAgent.java
Modified: webservices/axis2/trunk/java/modules/core/src/org/apache/axis2/transport/http/ListingAgent.java
URL: http://svn.apache.org/viewcvs/webservices/axis2/trunk/java/modules/core/src/org/apache/axis2/transport/http/ListingAgent.java?rev=394858&r1=394857&r2=394858&view=diff
==============================================================================
--- webservices/axis2/trunk/java/modules/core/src/org/apache/axis2/transport/http/ListingAgent.java (original)
+++ webservices/axis2/trunk/java/modules/core/src/org/apache/axis2/transport/http/ListingAgent.java Mon Apr 17 23:40:49 2006
@@ -106,8 +106,21 @@
}
}
+
+ private void validateUser(HttpServletRequest req, HttpServletResponse res) throws IOException {
+ String logged = (String) req.getSession().getAttribute(Constants.LOGGED);
+ if (!(logged != null && "Yes".equals(logged))) {
+ res.setContentType("text/html");
+ PrintWriter writer = new PrintWriter(out);
+ writer.write("<font color=\"red\">Invalid user , " +
+ "you have to loging to system before performing this operation</font>");
+ writer.flush();
+ }
+ }
+
private void changeParameters(HttpServletRequest req, HttpServletResponse res)
throws IOException {
+ validateUser(req, res);
if (req.getParameter("editServicepara") != null) {
String serviceName = req.getParameter("axisService");
AxisService service = configContext.getAxisConfiguration().getService(serviceName);
@@ -160,6 +173,7 @@
private void engageModulesGlobally(HttpServletRequest req, HttpServletResponse res)
throws IOException {
+ validateUser(req, res);
HashMap modules = configContext.getAxisConfiguration().getModules();
req.getSession().setAttribute(Constants.MODULE_MAP, modules);
@@ -184,6 +198,7 @@
private void engageModulesToOperation(HttpServletRequest req, HttpServletResponse res)
throws IOException {
+ validateUser(req, res);
HashMap modules = configContext.getAxisConfiguration().getModules();
req.getSession().setAttribute(Constants.MODULE_MAP, modules);
@@ -230,6 +245,7 @@
private void engageModulesToService(HttpServletRequest req, HttpServletResponse res)
throws IOException {
+ validateUser(req, res);
HashMap modules = configContext.getAxisConfiguration().getModules();
req.getSession().setAttribute(Constants.MODULE_MAP, modules);
@@ -266,6 +282,7 @@
private void engageModulesToServiceGroup(HttpServletRequest req, HttpServletResponse res)
throws IOException {
+ validateUser(req, res);
HashMap modules = configContext.getAxisConfiguration().getModules();
req.getSession().setAttribute(Constants.MODULE_MAP, modules);
@@ -402,6 +419,7 @@
*/
private void listAdminServices(HttpServletRequest req, HttpServletResponse res)
throws IOException {
+ validateUser(req, res);
HashMap services = configContext.getAxisConfiguration().getServices();
req.getSession().setAttribute(Constants.SERVICE_MAP, services);
@@ -411,12 +429,14 @@
}
private void listContexts(HttpServletRequest req, HttpServletResponse res) throws IOException {
+ validateUser(req, res);
req.getSession().setAttribute(Constants.CONFIG_CONTEXT, configContext);
res.sendRedirect("ViewContexts.jsp");
}
private void listGloballyModules(HttpServletRequest req, HttpServletResponse res)
throws IOException {
+ validateUser(req, res);
Collection modules = configContext.getAxisConfiguration().getEngagedModules();
req.getSession().setAttribute(Constants.MODULE_MAP, modules);
@@ -424,6 +444,7 @@
}
private void listModules(HttpServletRequest req, HttpServletResponse res) throws IOException {
+ validateUser(req, res);
HashMap modules = configContext.getAxisConfiguration().getModules();
req.getSession().setAttribute(Constants.MODULE_MAP, modules);
@@ -433,7 +454,9 @@
}
private void listPhases(HttpServletRequest req, HttpServletResponse res) throws IOException {
+ validateUser(req, res);
ArrayList phaselist = new ArrayList();
+
PhasesInfo info = configContext.getAxisConfiguration().getPhasesInfo();
phaselist.add(info.getINPhases());
@@ -503,6 +526,7 @@
private void listServiceGroups(HttpServletRequest req, HttpServletResponse res)
throws IOException {
+ validateUser(req, res);
Iterator serviceGroups = configContext.getAxisConfiguration().getServiceGroups();
HashMap services = configContext.getAxisConfiguration().getServices();
@@ -534,6 +558,7 @@
private void lsitServiceforParameterChanged(HttpServletRequest req, HttpServletResponse res)
throws IOException {
+ validateUser(req, res);
HashMap services = configContext.getAxisConfiguration().getServices();
req.getSession().setAttribute(Constants.SERVICE_MAP, services);
@@ -543,6 +568,7 @@
private void lsitServiceformodules(HttpServletRequest req, HttpServletResponse res)
throws IOException {
+ validateUser(req, res);
HashMap services = configContext.getAxisConfiguration().getServices();
req.getSession().setAttribute(Constants.SERVICE_MAP, services);
@@ -551,6 +577,7 @@
}
private void activateService(HttpServletRequest req, HttpServletResponse res) throws IOException {
+ validateUser(req, res);
if (req.getParameter("submit") != null) {
String serviceName = req.getParameter("axisService");
String turnon = req.getParameter("turnon");
@@ -569,6 +596,7 @@
}
private void inActivateService(HttpServletRequest req, HttpServletResponse res) throws IOException {
+ validateUser(req, res);
if (req.getParameter("submit") != null) {
String serviceName = req.getParameter("axisService");
String turnoff = req.getParameter("turnoff");
@@ -596,6 +624,7 @@
private void viewGlobalHandlers(HttpServletRequest req, HttpServletResponse res)
throws IOException {
+ validateUser(req, res);
req.getSession().setAttribute(Constants.GLOBAL_HANDLERS,
configContext.getAxisConfiguration());
res.sendRedirect(VIEW_GLOBAL_HANDLERS_JSP_NAME);
@@ -603,6 +632,7 @@
private void viewServiceHandlers(HttpServletRequest req, HttpServletResponse res)
throws IOException {
+ validateUser(req, res);
String service = req.getParameter("axisService");
if (service != null) {