Refactored as implementations of AuthenticatingHttpServlet.
[guacamole.git] / src / main / java / net / sourceforge / guacamole / net / basic / ConfigurationList.java
index f7585a6..30bf1d2 100644 (file)
@@ -34,25 +34,14 @@ import net.sourceforge.guacamole.protocol.GuacamoleConfiguration;
  * 
  * @author Michael Jumper
  */
-public class ConfigurationList extends HttpServlet {
+public class ConfigurationList extends AuthenticatingHttpServlet {
 
     @Override
-    protected void service(HttpServletRequest request, HttpServletResponse response)
+    protected void authenticatedService(
+            Map<String, GuacamoleConfiguration> configs,
+            HttpServletRequest request, HttpServletResponse response)
     throws IOException {
 
-        HttpSession httpSession = request.getSession(true);
-
-        // Get user configuration
-        // Get authorized configs
-        Map<String, GuacamoleConfiguration> configs = (Map<String, GuacamoleConfiguration>) 
-                httpSession.getAttribute("GUAC_CONFIGS");
-
-        // If no configs in session, not authorized
-        if (configs == null) {
-            response.sendError(HttpServletResponse.SC_FORBIDDEN);
-            return;
-        }
-
         // Do not cache
         response.setHeader("Cache-Control", "no-cache");
         
@@ -72,7 +61,6 @@ public class ConfigurationList extends HttpServlet {
             out.print(config.getProtocol());
             out.println("\"/>");
 
-
         }
 
         out.println("</configs>");