本文整理匯總了C#中mojoPortal.Business.SiteUser.UpdatePasswordQuestionAndAnswer方法的典型用法代碼示例。如果您正苦於以下問題:C# SiteUser.UpdatePasswordQuestionAndAnswer方法的具體用法?C# SiteUser.UpdatePasswordQuestionAndAnswer怎麽用?C# SiteUser.UpdatePasswordQuestionAndAnswer使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類mojoPortal.Business.SiteUser
的用法示例。
在下文中一共展示了SiteUser.UpdatePasswordQuestionAndAnswer方法的1個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的C#代碼示例。
示例1: ChangePasswordQuestionAndAnswer
public override bool ChangePasswordQuestionAndAnswer(
string userName,
string password,
string newPasswordQuestion,
string newPasswordAnswer)
{
/*
* Takes, as input, a user name, password, password question, and password answer and
* updates
* the password question and answer in the data source if the user name and password are valid.
* This method
* returns true if the password question and answer are successfully updated. Otherwise,
* it returns false.
* ChangePasswordQuestionAndAnswer returns false if either the user name or password is invalid.
*/
if (
String.IsNullOrEmpty(userName)
|| (password == null)
|| String.IsNullOrEmpty(newPasswordQuestion)
|| String.IsNullOrEmpty(newPasswordAnswer)
|| (newPasswordQuestion.Length > PasswordquestionMaxlength)
|| (newPasswordAnswer.Length > PasswordanswerMaxlength)
)
{
return false;
}
SiteSettings siteSettings = GetSiteSettings();
if (siteSettings == null) { return false; }
SiteUser siteUser = new SiteUser(siteSettings, userName);
if (siteUser.UserId > -1 && ValidateUser(userName, password))
{
return siteUser.UpdatePasswordQuestionAndAnswer(newPasswordQuestion, newPasswordAnswer);
}
return false;
}