Added self-signup link on login screen

This commit is contained in:
Rick Falkvinge
2015-06-06 14:48:25 +02:00
parent bef3ba40e6
commit 22356369c5
4 changed files with 42 additions and 1 deletions
@@ -212,6 +212,13 @@
<data name="Login_ResetPassword" xml:space="preserve">
<value>Reset Password</value>
</data>
<data name="Login_SelfSignup" xml:space="preserve">
<value>Sign me up for {0}!</value>
<comment>{0} is the organization name.</comment>
</data>
<data name="Login_SelfSignupHeader" xml:space="preserve">
<value>Seeking to Join?</value>
</data>
<data name="Login_UnknownBitIdAddress" xml:space="preserve">
<value>Swarmops doesn't recognize this address. Please log in manually and activate your address before using it to login.</value>
</data>
+1 -1
View File
@@ -72,7 +72,7 @@
if (File.Exists (Server.MapPath (rewrittenCandidate)))
{
Context.RewritePath (rewrittenCandidate);
break;
break; // exits if match found - prevents, say, Default from replacing Dashboard (which happened as a Mono-only bug)
}
}
}
+20
View File
@@ -139,6 +139,9 @@
var bitIdUri = '<asp:Literal ID="LiteralUri" runat="server" />';
var bitIdNonce = '<asp:Literal ID="LiteralNonce" runat="server" />';
var linkSelfSignup = '<asp:Literal ID="LiteralSelfSignupLink" runat="server" />';
</script>
@@ -206,6 +209,23 @@
</div>
</div>
</div>
<asp:Panel runat="server" ID="PanelJoin" Visible="false">
<h2 class="orange"><asp:Label ID="LabelSelfSignupHeader" runat="server" /><span class="arrow"></span></h2>
<div class="box">
<div class="content">
<div class="link-row-encaps" onclick=" document.location=linkSelfSignup; return false; " >
<div class="link-row-icon" style="background-image: url('/Images/Icons/iconshock-add-16px.png')"></div>
<asp:Label ID="LabelSelfSignup" runat="server" />
</div>
</div>
</div>
</asp:Panel>
</div>
</div>
+14
View File
@@ -2,6 +2,7 @@
using System.Diagnostics;
using System.Globalization;
using System.IO;
using System.Runtime.Versioning;
using System.Web;
using System.Web.ExtensionMethods;
using System.Web.Script.Serialization;
@@ -128,6 +129,19 @@ namespace Swarmops.Pages.Security
}
// If we're on a vanity domain, enable the self-signup link
Organization vanityOrganization = Organization.FromVanityDomain (Request.Url.Host);
if (vanityOrganization != null)
{
this.LiteralSelfSignupLink.Text = @"//" + vanityOrganization.VanityDomain + @"/Signup";
this.LabelSelfSignup.Text = String.Format (Resources.Pages.Security.Login_SelfSignup, vanityOrganization.Name);
this.LabelSelfSignupHeader.Text = Resources.Pages.Security.Login_SelfSignupHeader;
this.PanelJoin.Visible = true;
}
// If we're debugging, enable the auto- / impersonation login. This MUST NEVER fire outside of development environment.
if (Debugger.IsAttached && Path.DirectorySeparatorChar == '\\')