NIHVIVO-2299 NIHVIVO-2279 Merge from the dev branch - replace User with UserAccounts, implement the root user policy.

This commit is contained in:
j2blake 2011-06-09 14:43:02 +00:00
parent c9ac5a7e1f
commit 589e2b4fd6
7 changed files with 51 additions and 145 deletions

View file

@ -412,19 +412,36 @@
</tr>
<tr>
<td colspan="2">
Specify an SMTP host that the form will use for
Specify an SMTP host that the application will use for
sending e-mail (Optional). If this is left blank, the contact form will
be hidden and disabled.
be hidden and disabled, and users will not be notified of changes to their accounts.
</td>
</tr>
<tr class="odd_row">
<td>
Vitro.smtpHost
email.smtpHost
</td>
<td>
smtp.servername.edu
</td>
</tr>
<tr>
<td colspan="2">
Specify an email address which will appear as the sender in e-mail
notifications to users (Optional).
If a user replies to the notification, this address will receive the reply.
If a user's e-mail address is invalid, this address will receive the error notice.
If this is left blank, users will not be notified of changes to their accounts.
</td>
</tr>
<tr class="odd_row">
<td>
email.replyTo
</td>
<td>
vivoAdmin@my.domain.edu
</td>
</tr>
<tr>
<td colspan="2">
Specify the JDBC URL of your database. Change
@ -564,18 +581,18 @@
</tr>
<tr>
<td colspan="2">
Specify the name of your first admin user for
Specify the email address of the root user account for
the VIVO application. This user will have an initial temporary password
of 'defaultAdmin'. You will be prompted to create a new password on
of 'rootPassword'. You will be prompted to create a new password on
first login.
</td>
</tr>
<tr class="odd_row">
<td>
initialAdminUser
rootUser.emailAddress
</td>
<td>
defaultAdmin
vivoAdmin@my.domain.edu
</td>
</tr>
<tr>
@ -711,9 +728,9 @@
<p>
If the startup was successful, you will see a welcome message
informing you that you have successfully installed VIVO. Click the "Log
in" link near the upper right corner. Log in with the <code>initialAdminUser</code>
username you set up in Step IV. The initial password for the <code>initialAdminUser</code>
account is "defaultAdmin" (without the quotes). On first login, you
in" link near the upper right corner. Log in with the <code>rootUser.emailAddress</code>
you set up in Step IV. The initial password for the root
account is "rootPassword" (without the quotes). On first login, you
will be prompted to select a new password and verify it a second time.
</p>
<p>
@ -745,7 +762,7 @@
"Contact Us" form)</h3>
<p>
If you have configured your application to use the "Contact Us"
feature in Step IV (<code>Vitro.smtpHost</code>), you will also need to
feature in Step IV (<code>email.smtpHost</code>), you will also need to
add an email address to the VIVO application.&nbsp; This is the email
to which the contact form will submit. It can be a list server or an
individual's email address.
@ -758,7 +775,7 @@
Email Address" and submit the change.
</p>
<p>
If you set the <code>Vitro.smtpHost</code>
If you set the <code>email.smtpHost</code>
in Step IV and do NOT
provide an email address in this step, your users will receive a java
error in the interface.
@ -945,7 +962,9 @@
In addition, VIVO will try to associate the user with a profile
page, so the user may edit his own profile data. VIVO will search the
data model for a person with a property that matches the Users network
ID. You need to tell VIVO what property should be used for matching.
ID
(the value of the property must be either a String literal or an untyped literal).
You need to tell VIVO what property should be used for matching.
Insert a line like this in the deploy.properties file:
</p>
<pre>selfEditing.idMatchingProperty = [the URI of the property]</pre>
@ -997,8 +1016,8 @@
<ul>
<li>
Point your browser to the home page of your website, and click
the "Log in" link near the upper right corner. Log in with the <code>initialAdminUser</code>
username you set up in Step IV. If this is your first time logging in,
the "Log in" link near the upper right corner. Log in with the <code>rootUser.emailAddress</code>
you set up in Step IV. If this is your first time logging in,
you will be prompted to change the password.
</li>
<li>

View file

