You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@rave.apache.org by mf...@apache.org on 2012/02/22 17:05:58 UTC

svn commit: r1292365 [2/2] - in /incubator/rave/trunk: ./ rave-components/rave-commons/src/main/java/org/apache/rave/exception/ rave-components/rave-core/ rave-components/rave-core/src/main/java/org/apache/rave/portal/model/ rave-components/rave-core/s...

Modified: incubator/rave/trunk/rave-portal-resources/src/main/webapp/WEB-INF/applicationContext-security.xml
URL: http://svn.apache.org/viewvc/incubator/rave/trunk/rave-portal-resources/src/main/webapp/WEB-INF/applicationContext-security.xml?rev=1292365&r1=1292364&r2=1292365&view=diff
==============================================================================
--- incubator/rave/trunk/rave-portal-resources/src/main/webapp/WEB-INF/applicationContext-security.xml (original)
+++ incubator/rave/trunk/rave-portal-resources/src/main/webapp/WEB-INF/applicationContext-security.xml Wed Feb 22 16:05:57 2012
@@ -31,8 +31,13 @@
 
     <security:http pattern="/login.jsp*" security="none"/>
     <security:http auto-config="true" use-expressions="true" disable-url-rewriting="true">
+
         <security:intercept-url pattern="/newaccount.jsp*" access="permitAll"/>
         <security:intercept-url pattern="/app/newaccount*" access="permitAll"/>
+        <security:intercept-url pattern="/app/newpassword/**" access="permitAll"/>
+        <security:intercept-url pattern="/app/retrieveusername/**" access="permitAll"/>
+        <security:intercept-url pattern="/app/changepassword/**" access="permitAll"/>
+
         <security:intercept-url pattern="/css/**" access="permitAll"/>
         <security:intercept-url pattern="/images/**" access="permitAll"/>
         <security:intercept-url pattern="/script/**" access="permitAll"/>

Added: incubator/rave/trunk/rave-portal-resources/src/main/webapp/WEB-INF/jsp/views/changepassword.jsp
URL: http://svn.apache.org/viewvc/incubator/rave/trunk/rave-portal-resources/src/main/webapp/WEB-INF/jsp/views/changepassword.jsp?rev=1292365&view=auto
==============================================================================
--- incubator/rave/trunk/rave-portal-resources/src/main/webapp/WEB-INF/jsp/views/changepassword.jsp (added)
+++ incubator/rave/trunk/rave-portal-resources/src/main/webapp/WEB-INF/jsp/views/changepassword.jsp Wed Feb 22 16:05:57 2012
@@ -0,0 +1,60 @@
+<%--
+  ~ Licensed to the Apache Software Foundation (ASF) under one
+  ~ or more contributor license agreements.  See the NOTICE file
+  ~ distributed with this work for additional information
+  ~ regarding copyright ownership.  The ASF licenses this file
+  ~ to you under the Apache License, Version 2.0 (the
+  ~ "License"); you may not use this file except in compliance
+  ~ with the License.  You may obtain a copy of the License at
+  ~
+  ~      http://www.apache.org/licenses/LICENSE-2.0
+  ~
+  ~ Unless required by applicable law or agreed to in writing,
+  ~ software distributed under the License is distributed on an
+  ~ "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+  ~ KIND, either express or implied.  See the License for the
+  ~ specific language governing permissions and limitations
+  ~ under the License.
+  --%>
+
+<%@ page language="java" trimDirectiveWhitespaces="true" %>
+<%@ include file="/WEB-INF/jsp/includes/taglibs.jsp" %>
+<fmt:setBundle basename="messages"/>
+<tiles:insertDefinition name="templates.base">
+
+    <tiles:putAttribute name="pageTitleKey" value="page.changepassword.title"/>
+    <tiles:importAttribute name="pageTitleKey" scope="request"/>
+
+    <tiles:putAttribute name="body">
+        <div id="content">
+            <h1><fmt:message key="page.changepassword.title"/></h1>
+            <form:form commandName="newUser" action="changepassword" method="post">
+                <fieldset>
+                    <p><fmt:message key="form.all.fields.required"/></p>
+                    <form:hidden path="forgotPasswordHash"/>
+                    <p><form:errors cssClass="error"/></p>
+
+                    <p>
+                        <label for="passwordField"><fmt:message key="page.general.password"/></label>
+                        <form:password id="passwordField" path="password" required="required"/>
+                        <form:errors path="password" cssClass="error"/>
+                    </p>
+
+                    <p>
+                        <label for="passwordConfirmField"><fmt:message key="page.general.confirmpassword"/></label>
+                        <form:password id="passwordConfirmField" path="confirmPassword" required="required"/>
+                        <form:errors path="confirmPassword" cssClass="error"/>
+                    </p>
+                </fieldset>
+                <fieldset>
+                    <fmt:message key="page.changepassword.button" var="submitButtonText"/>
+                    <input type="submit" value="${submitButtonText}"/>
+                </fieldset>
+            </form:form>
+        </div>
+    </tiles:putAttribute>
+</tiles:insertDefinition>
+<script src="//ajax.aspnetcdn.com/ajax/jQuery/jquery-1.6.4.min.js"></script>
+<script src="//ajax.aspnetcdn.com/ajax/jquery.validate/1.8.1/jquery.validate.min.js"></script>
+<script src="<spring:url value="/script/rave.js"/>"></script>
+<script src="<spring:url value="/script/rave_forms.js"/>"></script>

