Hello,
I have some comments on the UpdatePasswordWidget class (github trunk),
which i reflect in the diff at the end of the mail.
There are two minor changes i had to make:
- the first one is a null pointer check for the authModel_. It can be null
in some cases, like when called from "createUpdatePasswordView" with email
validation disabled (or something like this). This problem crashes the
server when the user clicks on the link provided in the email to change the
password.
- the second one freezes the server when the user fills the form to change
the password and clicks the "Ok" button. In the similar case where email
validation is disabled, the from didn't validate all the fields and it
wasn't doing anything on Ok pressed.
I am pretty sure about the first change, but no so much about the second
one. Like this it "works for me"(tm).
Jordi
diff --git a/src/Wt/Auth/UpdatePasswordWidget.C
b/src/Wt/Auth/UpdatePasswordWidg
index ca2d7de..ecd8c55 100644
--- a/src/Wt/Auth/UpdatePasswordWidget.C
+++ b/src/Wt/Auth/UpdatePasswordWidget.C
@@ -30,7 +30,7 @@ UpdatePasswordWidget::UpdatePasswordWidget(const User&
user,
user.identity(Identity::LoginName));
registrationModel_->setReadOnly(RegistrationModel::LoginNameField, true);
- if (authModel_->baseAuth()->emailVerificationEnabled()) {
+ if ( authModel_ && authModel_->baseAuth()->emailVerificationEnabled()) {
/*
* This is set in the model so that the password checker can take
* into account whether the password is derived from the email
@@ -140,6 +140,8 @@ bool UpdatePasswordWidget::validate()
checkPassword();
checkPassword2();
+ registrationModel_->validateField(RegistrationModel::EmailField);
+
if (!registrationModel_->valid())
valid = false;
------------------------------------------------------------------------------
Live Security Virtual Conference
Exclusive live event will cover all the ways today's security and
threat landscape has changed and how IT managers can respond. Discussions
will include endpoint security, mobile security and the latest in malware
threats. http://www.accelacomm.com/jaw/sfrnl04242012/114/50122263/
_______________________________________________
witty-interest mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/witty-interest