@ -67,6 +67,12 @@
<li>This and other changes are documented in vitro/doc/list_view_configuration_guidelines.txt.</li>
</ul>
<h3>Changes to Authorization [see JB for further details]</h3>
<ul>
<li>selfEditing.idMatchingProperty will now match String literals as well as untyped literals.</li>
<li>'initialAdminUser' property is replaced by 'rootUser.emailAddress' - initial password is 'rootPassword'
</ul>
</div> <!-- #wrapper-content -->
<div id="footer" role="contentinfo">

View file

@ -91,11 +91,11 @@ VitroConnection.DataSource.driver = com.mysql.jdbc.Driver
VitroConnection.DataSource.validationQuery = SELECT 1
#
# The name of your first admin user for the VIVO application. The password
# for this user is initially set to "defaultAdmin", but you will be asked to
# The email address of the root user for the VIVO application. The password
# for this user is initially set to "rootPassword", but you will be asked to
# change the password the first time you log in.
#
initialAdminUser = defaultAdmin
rootUser.emailAddress = root@myDomain.com
#
# How is a logged-in user associated with a particular Individual? One way is

View file

@ -110,11 +110,11 @@
</listener>
<!-- Update to the new UserAccounts model (1.3). Needs to run after JenaDataSourceSetup. -->
<!-- <listener>
<listener>
<listener-class>
edu.cornell.mannlib.vitro.webapp.servlet.setup.UpdateUserAccounts
</listener-class>
</listener> -->
</listener>
<!-- The following two listeners remain temporarily until SDB becomes the default triple store -->
@ -158,6 +158,10 @@
</listener-class>
</listener>
<listener>
<listener-class> edu.cornell.mannlib.vitro.webapp.auth.policy.RootUserPolicy$Setup</listener-class>
</listener>
<listener>
<listener-class> edu.cornell.mannlib.vitro.webapp.auth.policy.specialrelationships.SelfEditorRelationshipPolicy$Setup
</listener-class>
@ -668,15 +672,6 @@
<url-pattern>/keywordEdit</url-pattern>
</servlet-mapping>
<servlet>
<servlet-name>UserEditController</servlet-name>
<servlet-class>edu.cornell.mannlib.vitro.webapp.controller.edit.UserEditController</servlet-class>
</servlet>
<servlet-mapping>
<servlet-name>UserEditController</servlet-name>
<url-pattern>/userEdit</url-pattern>
</servlet-mapping>
<servlet>
<servlet-name>OntologyEditController</servlet-name>
<servlet-class>edu.cornell.mannlib.vitro.webapp.controller.edit.OntologyEditController</servlet-class>
@ -776,16 +771,6 @@
<url-pattern>/addRestriction</url-pattern>
</servlet-mapping>
<!-- TODO This should go away as soon as the new UserAccounts are fully implemented. jblake -->
<servlet>
<servlet-name>UsersListingController</servlet-name>
<servlet-class>edu.cornell.mannlib.vitro.webapp.controller.edit.listing.UsersListingController</servlet-class>
</servlet>
<servlet-mapping>
<servlet-name>UsersListingController</servlet-name>
<url-pattern>/listUsers</url-pattern>
</servlet-mapping>
<servlet>
<servlet-name>AccountsAdmin</servlet-name>
<servlet-class>edu.cornell.mannlib.vitro.webapp.controller.accounts.admin.UserAccountsAdminController</servlet-class>

View file