Added: incubator/rave/trunk/rave-portal-resources/src/main/webapp/WEB-INF/jsp/views/newpassword.jsp
URL: http://svn.apache.org/viewvc/incubator/rave/trunk/rave-portal-resources/src/main/webapp/WEB-INF/jsp/views/newpassword.jsp?rev=1292365&view=auto
==============================================================================
--- incubator/rave/trunk/rave-portal-resources/src/main/webapp/WEB-INF/jsp/views/newpassword.jsp (added)
+++ incubator/rave/trunk/rave-portal-resources/src/main/webapp/WEB-INF/jsp/views/newpassword.jsp Wed Feb 22 16:05:57 2012
@@ -0,0 +1,72 @@
+<%--
+  ~ Licensed to the Apache Software Foundation (ASF) under one
+  ~ or more contributor license agreements.  See the NOTICE file
+  ~ distributed with this work for additional information
+  ~ regarding copyright ownership.  The ASF licenses this file
+  ~ to you under the Apache License, Version 2.0 (the
+  ~ "License"); you may not use this file except in compliance
+  ~ with the License.  You may obtain a copy of the License at
+  ~
+  ~      http://www.apache.org/licenses/LICENSE-2.0
+  ~
+  ~ Unless required by applicable law or agreed to in writing,
+  ~ software distributed under the License is distributed on an
+  ~ "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+  ~ KIND, either express or implied.  See the License for the
+  ~ specific language governing permissions and limitations
+  ~ under the License.
+  --%>
+
+<%@ page language="java" trimDirectiveWhitespaces="true" %>
+<%@ include file="/WEB-INF/jsp/includes/taglibs.jsp" %>
+<fmt:setBundle basename="messages"/>
+
+<tiles:insertDefinition name="templates.base">
+    <tiles:putAttribute name="pageTitleKey" value="page.newpassword.title"/>
+    <tiles:importAttribute name="pageTitleKey" scope="request"/>
+
+    <tiles:putAttribute name="body">
+        <div id="content">
+            <h1><fmt:message key="page.newpassword.title"/></h1>
+            <c:choose>
+                <c:when test="${success}">
+
+                    <div class="alert-message success">
+                        <fmt:message key="page.newpassword.email.sent">
+                            <fmt:param>${email}</fmt:param>
+                        </fmt:message>
+                    </div>
+                    <a href="/"><fmt:message key="page.newpassword.email.sent.login"/></a>
+                </c:when>
+
+                <c:otherwise>
+
+                    <h2><fmt:message key="page.newpassword.password.title"/></h2>
+                    <form:form commandName="newUser" action="newpassword" method="post">
+                        <fieldset>
+                            <p><fmt:message key="form.all.fields.required"/></p>
+
+                            <p><form:errors cssClass="error"/></p>
+
+                            <p>
+                                <label for="emailField"><fmt:message key="page.general.email"/></label>
+                                <form:input id="emailField" path="email" required="required" autofocus="autofocus"/>
+                                <form:errors path="email" cssClass="error"/>
+                            </p>
+                        </fieldset>
+                        <fieldset>${captchaHtml}</fieldset>
+                        <fieldset>
+                            <fmt:message key="page.login.forgot.password.button" var="submitButtonText"/>
+                            <input type="submit" value="${submitButtonText}"/>
+                        </fieldset>
+                    </form:form>
+                </c:otherwise>
+            </c:choose>
+        </div>
+    </tiles:putAttribute>
+</tiles:insertDefinition>
+<script src="//ajax.aspnetcdn.com/ajax/jQuery/jquery-1.6.4.min.js"></script>
+<script src="//ajax.aspnetcdn.com/ajax/jquery.validate/1.8.1/jquery.validate.min.js"></script>
+<script src="<spring:url value="
+/script/rave.js"/>"></script>
+<script src="<spring:url value="/script/rave_forms.js"/>"></script>

