Commit 684a8695 by chenith Committed by Harsh Shah

Updated forgot and reset password functions.

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