Fixed Self-Signup link in menu

This commit is contained in:
Rick Falkvinge
2015-05-08 15:09:13 +02:00
parent e24dad0d82
commit 3671779135
4 changed files with 21 additions and 2 deletions
+6 -1
View File
@@ -152,6 +152,11 @@ namespace Swarmops.Interface.Objects
/// <summary>
/// SPECIAL CASE: Close Books menu item
/// </summary>
SpecialCloseBooks
SpecialCloseBooks,
/// <summary>
/// SPECIAL CASE: Self-signup menu item
/// </summary>
SpecialSelfSignup
}
}
+13
View File
@@ -61,6 +61,19 @@ namespace Swarmops.Controls.Base
string localizedText = "RESOURCE NOT FOUND";
string prettyNavUrl = menuItem.NavigateUrl ?? string.Empty;
if (menuItem.Type == MenuItemType.SpecialSelfSignup)
{
if (string.IsNullOrEmpty (CurrentOrganization.VanityDomain))
{
prettyNavUrl = "/Signup?OrganizationId=" + CurrentOrganization.Identity;
}
else
{
prettyNavUrl = "//" + CurrentOrganization.VanityDomain + "/Signup";
}
menuItem.Type = MenuItemType.Link; // once the link is set, change to type Link to go into normal logic
}
if (!Debugger.IsAttached)
{
prettyNavUrl = prettyNavUrl.Replace ("/Pages/v5/", "/").Replace (".aspx", "");
+1
View File
@@ -40,6 +40,7 @@
"{0}Default.aspx", // for dev.swarmops.com/
"{0}.aspx", // for dev.swarmops.com/Security/Login
"/Pages/v5/Public{0}.aspx", // for dev.swarmops.com/Signup (and others under Public)
"/Pages/v5/Public{0}", // for dev.swarmops.com/WizardStyle.css (linked from pages in Public)
"/Pages/v5{0}.aspx", // for dev.swarmops.com/User/SelectLanguage
"/Pages/v5{0}" // for dev.swarmops.com/Ledgers/Json-SomethingData.aspx
};
+1 -1
View File
@@ -42,7 +42,7 @@
<ResourceKey>People_SelfSignup</ResourceKey>
<UserLevel>2</UserLevel>
<Permissions />
<Type>Disabled</Type>
<Type>SelfSignup</Type>
<Children />
</MainMenuItem>