Added: incubator/rave/trunk/rave-portal-resources/src/main/webapp/WEB-INF/jsp/views/retrieveusername.jsp
URL: http://svn.apache.org/viewvc/incubator/rave/trunk/rave-portal-resources/src/main/webapp/WEB-INF/jsp/views/retrieveusername.jsp?rev=1292365&view=auto
==============================================================================
--- incubator/rave/trunk/rave-portal-resources/src/main/webapp/WEB-INF/jsp/views/retrieveusername.jsp (added)
+++ incubator/rave/trunk/rave-portal-resources/src/main/webapp/WEB-INF/jsp/views/retrieveusername.jsp Wed Feb 22 16:05:57 2012
@@ -0,0 +1,71 @@
+<%--
+  ~ Licensed to the Apache Software Foundation (ASF) under one
+  ~ or more contributor license agreements.  See the NOTICE file
+  ~ distributed with this work for additional information
+  ~ regarding copyright ownership.  The ASF licenses this file
+  ~ to you under the Apache License, Version 2.0 (the
+  ~ "License"); you may not use this file except in compliance
+  ~ with the License.  You may obtain a copy of the License at
+  ~
+  ~      http://www.apache.org/licenses/LICENSE-2.0
+  ~
+  ~ Unless required by applicable law or agreed to in writing,
+  ~ software distributed under the License is distributed on an
+  ~ "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+  ~ KIND, either express or implied.  See the License for the
+  ~ specific language governing permissions and limitations
+  ~ under the License.
+  --%>
+<%@ page language="java" trimDirectiveWhitespaces="true" %>
+<%@ include file="/WEB-INF/jsp/includes/taglibs.jsp" %>
+<fmt:setBundle basename="messages"/>
+
+<tiles:insertDefinition name="templates.base">
+    <tiles:putAttribute name="pageTitleKey" value="page.retrieveusername.title"/>
+    <tiles:importAttribute name="pageTitleKey" scope="request"/>
+
+    <tiles:putAttribute name="body">
+        <div id="content">
+            <h1><fmt:message key="page.retrieveusername.title"/></h1>
+            <c:choose>
+                <c:when test="${success}">
+
+                    <div class="alert-message success">
+                        <fmt:message key="page.newpassword.email.sent">
+                            <fmt:param>${email}</fmt:param>
+                        </fmt:message>
+                    </div>
+                    <a href="/"><fmt:message key="page.newpassword.email.sent.login"/></a>
+                </c:when>
+
+                <c:otherwise>
+
+                    <h2><fmt:message key="page.newpassword.username.title"/></h2>
+                    <form:form commandName="newUser" action="retrieveusername" method="post">
+                        <fieldset>
+                            <p><fmt:message key="form.all.fields.required"/></p>
+
+                            <p><form:errors cssClass="error"/></p>
+
+                            <p>
+                                <label for="emailField"><fmt:message key="page.general.email"/></label>
+                                <form:input id="emailField" path="email" required="required" autofocus="autofocus"/>
+                                <form:errors path="email" cssClass="error"/>
+                            </p>
+                        </fieldset>
+                        <fieldset>${captchaHtml}</fieldset>
+                        <fieldset>
+                            <fmt:message key="page.login.forgot.username.button" var="submitButtonText"/>
+                            <input type="submit" value="${submitButtonText}"/>
+                        </fieldset>
+                    </form:form>
+                </c:otherwise>
+            </c:choose>
+        </div>
+    </tiles:putAttribute>
+</tiles:insertDefinition>
+<script src="//ajax.aspnetcdn.com/ajax/jQuery/jquery-1.6.4.min.js"></script>
+<script src="//ajax.aspnetcdn.com/ajax/jquery.validate/1.8.1/jquery.validate.min.js"></script>
+<script src="<spring:url value="
+/script/rave.js"/>"></script>
+<script src="<spring:url value="/script/rave_forms.js"/>"></script>

