From 116034bd2938ea59b20c11836e555994b931855d Mon Sep 17 00:00:00 2001 From: Rick Falkvinge Date: Fri, 8 May 2015 12:52:02 +0200 Subject: [PATCH] More work on Signup --- Site5/Pages/v5/Public/Signup.aspx | 617 +++------------------------ Site5/Pages/v5/Public/Signup.aspx.cs | 14 + 2 files changed, 70 insertions(+), 561 deletions(-) diff --git a/Site5/Pages/v5/Public/Signup.aspx b/Site5/Pages/v5/Public/Signup.aspx index 8a5bca24..b0da9800 100644 --- a/Site5/Pages/v5/Public/Signup.aspx +++ b/Site5/Pages/v5/Public/Signup.aspx @@ -19,10 +19,10 @@ - Swarmops - Signup + <%=Organization.Name %> - Signup - +
-
|
| 
| 
-
Swarmops Logo
-
-
- +
+ SIGNING UP FOR <%= Organization.Name.ToUpperInvariant() %>
@@ -578,130 +180,23 @@ function goManualCredentials() {
-

Welcome to OrganizationName

-

This is the organization's custom welcome text. It is set in Admin / Org Settings.

- - -
-  
-  
-  
-
+

Welcome to <%= Organization.Name %>

+

This is the organization's custom welcome text. It has not yet been written; it is set in Admin / Org Settings.

-
-

Fix File Permissions

-

The bad news is that we can't write to the configuration file. This is fairly normal for a new installation. The good news is that you can fix that, so we can continue installing. Please open a shell to the Swarmops server and execute the following commands:


-

cd /etc/swarmops
sudo chown www-data:www-data database.config

-

The installation will continue when it detects that these steps have been taken.

-
- - - +

Initializing database

+

Initializing database

-
-

Please wait while the database is being initialized with schemas and geographic data from the Swarmops servers. This is going to take a significant amount of time; we're loading tons of geodata onto your new server.

-

Initializing...

Creating the first user

-

Your new Swarmops server has been loaded with the geographic layout of the countries we're active in, and the first organization - the Sandbox - has been created. We are now going to create your user account, which will become the systems administrator account of this Swarmops installation.

- -

(You can add other people to the System Administrator role later.)

- - -
-  
-  
-  
-  
-
-
diff --git a/Site5/Pages/v5/Public/Signup.aspx.cs b/Site5/Pages/v5/Public/Signup.aspx.cs index c0db7d6c..335079e7 100644 --- a/Site5/Pages/v5/Public/Signup.aspx.cs +++ b/Site5/Pages/v5/Public/Signup.aspx.cs @@ -4,6 +4,7 @@ using System.Linq; using System.Web; using System.Web.UI; using System.Web.UI.WebControls; +using Swarmops.Logic.Structure; namespace Swarmops.Frontend.Pages.Public { @@ -11,7 +12,20 @@ namespace Swarmops.Frontend.Pages.Public { protected void Page_Load (object sender, EventArgs e) { + this.Organization = Organization.FromVanityDomain (Request.Url.Host); + if (this.Organization == null) + { + int organizationId = Convert.ToInt32 (Request["OrganizationId"]); // may throw - not pretty but ok for now. // TODO + this.Organization = Organization.FromIdentity (organizationId); // may also throw, as above + } + + if (this.Organization == null) + { + throw new ArgumentException("Organization not specified"); // TODO: make a friendly landing page instead + } } + + protected Organization Organization; } } \ No newline at end of file