Commit ff06a6bf authored by toaster's avatar toaster
Browse files

added auth.management

git-svn-id: https://subversion.umiacs.umd.edu/ace/trunk@18 f1b3a171-7291-4a19-a512-95ad0ad9394a
parent 157126ac
...@@ -28,7 +28,6 @@ ...@@ -28,7 +28,6 @@
* Maryland Institute for Advanced Computer Study. * Maryland Institute for Advanced Computer Study.
*/ */
// $Id$ // $Id$
package edu.umiacs.ace.monitor.users; package edu.umiacs.ace.monitor.users;
import edu.umiacs.ace.util.PersistUtil; import edu.umiacs.ace.util.PersistUtil;
...@@ -53,6 +52,10 @@ public class DefaultAccountContextListener implements ServletContextListener { ...@@ -53,6 +52,10 @@ public class DefaultAccountContextListener implements ServletContextListener {
*/ */
@Override @Override
public void contextInitialized( ServletContextEvent arg0 ) { public void contextInitialized( ServletContextEvent arg0 ) {
arg0.getServletContext().setAttribute("authmanagement", Boolean.valueOf(arg0.getServletContext().getInitParameter("auth.management")));
if ( Boolean.valueOf(arg0.getServletContext().getInitParameter("auth.management")) ) {
try { try {
// LOG.trace("Testing for account setup"); // LOG.trace("Testing for account setup");
EntityManager em = PersistUtil.getEntityManager(); EntityManager em = PersistUtil.getEntityManager();
...@@ -155,7 +158,7 @@ public class DefaultAccountContextListener implements ServletContextListener { ...@@ -155,7 +158,7 @@ public class DefaultAccountContextListener implements ServletContextListener {
LOG.error("Error creating default account", e); LOG.error("Error creating default account", e);
} }
}
} }
@Override @Override
......
...@@ -28,7 +28,6 @@ ...@@ -28,7 +28,6 @@
* Maryland Institute for Advanced Computer Study. * Maryland Institute for Advanced Computer Study.
*/ */
// $Id$ // $Id$
package edu.umiacs.ace.monitor.users; package edu.umiacs.ace.monitor.users;
import edu.umiacs.ace.util.EntityManagerServlet; import edu.umiacs.ace.util.EntityManagerServlet;
...@@ -79,6 +78,9 @@ public class UsersServlet extends EntityManagerServlet { ...@@ -79,6 +78,9 @@ public class UsersServlet extends EntityManagerServlet {
Users user = null; Users user = null;
String error = null; String error = null;
boolean refresh = false; boolean refresh = false;
if ( !Boolean.valueOf(getServletContext().getInitParameter("auth.management")) ) {
return;
}
String paramPass = request.getParameter(PARAM_PASSWORD); String paramPass = request.getParameter(PARAM_PASSWORD);
......
...@@ -4,7 +4,7 @@ ...@@ -4,7 +4,7 @@
prefix="aceam." suffix=".log" timestamp="true"/> prefix="aceam." suffix=".log" timestamp="true"/>
<!-- Configuration for authentication. This information should not need to be <!-- Configuration for authentication. This information should not need to be
changed at all. --> changed at all unless you have your own authentication provider-->
<Realm className="org.apache.catalina.realm.DataSourceRealm" <Realm className="org.apache.catalina.realm.DataSourceRealm"
dataSourceName="jdbc/aceamdb" debug="99" localDataSource="true" dataSourceName="jdbc/aceamdb" debug="99" localDataSource="true"
roleNameCol="rolename" userCredCol="password" userNameCol="username" roleNameCol="rolename" userCredCol="password" userNameCol="username"
...@@ -50,6 +50,12 @@ ...@@ -50,6 +50,12 @@
probably not be changed --> probably not be changed -->
<Parameter name="ims" value="ims.umiacs.umd.edu"/> <Parameter name="ims" value="ims.umiacs.umd.edu"/>
<!-- Set this to true to disable internal user management. This should only be used
in conjunction with changes to the Authentication realm listed above.
Default: true;
-->
<Parameter name="auth.management" value="true"/>
<!-- log4j logging properties --> <!-- log4j logging properties -->
<!-- change the A1.File value to a location of your logfile --> <!-- change the A1.File value to a location of your logfile -->
<Parameter name="log4j.appender.A1.File" value="/tmp/aceam.log"/> <Parameter name="log4j.appender.A1.File" value="/tmp/aceam.log"/>
......
...@@ -5,12 +5,11 @@ The taglib directive below imports the JSTL library. If you uncomment it, ...@@ -5,12 +5,11 @@ The taglib directive below imports the JSTL library. If you uncomment it,
you must also add the JSTL library to the project. The Add Library... action you must also add the JSTL library to the project. The Add Library... action
on Libraries node in Projects view can be used to add the JSTL 1.1 library. on Libraries node in Projects view can be used to add the JSTL 1.1 library.
--%> --%>
<%--
<%@taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c"%> <%@taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c"%>
--%>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
"http://www.w3.org/TR/html4/loose.dtd"> "http://www.w3.org/TR/html4/loose.dtd">
<div class="menuheader"> <div class="menuheader">
<table> <table>
...@@ -25,11 +24,15 @@ on Libraries node in Projects view can be used to add the JSTL 1.1 library. ...@@ -25,11 +24,15 @@ on Libraries node in Projects view can be used to add the JSTL 1.1 library.
<a href="EventLog?clear=1">Event Log</a> <a href="EventLog?clear=1">Event Log</a>
</div> </div>
</td> </td>
<td align="center"> <td align="center">
<div class="menucell"> <div class="menucell">
<c:if test="${authmanagement}">
<a href="Users">Accounts</a><BR> <a href="Users">Accounts</a><BR>
</c:if>
</div> </div>
</td> </td>
</tr> </tr>
</table> </table>
</div> </div>
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment