diff --git a/OurUmbraco.Site/OurUmbraco.Site.csproj b/OurUmbraco.Site/OurUmbraco.Site.csproj index 875fa972..76b3f9ad 100644 --- a/OurUmbraco.Site/OurUmbraco.Site.csproj +++ b/OurUmbraco.Site/OurUmbraco.Site.csproj @@ -70,9 +70,6 @@ ..\dependencies\Our\Elmah.dll - - ..\dependencies\Our\ErrorMessage.dll - False ..\dependencies\4.9.1\Examine.dll @@ -396,6 +393,7 @@ + @@ -972,7 +970,6 @@ - diff --git a/OurUmbraco.Site/usercontrols/our.umbraco.org/Signup.ascx b/OurUmbraco.Site/usercontrols/our.umbraco.org/Signup.ascx index 19e6c1aa..e636434c 100644 --- a/OurUmbraco.Site/usercontrols/our.umbraco.org/Signup.ascx +++ b/OurUmbraco.Site/usercontrols/our.umbraco.org/Signup.ascx @@ -1,6 +1,10 @@ <%@ Control Language="C#" AutoEventWireup="true" CodeBehind="Signup.ascx.cs" Inherits="our.usercontrols.Signup" %> + +

There is already an account with this e-mail address! You can login or reset your password.

+
+
diff --git a/dependencies/Our/ErrorMessage.dll b/dependencies/Our/ErrorMessage.dll deleted file mode 100644 index 4ba9df40..00000000 Binary files a/dependencies/Our/ErrorMessage.dll and /dev/null differ diff --git a/our.umbraco.org/Hiccup.cs b/our.umbraco.org/Hiccup.cs new file mode 100644 index 00000000..f6956277 --- /dev/null +++ b/our.umbraco.org/Hiccup.cs @@ -0,0 +1,23 @@ +using System; +using System.Web.UI; +using System.Web.UI.WebControls; + +namespace our +{ + public class Hiccup : Page + { + protected Literal titleLiteral; + protected Literal header1; + protected Literal header3; + protected Literal notAffect; + + protected void Page_Load(object sender, EventArgs e) + { + var host = Request.Url.Host.Replace("http://", ""); + titleLiteral.Text = host; + header1.Text = host; + header3.Text = host; + notAffect.Text = host; + } + } +} diff --git a/our.umbraco.org/our.umbraco.org.csproj b/our.umbraco.org/our.umbraco.org.csproj index 141fbe96..68a5ebe0 100644 --- a/our.umbraco.org/our.umbraco.org.csproj +++ b/our.umbraco.org/our.umbraco.org.csproj @@ -112,6 +112,9 @@ + + ASPXCodeBehind + @@ -278,7 +281,9 @@ - + + ASPXCodeBehind + diff --git a/our.umbraco.org/usercontrols/Signup.ascx b/our.umbraco.org/usercontrols/Signup.ascx index 19e6c1aa..e636434c 100644 --- a/our.umbraco.org/usercontrols/Signup.ascx +++ b/our.umbraco.org/usercontrols/Signup.ascx @@ -1,6 +1,10 @@ <%@ Control Language="C#" AutoEventWireup="true" CodeBehind="Signup.ascx.cs" Inherits="our.usercontrols.Signup" %> + +

There is already an account with this e-mail address! You can login or reset your password.

