Commit 684a8695 by chenith Committed by Harsh Shah

Updated forgot and reset password functions.

parent 23fb5e89
...@@ -11,7 +11,6 @@ import oneit.objstore.ObjectTransaction; ...@@ -11,7 +11,6 @@ import oneit.objstore.ObjectTransaction;
import oneit.objstore.StorageException; import oneit.objstore.StorageException;
import oneit.objstore.rdbms.filters.EqualsFilter; import oneit.objstore.rdbms.filters.EqualsFilter;
import oneit.security.SecUser; import oneit.security.SecUser;
import oneit.security.SecUserExtension;
import oneit.servlets.forms.*; import oneit.servlets.forms.*;
import oneit.servlets.process.*; import oneit.servlets.process.*;
import oneit.utils.*; import oneit.utils.*;
...@@ -38,6 +37,9 @@ public class ForgotPasswordFP extends SaveFP ...@@ -38,6 +37,9 @@ public class ForgotPasswordFP extends SaveFP
Debug.assertion(email != null, "Email not avaialble"); Debug.assertion(email != null, "Email not avaialble");
email = StringUtils.trim(email);
LogMgr.log(LOG, LogLevel.PROCESSING1, "Started to send pasword reset link email.", email); LogMgr.log(LOG, LogLevel.PROCESSING1, "Started to send pasword reset link email.", email);
SecUser secUser = SecUser.searchNAME (process.getTransaction(), email); SecUser secUser = SecUser.searchNAME (process.getTransaction(), email);
...@@ -81,8 +83,6 @@ public class ForgotPasswordFP extends SaveFP ...@@ -81,8 +83,6 @@ public class ForgotPasswordFP extends SaveFP
ObjectTransform transform = new StringUtils.NullToBlankPostTransform(new ErrorTransform(compoundTransform)); ObjectTransform transform = new StringUtils.NullToBlankPostTransform(new ErrorTransform(compoundTransform));
try try
{ {
resetCodeEmailer.sendMail(transform, new String[] { email }); resetCodeEmailer.sendMail(transform, new String[] { email });
......
...@@ -26,7 +26,7 @@ ...@@ -26,7 +26,7 @@
function validate() { function validate() {
var empty = false; var empty = false;
$('input[required]').each(function() { $('input[required]').each(function() {
if ($( this ).val() == '') { if ( $.trim($( this ).val()) == '') {
empty = true; empty = true;
if ($( this ).css('background-color') == 'rgb(250, 255, 189)') { if ($( this ).css('background-color') == 'rgb(250, 255, 189)') {
empty = false; empty = false;
......
...@@ -34,12 +34,12 @@ ...@@ -34,12 +34,12 @@
{ {
user = adminUser.getUser(); user = adminUser.getUser();
if(StringUtils.subBlanks(forgotpasswordCode) != null) // if(StringUtils.subBlanks(forgotpasswordCode) != null)
{ // {
RandomStringGen random = new RandomStringGen(); // RandomStringGen random = new RandomStringGen();
//
user.setAttribute("md5:Password", random.generateAlphaNum(8)); // user.setAttribute("md5:Password", random.generateAlphaNum(8));
} // }
process.setAttribute("SecUser", user); process.setAttribute("SecUser", user);
} }
...@@ -66,7 +66,7 @@ ...@@ -66,7 +66,7 @@
function validate() { function validate() {
var empty = false; var empty = false;
$('.password-field').each(function() { $('.password-field').each(function() {
if ($( this ).val() == '') { if ( $.trim($( this ).val()) == '') {
empty = true; empty = true;
} }
}); });
...@@ -111,7 +111,7 @@ ...@@ -111,7 +111,7 @@
<label>Confirm Password *</label> <label>Confirm Password *</label>
<oneit:input type="password" name="<%= key + 2 %>" class="form-control password-field"/> <oneit:input type="password" name="<%= key + 2 %>" class="form-control password-field"/>
</div> <!-- form-group --> </div> <!-- form-group -->
<div class="col-sm-12" style="text-align: right"> <div class="col-sm-12">
<oneit:button value="Set New Password" name="resetPassword" cssClass="box-btn reset-btn" <oneit:button value="Set New Password" name="resetPassword" cssClass="box-btn reset-btn"
requestAttribs="<%= CollectionUtils.mapEntry("nextPage", nextPage).toMap() %>"/> requestAttribs="<%= CollectionUtils.mapEntry("nextPage", nextPage).toMap() %>"/>
</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