public class ForgotPasswordHandler extends ProfileForm
ProfileForm.ProfileFormHashtableWrapper
Modifier and Type | Field and Description |
---|---|
static java.lang.String |
CLASS_VERSION
Class version string
|
protected java.lang.Boolean |
mEmptySite
If there is no site, set to true.
|
protected static java.lang.String |
MSG_ERR_SENDING_EMAIL |
protected static java.lang.String |
MSG_NO_SUCH_PROFILE |
protected java.lang.String |
mSiteId
The Site id for the form.
|
CONFIRMPASSWORD_PARAM, DEFAULT_CREATE_PROFILE_TYPE, DEFAULT_LOGIN_PROFILE_TYPE, DEFAULT_LOGOUT_PROFILE_TYPE, HANDLE_CREATE, HANDLE_CREATE_PARAM, HANDLE_FAILURE, HANDLE_LOGIN, HANDLE_LOGIN_PARAM, HANDLE_SUCCESS, ID_NAME, mAuthenticationMessageTrigger, mBadPasswordDelay, mChangePasswordErrorURL, mChangePasswordSuccessURL, mCheckForRequiredParameters, mCheckForRequiredProperties, mCheckForRequiredPropertiesAfterUpdate, mCompareValueInCopyPropertiesOnLogin, mConfirmOldPassword, mConfirmPassword, mCreateErrorURL, mCreateProfileType, mCreateSuccessURL, mDeleteErrorURL, mDeleteSuccessURL, mExpireSessionOnLogout, mExtractDefaultValuesFromProfile, mLoginErrorURL, mLoginProfileType, mLoginSuccessURL, mLogoutErrorURL, mLogoutProfileType, mLogoutSuccessURL, mProfileTools, mPropertiesToAddOnLogin, mPropertiesToCopyOnLogin, mRepositoryId, MSG_ERR_CREATING_PROFILE, MSG_ERR_DELETING_PROFILE, MSG_ERR_UPDATING_PROFILE, MSG_ILLEGAL_ARGUMENT, MSG_INVALID_ADD_PROPERTY, MSG_INVALID_LOGIN, MSG_INVALID_PASSWORD, MSG_MISSING_LOGIN, MSG_MISSING_OLD_PASSWORD, MSG_MISSING_PASSWORD, MSG_MISSING_PROFILE, MSG_MISSING_PROFILE_TOOLS, MSG_MISSING_REQUIRED_PROPERTY, MSG_NO_SUCH_PROFILE_PROPERTY, MSG_NO_TYPE_CONVERTER, MSG_PASSWORD_SAME_AS_OLD_PASSWORD, MSG_PASSWORDS_DO_NOT_MATCH, MSG_PERMISSION_DEFINED_PASSWORD_CHANGE, MSG_READ_ONLY_PROFILE_PROPERTY, MSG_TYPE_CONVERSION_ERR, MSG_USER_ALREADY_EXISTS, MSG_WARNING_PROFILE_TOOLS, mSwapEventListeners, mTrimProperties, mUpdateErrorURL, mUpdateSuccessURL, mUserLoginManager, mUsingLdapProfile, mValue, NULL_SENTINEL, OLDPASSWORD_PARAM, PROXY_FACTORY_PATH, REPOSITORY_ID_PROPERTY_NAME, RESOURCE_BUNDLE_NAME, sResourceBundle, STATUS_ERROR_REDIRECT, STATUS_ERROR_STAY, STATUS_SUCCESS
PARAM_DEFER_FORWARD_OR_REDIRECT, PARAM_USE_FORWARDS
SERVICE_INFO_KEY
DEFAULT_LOG_TRACE_STATUS
DEFAULT_LOG_DEBUG_STATUS, DEFAULT_LOG_ERROR_STATUS, DEFAULT_LOG_INFO_STATUS, DEFAULT_LOG_WARNING_STATUS
Constructor and Description |
---|
ForgotPasswordHandler() |
Modifier and Type | Method and Description |
---|---|
protected java.util.Map |
generateNewPasswordTemplateParams(DynamoHttpServletRequest pRequest,
DynamoHttpServletResponse pResponse,
RepositoryItem pProfile,
java.lang.String pNewPassword)
Generates the parameters map that's used to send the new password email.
|
java.lang.Boolean |
getEmptySite()
Site id
|
java.lang.String |
getForgotPasswordErrorURL() |
java.lang.String |
getForgotPasswordSuccessURL() |
java.lang.String |
getNewPasswordParam() |
java.lang.String |
getSiteId()
Site id
|
TemplateEmailInfoImpl |
getTemplateEmailInfo() |
TemplateEmailSender |
getTemplateEmailSender() |
boolean |
handleForgotPassword(DynamoHttpServletRequest pRequest,
DynamoHttpServletResponse pResponse)
Takes a login or email property and, if there were no errors
in submitting the form, finds the profile associated, generates
a new password, updates the profile, and sends an email
to the user.
|
boolean |
isPersistEmails()
Returns boolean indicating whether the email is persisted before it is sent.
|
boolean |
isSendEmailInSeparateThread()
Returns boolean indicating whether the email is sent in a separate thread.
|
MutableRepositoryItem[] |
lookupUsers(java.lang.String login,
java.lang.String email)
Lookup an array of users from the given login or email.
|
protected void |
postForgotPassword(DynamoHttpServletRequest pRequest,
DynamoHttpServletResponse pResponse)
Operation called just after the forgot password logic is executed
|
protected void |
preForgotPassword(DynamoHttpServletRequest pRequest,
DynamoHttpServletResponse pResponse)
Operation called just before the forgot password logic is executed
|
void |
setEmptySite(java.lang.Boolean pEmptySite)
Set the EmptySite
|
void |
setForgotPasswordErrorURL(java.lang.String pForgotPasswordErrorURL)
Sets the property ForgotPasswordErrorURL.
|
void |
setForgotPasswordSuccessURL(java.lang.String pForgotPasswordSuccessURL)
Sets the property ForgotPasswordSuccessURL.
|
void |
setNewPasswordParam(java.lang.String pNewPasswordParam)
Sets the property NewPasswordParam
|
void |
setPersistEmails(boolean pPersistEmails)
Sets boolean indicating whether the email is persisted before it is sent.
|
void |
setSendEmailInSeparateThread(boolean pSendEmailInSeparateThread)
Sets boolean indicating whether the email is sent in a separate thread.
|
void |
setSiteId(java.lang.String pSiteId)
Set the Site ID
|
void |
setTemplateEmailInfo(TemplateEmailInfoImpl pTemplateEmailInfo)
Sets the property TemplateEmailInfo
|
void |
setTemplateEmailSender(TemplateEmailSender pTemplateEmailSender)
Sets the property TemplateEmailSender
|
addMulti, addPropertiesOnLogin, addProperty, addSwapEventListener, addUser, changePassword, checkFormError, checkFormSuccess, checkForRequiredParameters, checkForRequiredProperties, checkForRequiredProperties, commitTransaction, copyPropertiesOnLogin, copyProperty, copyPropertyValue, createProfileItem, createUser, doStartService, ensureTransaction, findUser, findUser, formatUserMessage, formatUserMessage, formatUserMessage, formatUserMessage, generatePropertyPath, getAddMultiPropertyName, getAddMultiPropertyValue, getAuthenticationMessageTrigger, getBadPasswordDelay, getChangePasswordErrorURL, getChangePasswordSuccessURL, getCheckForRequiredParameters, getCheckForRequiredProperties, getCheckForRequiredPropertiesAfterUpdate, getCreateErrorURL, getCreateProfileType, getCreateSuccessURL, getCurrentDataSource, getDeleteErrorURL, getDeleteSuccessURL, getDescriptor, getExpireSessionOnLogout, getLoginErrorURL, getLoginProfileType, getLoginSuccessURL, getLogoutErrorURL, getLogoutProfileType, getLogoutSuccessURL, getProcessPropertyNames, getProfile, getProfileItem, getProfileRealmManager, getProfileTools, getPropertiesToAddOnLogin, getPropertiesToCopyOnLogin, getRealmSessionTracker, getRepositoryId, getStringValueProperty, getTransactionDemarcation, getTransactionManager, getTrimProperties, getUpdateErrorURL, getUpdateSuccessURL, getUserLocale, getUserLoginManager, getValue, getValueFromArrayString, getValueFromObject, getValueFromObjectArray, getValueFromString, getValueFromStringArray, getValueMap, getValueProperty, handleAddMulti, handleChangePassword, handleCreate, handleDelete, handleLogin, handleLogout, handleUpdate, handleValueDictionaryByParameters, isCompareValueInCopyPropertiesOnLogin, isConfirmOldPassword, isConfirmPassword, isExtractDefaultValuesFromProfile, isInvalidateAllChildSessions, isTrimProperty, isUsingLdapProfile, postAddMulti, postChangePassword, postCreateUser, postDeleteUser, postLoginUser, postLogoutUser, postUpdateUser, postValueDictionaryByParameters, preAddMulti, preChangePassword, preCreateUser, preDeleteUser, preLoginUser, preLogoutUser, preUpdateUser, preValueDictionaryByParameters, removeSwapEventListener, removeUser, sendProfileSwapEvent, setAuthenticationMessageTrigger, setBadPasswordDelay, setChangePasswordErrorURL, setChangePasswordSuccessURL, setCheckForRequiredParameters, setCheckForRequiredProperties, setCheckForRequiredPropertiesAfterUpdate, setCompareValueInCopyPropertiesOnLogin, setConfirmOldPassword, setConfirmPassword, setCreateErrorURL, setCreateProfileType, setCreateSuccessURL, setDeleteErrorURL, setDeleteSuccessURL, setExpireSessionOnLogout, setExtractDefaultValuesFromProfile, setInvalidateAllChildSessions, setLoginErrorURL, setLoginProfileType, setLoginSuccessURL, setLogoutErrorURL, setLogoutProfileType, setLogoutSuccessURL, setProfileTools, setPropertiesToAddOnLogin, setPropertiesToCopyOnLogin, setRepositoryId, setTrimProperties, setUpdateErrorURL, setUpdateSuccessURL, setUserLoginManager, setUsingLdapProfile, setValueDictionaryByParameters, setValueProperty, updateLDAPProfileAttributes, updatePasswordValue, updateProfileAttributes, updateProfileAttributes, updateUser, updateUser, userAlreadyExists, valueIsEmpty
addFormException, addUncheckedFormException, afterSet, beforeSet, checkFormRedirect, createFormSubmissionMessage, getCancelURL, getCheckForValidSession, getFormError, getFormExceptions, getFormName, getMessagePort, getMessageSource, getMessageType, getPropertyExceptions, getSendMessages, getUncheckedFormExceptions, handleCancel, handleFormException, handleUncheckedFormException, hasUncheckedFormExceptions, isDeferForwardsAndRedirects, isRestorableForm, isUseForwards, isValidSession, redirectOrForward, resetFormExceptions, setCancelURL, setCheckForValidSession, setDeferForwardsAndRedirects, setFormName, setMessagePort, setMessageSource, setMessageType, setRestorableForm, setSendMessages, setUseForwards
afterGet, beforeGet
addLogListener, createAdminServlet, doStopService, getAbsoluteName, getAdminServlet, getAdminServletOutputStreamEncoding, getLoggingForVlogging, getLogListenerCount, getLogListeners, getName, getNameContext, getNucleus, getRoot, getServiceConfiguration, getServiceInfo, isAdminServletUseServletOutputStream, isLoggingDebug, isLoggingError, isLoggingInfo, isLoggingTrace, isLoggingWarning, isRunning, logDebug, logDebug, logDebug, logError, logError, logError, logInfo, logInfo, logInfo, logTrace, logTrace, logTrace, logWarning, logWarning, logWarning, nameContextElementBound, nameContextElementUnbound, removeLogListener, reResolveThis, resolveName, resolveName, resolveName, resolveName, sendLogEvent, setAdminServletOutputStreamEncoding, setAdminServletUseServletOutputStream, setLoggingDebug, setLoggingError, setLoggingInfo, setLoggingTrace, setLoggingWarning, setNucleus, setServiceInfo, startService, stopService
vlogDebug, vlogDebug, vlogDebug, vlogDebug, vlogDebugTrace, vlogError, vlogError, vlogError, vlogError, vlogInfo, vlogInfo, vlogInfo, vlogInfo, vlogTrace, vlogTrace, vlogTrace, vlogTrace, vlogWarning, vlogWarning, vlogWarning, vlogWarning
public static java.lang.String CLASS_VERSION
protected static final java.lang.String MSG_NO_SUCH_PROFILE
protected static final java.lang.String MSG_ERR_SENDING_EMAIL
protected java.lang.String mSiteId
protected java.lang.Boolean mEmptySite
public void setSendEmailInSeparateThread(boolean pSendEmailInSeparateThread)
pUsingPriceLists
- boolean indicating whether the email is sent in a separate thread.public boolean isSendEmailInSeparateThread()
public void setPersistEmails(boolean pPersistEmails)
pUsingPriceLists
- boolean indicating whether the email is persisted before it is sent.public boolean isPersistEmails()
public void setTemplateEmailSender(TemplateEmailSender pTemplateEmailSender)
public TemplateEmailSender getTemplateEmailSender()
public void setSiteId(java.lang.String pSiteId)
public java.lang.String getSiteId()
public void setEmptySite(java.lang.Boolean pEmptySite)
public java.lang.Boolean getEmptySite()
public void setForgotPasswordErrorURL(java.lang.String pForgotPasswordErrorURL)
public java.lang.String getForgotPasswordErrorURL()
public void setForgotPasswordSuccessURL(java.lang.String pForgotPasswordSuccessURL)
public java.lang.String getForgotPasswordSuccessURL()
public void setTemplateEmailInfo(TemplateEmailInfoImpl pTemplateEmailInfo)
public TemplateEmailInfoImpl getTemplateEmailInfo()
public void setNewPasswordParam(java.lang.String pNewPasswordParam)
public java.lang.String getNewPasswordParam()
public boolean handleForgotPassword(DynamoHttpServletRequest pRequest, DynamoHttpServletResponse pResponse) throws javax.servlet.ServletException, java.io.IOException
If any errors occur in the process, form errors will be added. If there were no errors encountered while submitting the form, we optionally redirect to the value of the property forgotPasswordSuccessURL. Otherwise, we optionally redirect to forgotPasswordErrorURL.
pRequest
- the servlet's requestpResponse
- the servlet's responsejavax.servlet.ServletException
- if there was an error while executing the codejava.io.IOException
- if there was an error with servlet ioProfileTools.generateNewPasswordForProfile(RepositoryItem)
,
ProfileTools#sendEmailToUser(MutableRepositoryItem, boolean, boolean, TemplateEmailInfo, Map)
,
generateNewPasswordTemplateParams(DynamoHttpServletRequest, DynamoHttpServletResponse, RepositoryItem, String)
protected java.util.Map generateNewPasswordTemplateParams(DynamoHttpServletRequest pRequest, DynamoHttpServletResponse pResponse, RepositoryItem pProfile, java.lang.String pNewPassword)
By default, this method adds the parameter for the new password using the
name configured in the newPasswordParam
property.
Extend this method to add additional parameters to the email template.
pRequest
- pResponse
- pProfile
- the profile that had the new password generated.pNewPassword
- the new password in clear textprotected void preForgotPassword(DynamoHttpServletRequest pRequest, DynamoHttpServletResponse pResponse) throws javax.servlet.ServletException, java.io.IOException
pRequest
- the servlet's requestpResponse
- the servlet's responsejavax.servlet.ServletException
- if there was an error while executing the codejava.io.IOException
- if there was an error with servlet ioprotected void postForgotPassword(DynamoHttpServletRequest pRequest, DynamoHttpServletResponse pResponse) throws javax.servlet.ServletException, java.io.IOException
pRequest
- the servlet's requestpResponse
- the servlet's responsejavax.servlet.ServletException
- if there was an error while executing the codejava.io.IOException
- if there was an error with servlet iopublic MutableRepositoryItem[] lookupUsers(java.lang.String login, java.lang.String email)
login
- - login passed from web formemail
- - email address passed from web form