Added: incubator/rave/trunk/rave-portal-resources/src/main/webapp/WEB-INF/mailtemplates/password_reminder.ftl
URL: http://svn.apache.org/viewvc/incubator/rave/trunk/rave-portal-resources/src/main/webapp/WEB-INF/mailtemplates/password_reminder.ftl?rev=1292365&view=auto
==============================================================================
--- incubator/rave/trunk/rave-portal-resources/src/main/webapp/WEB-INF/mailtemplates/password_reminder.ftl (added)
+++ incubator/rave/trunk/rave-portal-resources/src/main/webapp/WEB-INF/mailtemplates/password_reminder.ftl Wed Feb 22 16:05:57 2012
@@ -0,0 +1,13 @@
+<#-- @ftlvariable name="user" type="org.apache.rave.portal.model.User" -->
+<#-- @ftlvariable name="reminderUrl" type="java.lang.String" -->
+Dear ${user.getUsername()},
+
+We've received a request to update the password associated with your Rave account.
+
+To complete this process, open the following link in your browser:
+
+${reminderUrl}
+
+If you did not request this change, no further action is required.
+
+

Added: incubator/rave/trunk/rave-portal-resources/src/main/webapp/WEB-INF/mailtemplates/username_reminder.ftl
URL: http://svn.apache.org/viewvc/incubator/rave/trunk/rave-portal-resources/src/main/webapp/WEB-INF/mailtemplates/username_reminder.ftl?rev=1292365&view=auto
==============================================================================
--- incubator/rave/trunk/rave-portal-resources/src/main/webapp/WEB-INF/mailtemplates/username_reminder.ftl (added)
+++ incubator/rave/trunk/rave-portal-resources/src/main/webapp/WEB-INF/mailtemplates/username_reminder.ftl Wed Feb 22 16:05:57 2012
@@ -0,0 +1,13 @@
+<#-- @ftlvariable name="user" type="org.apache.rave.portal.model.User" -->
+<#-- @ftlvariable name="reminderUrl" type="java.lang.String" -->
+Dear ${user.getUsername()},
+
+We've received a request to retrieve username associated with your Rave account.
+
+Your username is:   ${user.getUsername()}
+
+
+
+
+
+

Modified: incubator/rave/trunk/rave-portal-resources/src/main/webapp/login.jsp
URL: http://svn.apache.org/viewvc/incubator/rave/trunk/rave-portal-resources/src/main/webapp/login.jsp?rev=1292365&r1=1292364&r2=1292365&view=diff
==============================================================================
--- incubator/rave/trunk/rave-portal-resources/src/main/webapp/login.jsp (original)
+++ incubator/rave/trunk/rave-portal-resources/src/main/webapp/login.jsp Wed Feb 22 16:05:57 2012
@@ -28,6 +28,10 @@
     <tiles:putAttribute name="body">
         <div id="content">
 