@ -1,98 +0,0 @@
<?xml version="1.0" encoding="UTF-8"?>
<!-- $This file is distributed under the terms of the license in /doc/license.txt$ -->
<jsp:root xmlns:jsp="http://java.sun.com/JSP/Page" xmlns:c="http://java.sun.com/jsp/jstl/core" version="2.0">
<jsp:directive.page import="edu.cornell.mannlib.vitro.webapp.dao.VitroVocabulary"/>
<jsp:directive.page import="edu.cornell.mannlib.vitro.webapp.beans.User"/>
<div class="editingForm">
<jsp:include page="/templates/edit/fetch/vertical.jsp"/>
<div align="center">
<table class="form-background" border="0" cellpadding="2" cellspacing="2">
<tr align="center">
<td valign="bottom">
<form action="listUsers" method="get">
<input type="hidden" name="home" value="${portalBean.portalId}" />
<input type="submit" class="form-button" value="See All User Accounts"/>
</form>
</td>
<td valign="bottom" align="center">
<form action="editForm" method="get">
<input name="home" type="hidden" value="${portalBean.portalId}" />
<input name="uri" type = "hidden" value="${user.URI}" />
<input type="submit" class="form-button" value="Edit User Account"/>
<input type="hidden" name="controller" value="User"/>
</form>
<form action="editForm" method="get">
<input name="home" type="hidden" value="${portalBean.portalId}" />
<input name="uri" type = "hidden" value="${user.URI}" />
<input name="Md5password" type="hidden" value=""/>
<input name="OldPassword" type="hidden" value=""/>
<input type="submit" class="form-button" value="Reset Password"/>
<input type="hidden" name="controller" value="User"/>
</form>
</td>
<td valign="bottom">
<form action="editForm" method="get">
<input name="home" type="hidden" value="${portalBean.portalId}" />
<input type="hidden" name="controller" value="User"/>
<input type="submit" class="form-button" value="Add New User Account"/>
</form>
</td>
</tr>
</table>
<!-- Commenting out account association (to an individual of class foaf:Person) feature to reduce confusion in release 1.1
<c:if test="true">
<h3 class="associate">Associate user account with a person</h3>
<table class="form-background" border="0" cellpadding="2" cellspacing="2">
<c:if test="${requestScope.mayEditAsStmts != null }">
<c:forEach items="${requestScope.mayEditAsStmts }" var="stmt">
<c:url var="deleteUrl" value="/edit/editRequestDispatch.jsp">
<c:param name="subjectUri">${user.URI}</c:param>
<c:param name="predicateUri">${stmt.propertyURI}</c:param>
<c:param name="objectUri">${stmt.objectURI}</c:param>
<c:param name="editform">admin/mayEditAs.jsp</c:param>
</c:url>
<tr>
<td>
<c:if test="${stmt.object == null or empty stmt.object.name }">
<c:set var="associatedIndividual" value="${stmt.objectURI}" />
</c:if>
<c:if test="${stmt.object != null and !empty stmt.object.name }">
<c:set var="associatedIndividual" value="${stmt.object.name}" />
</c:if>
${associatedIndividual} - <a href="${deleteUrl}">Change or Remove Association</a>
</td>
</tr>
</c:forEach>
<tr><td><em class="note">Note: <c:if test="${requestScope.user.roleURI == 1 }">This association allows the user to edit this person and be redirected to the person's profile when logging in.</c:if><c:if test="${requestScope.user.roleURI != 1 }">This association will result in the user being redirected to the person's profile when logging in.</c:if></em></td></tr>
</c:if>
<c:if test="${requestScope.mayEditAsStmts == null }">
<tr>
<td>
<c:url var="addUrl" value="/edit/editRequestDispatch.jsp">
<c:param name="subjectUri">${user.URI}</c:param>
<c:param name="editform">admin/mayEditAs.jsp</c:param>
</c:url>
This user account is not associated with a person - <a href="${addUrl}">Select a person</a>
</td>
</tr>
<tr>
<td><em class="note">Note: <c:if test="${requestScope.user.roleURI == 1 }">Until an association is made, the self editor has no permissions to edit. Associating this user account to a person allows the user to edit this person and be redirected to the person's profile when logging in.</c:if><c:if test="${requestScope.user.roleURI != 1 }">Associating this user account to a person will result in the user being redirected to the person's profile when logging in.</c:if></em></td>
</tr>
</c:if>
</table>
</c:if>
-->
</div>
</div>
</jsp:root>

View file

@ -18,13 +18,8 @@
</#if>
</#if>
<#-- TODO This goes away when the UserAccounts are fully implemented - jblake -->
<#if siteConfig.urls.users??>
<li><a href="${siteConfig.urls.users}">User accounts</a></li>
</#if>
<#if siteConfig.urls.userList??>
<li><a href="${siteConfig.urls.userList}">Manage user accounts</a> (work in progress)</li>
<li><a href="${siteConfig.urls.userList}">User accounts</a></li>
</#if>
</ul>

View file

@ -19,8 +19,7 @@
<li id="user-menu"><a href="#">${user.loginName}</a>
<ul class="sub_menu">
<li role="listitem" class="inactive">My profile</li>
<li role="listitem" class="inactive">My account</li>
<#-- <li role="listitem"><a href="${urls.myAccount}">My account</a></li> -->
<li role="listitem"><a href="${urls.myAccount}">My account</a></li>
<li role="listitem"><a href="${urls.logout}">Log out</a></li>
</ul>
</li>