Skip to content

Commit

Permalink
refactor captcha
Browse files Browse the repository at this point in the history
  • Loading branch information
ninianne98 committed Nov 18, 2018
1 parent 744ced9 commit 8bff3ef
Show file tree
Hide file tree
Showing 3 changed files with 17 additions and 5 deletions.
17 changes: 13 additions & 4 deletions WebControls/Captcha.cs
Original file line number Diff line number Diff line change
Expand Up @@ -256,13 +256,22 @@ public override string ToString() {
return this.CaptchaText;
}

protected override void OnInit(EventArgs e) {
// call directly in user control when in dynamically inserted controls like cms widgets
public void RefreshField() {
if (this.IsWebView) {
if (HttpContext.Current.Request.Form.Count > 0) {
var s = HttpContext.Current.Request.Form[this.UniqueID];
this.CaptchaText = s;
//ViewState["Text"] = null;
this.CaptchaText = String.Empty;

if (HttpContext.Current.Request.Form[this.UniqueID] != null) {
var val = HttpContext.Current.Request.Form[this.UniqueID];
ViewState["Text"] = val;
this.CaptchaText = val;
}
}
}

protected override void OnInit(EventArgs e) {
RefreshField();

base.OnInit(e);
}
Expand Down
4 changes: 4 additions & 0 deletions WebControls/Email/EmailHelper.cs
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,10 @@ private static Version CurrentDLLVersion {

public static bool SendMail(string fromEmail, string emailTo, string subjectLine, string bodyText, bool isHTML) {
List<string> lst = new List<string>();
if (String.IsNullOrEmpty(emailTo)) {
emailTo = String.Empty;
}
//emailTo = emailTo.Replace(",", ";");

if (emailTo.Contains(";")) {
lst = emailTo.Split(';').Where(x => x.Length > 2).Select(x => x.Trim()).ToList();
Expand Down
1 change: 0 additions & 1 deletion WebControls/Properties/AssemblyInfo.cs
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,6 @@
//
// You can specify all the values or you can default the Build and Revision Numbers
// by using the '*' as shown below:
// [assembly: AssemblyVersion("1.0.*")]
[assembly: AssemblyVersion("4.4.*")]
// [assembly: AssemblyFileVersion("4.3.0.0")]

Expand Down

0 comments on commit 8bff3ef

Please sign in to comment.