+            <c:if test="${not empty message}">
+                <div class="topbar-message">${message}</div>
+            </c:if>
+
             <h1><fmt:message key="${pageTitleKey}"/></h1>
 
             <h2><fmt:message key="page.login.usernamepassword"/></h2>
@@ -54,23 +58,49 @@
                     </p>
                 </fieldset>
                 <fieldset>
-                  <fmt:message key="page.login.usernamepassword.login" var="loginButtonText"/>
+                    <fmt:message key="page.login.usernamepassword.login" var="loginButtonText"/>
                     <input type="submit" value="${loginButtonText}"/>
                 </fieldset>
             </form>
 
+            <h2><fmt:message key="page.login.forgot.password"/></h2>
+
+            <form id="newPassword" action="<c:url value="/app/newpassword"/>" method="get">
+                <fieldset>
+                    <p>
+                        <label for="requestNewPasswordButton"><fmt:message
+                                key="page.login.forgot.password.label"/></label>
+                        <fmt:message key="page.login.forgot.password.button" var="requestNewPasswordButtonText"/>
+                        <input id="requestNewPasswordButton" type="submit" value="${requestNewPasswordButtonText}"/>
+                    </p>
+                </fieldset>
+            </form>
+            <h2><fmt:message key="page.login.forgot.username"/></h2>
+
+            <form id="newPassword" action="<c:url value="/app/retrieveusername"/>" method="get">
+                <fieldset>
+                    <p>
+                        <label for="requestNewUsernameButton"><fmt:message
+                                key="page.login.forgot.username.label"/></label>
+                        <fmt:message key="page.login.forgot.username.button" var="requestNewUsernameButton"/>
+                        <input id="requestNewUsernameButton" type="submit" value="${requestNewUsernameButton}"/>
+                    </p>
+                </fieldset>
+            </form>
             <h2><fmt:message key="page.login.createaccount"/></h2>
+
             <form id="newAccount" action="<c:url value="/app/newaccount.jsp"/>" method="get">
                 <fieldset>
                     <p>
-                      <label for="createNewAccountButton"><fmt:message key="page.login.createaccount.label"/></label>
-                      <fmt:message key="page.login.createaccount.button" var="createAccountButtonText"/>
-                      <input id="createNewAccountButton" type="submit" value="${createAccountButtonText}" />
+                        <label for="createNewAccountButton"><fmt:message key="page.login.createaccount.label"/></label>
+                        <fmt:message key="page.login.createaccount.button" var="createAccountButtonText"/>
+                        <input id="createNewAccountButton" type="submit" value="${createAccountButtonText}"/>
                     </p>
                 </fieldset>
             </form>
 
             <h2><fmt:message key="page.login.openid"/></h2>
+
             <form id="oidForm" name='oidf' action='j_spring_openid_security_check' method='POST'>
                 <c:if test="${param['authfail'] eq 'openid'}">
                     <p class="error"><fmt:message key="page.login.openid.fail"/></p>
@@ -84,16 +114,16 @@
                         <label for="remember_me_openid" class="checkboxLabel">
                             <input type='checkbox' name='_spring_security_remember_me' id="remember_me_openid"
                                    value="true"/>
-                          <fmt:message key="page.login.rememberme"/>
+                            <fmt:message key="page.login.rememberme"/>
                         </label>
                     </p>
                 </fieldset>
                 <fieldset>
-                  <fmt:message key="page.login.openid.button" var="openidButtonText"/>
+                    <fmt:message key="page.login.openid.button" var="openidButtonText"/>
                     <input type="submit" value="${openidButtonText}"/>
                 </fieldset>
 
             </form>
         </div>
     </tiles:putAttribute>
-</tiles:insertDefinition>
\ No newline at end of file
+</tiles:insertDefinition>