+
+
diff --git a/our.umbraco.org/usercontrols/Signup.ascx.cs b/our.umbraco.org/usercontrols/Signup.ascx.cs index fbb7abc6..d672f5eb 100644 --- a/our.umbraco.org/usercontrols/Signup.ascx.cs +++ b/our.umbraco.org/usercontrols/Signup.ascx.cs @@ -3,10 +3,16 @@ using System.Collections.Generic; using System.Web; using System.Web.UI; using System.Web.UI.WebControls; +using System.Xml; +using our.Rest; +using umbraco; +using umbraco.BusinessLogic; using umbraco.cms.businesslogic.member; -namespace our.usercontrols { - public partial class Signup : System.Web.UI.UserControl { +namespace our.usercontrols +{ + public partial class Signup : System.Web.UI.UserControl + { public string Group { get; set; } public string memberType { get; set; } @@ -14,11 +20,15 @@ namespace our.usercontrols { private Member m = umbraco.cms.businesslogic.member.Member.GetCurrentMember(); - protected void Page_Load(object sender, EventArgs e) { + protected void Page_Load(object sender, EventArgs e) + { //lazyloading the needed javascript for validation. (addded it to the master template as our ahah forms need it aswel) //umbraco.library.RegisterJavaScriptFile("jquery.validation", "/scripts/jquery.validation.js"); - if (!Page.IsPostBack && m != null) { + MemberExists.Visible = false; + + if (!Page.IsPostBack && m != null) + { tb_name.Text = m.Text; tb_email.Text = m.Email; @@ -30,7 +40,8 @@ namespace our.usercontrols { //treshold and newsletter - if (m.getProperty("bugMeNot") != null) { + if (m.getProperty("bugMeNot") != null) + { int c = 0; int.TryParse(m.getProperty("bugMeNot").Value.ToString(), out c); @@ -54,10 +65,12 @@ namespace our.usercontrols { } - protected void createMember(object sender, EventArgs e) { + protected void createMember(object sender, EventArgs e) + { //Member is already logged in, and we just need to save his new data... - if (m != null) { + if (m != null) + { m.Text = tb_name.Text; m.Email = tb_email.Text; m.LoginName = tb_email.Text; @@ -84,7 +97,7 @@ namespace our.usercontrols { m.XmlGenerate(new System.Xml.XmlDocument()); m.Save(); - + //Refresh the member cache data @@ -93,16 +106,28 @@ namespace our.usercontrols { Response.Redirect(umbraco.library.NiceUrl(NextPage)); - } else { - if (tb_email.Text != "") { - m = Member.GetMemberFromEmail(tb_email.Text); - if (m == null) { + } + else + { + if (tb_email.Text != "") + { + m = Member.GetMemberFromLoginName(tb_email.Text); + if (m == null) + { MemberType mt = MemberType.GetByAlias(memberType); - m = Member.MakeNew(tb_name.Text, mt, new umbraco.BusinessLogic.User(0)); + + // Adding " Temp" is a hack - bizarrely, when you create a member using MakeNew and + // the name does not have a space in it (like: Ben) you'll get a YSOD saying the + // username already exists. However, create it with a space in it and everything is + // fine and dandy! So now we just force the last name to be "Temp" during creation + // and then update the member's name immediately after that... -SJ + m = Member.MakeNew(tb_name.Text + " Temp", mt, new User(0)); + m.Text = tb_name.Text; + m.Email = tb_email.Text; m.Password = tb_password.Text; m.LoginName = tb_email.Text; - + //Location m.getProperty("location").Value = tb_location.Text; m.getProperty("latitude").Value = tb_lat.Value; @@ -113,32 +138,38 @@ namespace our.usercontrols { m.getProperty("flickr").Value = tb_flickr.Text; m.getProperty("company").Value = tb_company.Text; m.getProperty("profileText").Value = tb_bio.Text; - + //treshold + newsletter m.getProperty("treshold").Value = tb_treshold.Text; m.getProperty("bugMeNot").Value = cb_bugMeNot.Checked; - + //Standard values m.getProperty("reputationTotal").Value = 20; m.getProperty("reputationCurrent").Value = 20; m.getProperty("forumPosts").Value = 0; - - if (!string.IsNullOrEmpty(Group)) { + + if (!string.IsNullOrEmpty(Group)) + { MemberGroup mg = MemberGroup.GetByName(Group); if (mg != null) m.AddGroup(mg.Id); } //set a default avatar - Rest.BuddyIcon.SetAvatar(m.Id, "gravatar"); + BuddyIcon.SetAvatar(m.Id, "gravatar"); m.Save(); - m.XmlGenerate(new System.Xml.XmlDocument()); + m.XmlGenerate(new XmlDocument()); Member.AddMemberToCache(m); - Response.Redirect(umbraco.library.NiceUrl(NextPage)); + Response.Redirect(library.NiceUrl(NextPage)); + } + else + { + MemberExists.Visible = true; + Panel1.Visible = false; } } } diff --git a/our.umbraco.org/usercontrols/Signup.ascx.designer.cs b/our.umbraco.org/usercontrols/Signup.ascx.designer.cs index d6b3754e..889a5ac8 100644 --- a/our.umbraco.org/usercontrols/Signup.ascx.designer.cs +++ b/our.umbraco.org/usercontrols/Signup.ascx.designer.cs @@ -12,6 +12,15 @@ namespace our.usercontrols { public partial class Signup { + /// + /// MemberExists control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::System.Web.UI.WebControls.Panel MemberExists; + /// /// Panel1 control. ///