Modified: incubator/rave/trunk/rave-portal/pom.xml
URL: http://svn.apache.org/viewvc/incubator/rave/trunk/rave-portal/pom.xml?rev=1292365&r1=1292364&r2=1292365&view=diff
==============================================================================
--- incubator/rave/trunk/rave-portal/pom.xml (original)
+++ incubator/rave/trunk/rave-portal/pom.xml Wed Feb 22 16:05:57 2012
@@ -88,6 +88,12 @@
             <scope>runtime</scope>
         </dependency>
 
+        <!-- mail-->
+        <dependency>
+            <groupId>javax.mail</groupId>
+            <artifactId>mail</artifactId>
+        </dependency>
+
         <!-- Test -->
         <dependency>
             <groupId>junit</groupId>
@@ -182,6 +188,18 @@
                                 <shindig.contextroot />
                             -->
                         </systemProperties>
+                        <dependencies>
+                            <dependency>
+                                <groupId>javax.mail</groupId>
+                                <artifactId>mail</artifactId>
+                                <classpath>shared</classpath>
+                            </dependency>
+                            <dependency>
+                                <groupId>javax.activation</groupId>
+                                <artifactId>activation</artifactId>
+                                <classpath>shared</classpath>
+                            </dependency>
+                        </dependencies>
                     </container>
                 </configuration>
             </plugin>

Modified: incubator/rave/trunk/rave-portal/src/main/dist/NOTICE
URL: http://svn.apache.org/viewvc/incubator/rave/trunk/rave-portal/src/main/dist/NOTICE?rev=1292365&r1=1292364&r2=1292365&view=diff
==============================================================================
--- incubator/rave/trunk/rave-portal/src/main/dist/NOTICE (original)
+++ incubator/rave/trunk/rave-portal/src/main/dist/NOTICE Wed Feb 22 16:05:57 2012
@@ -99,4 +99,8 @@ attributions:
    to the University of Michigan at Ann Arbor.  The name of the
    University may not be used to endorse or promote products derived
    from this software without specific prior written permission.  This
-   software is provided ``as is'' without express or implied warranty.
\ No newline at end of file
+   software is provided ``as is'' without express or implied warranty.
+   
+This product includes unmodified, binary redistributions of software (freemarker) developed by the Visigoth Software Society
+project (http://freemarker.sourceforge.net/), which is under the  BSD-style license.
+   
\ No newline at end of file

Modified: incubator/rave/trunk/rave-portal/src/test/resources/portal.properties
URL: http://svn.apache.org/viewvc/incubator/rave/trunk/rave-portal/src/test/resources/portal.properties?rev=1292365&r1=1292364&r2=1292365&view=diff
==============================================================================
--- incubator/rave/trunk/rave-portal/src/test/resources/portal.properties (original)
+++ incubator/rave/trunk/rave-portal/src/test/resources/portal.properties Wed Feb 22 16:05:57 2012
@@ -56,4 +56,19 @@ portal.captcha.enabled=false
 portal.captcha.key.private=
 portal.captcha.key.public=
 portal.captcha.usenoscript=false
-portal.captcha.invalid.configuration=<label class="error">ReCaptcha service is not properly configured.</label>
\ No newline at end of file
+portal.captcha.invalid.configuration=<label class="error">ReCaptcha service is not properly configured.</label>
+
+#mail settings
+portal.mail.sender=
+portal.mail.replyto=
+portal.mail.host=
+portal.mail.password=
+portal.mail.username=
+portal.mail.protocol=smtp
+portal.mail.port=25
+portal.mail.username.subject=Rave username reminder service
+portal.mail.username.template=username_reminder.ftl
+portal.mail.passwordservice.subject=Rave password reminder service
+portal.mail.passwordservice.template=password_reminder.ftl
+portal.mail.passwordservice.valid.minutes=30
+portal.mail.service.baseurl=http://localhost:8080/portal/app/changepassword/
\ No newline at end of file