From 6255c0685cfef9ca1105c6dd046d4245fec45036 Mon Sep 17 00:00:00 2001 From: Rick Falkvinge Date: Wed, 20 May 2015 13:42:03 +0200 Subject: [PATCH] Signup works. Almost done for Alpha-09. --- Basic/Basic.csproj | 1 + Basic/Types/Swarm/BasicVolunteerPosition.cs | 12 ++ Console/Console.cs | 2 +- Database/Database-Volunteers.cs | 70 +-------- Logic/Cache/OrganizationCache.cs | 1 - Logic/Logic.csproj | 1 + Logic/Swarm/Person.cs | 13 +- Logic/Swarm/Volunteer.cs | 47 +++--- Logic/Swarm/VolunteerPosition.cs | 14 ++ Logic/Swarm/VolunteerRole.cs | 3 +- Site5/App_GlobalResources/Pages.Public.resx | 8 + .../v5/Admin/Hacks/PopulateFakePeople.aspx.cs | 2 +- Site5/Pages/v5/Public/Initialize.aspx.cs | 2 +- Site5/Pages/v5/Public/Signup.aspx | 141 +++++++++++++----- Site5/Pages/v5/Public/Signup.aspx.cs | 72 +++++++++ Site5/Pages/v5/Public/WizardStyle.css | 20 ++- 16 files changed, 269 insertions(+), 140 deletions(-) create mode 100644 Basic/Types/Swarm/BasicVolunteerPosition.cs create mode 100644 Logic/Swarm/VolunteerPosition.cs diff --git a/Basic/Basic.csproj b/Basic/Basic.csproj index 6f1b83bf..1e1b26ec 100644 --- a/Basic/Basic.csproj +++ b/Basic/Basic.csproj @@ -58,6 +58,7 @@ + diff --git a/Basic/Types/Swarm/BasicVolunteerPosition.cs b/Basic/Types/Swarm/BasicVolunteerPosition.cs new file mode 100644 index 00000000..64dc9fad --- /dev/null +++ b/Basic/Types/Swarm/BasicVolunteerPosition.cs @@ -0,0 +1,12 @@ +using Swarmops.Common.Enums; +using Swarmops.Common.Interfaces; + +namespace Swarmops.Basic.Types.Swarm +{ + public class BasicVolunteerPosition : IHasIdentity + { + // TODO + + public int Identity { get; private set; } + } +} \ No newline at end of file diff --git a/Console/Console.cs b/Console/Console.cs index 71102e72..150db791 100644 --- a/Console/Console.cs +++ b/Console/Console.cs @@ -939,7 +939,7 @@ namespace Swarmops { Console.WriteLine ("[!!] " + member.Name); - member.AddMembership (1, membership.Expires); + member.AddParticipation (1, membership.Expires); Console.WriteLine (" - added membership in PP"); PWEvents.CreateEvent(EventSource.PirateBot, EventType.AddedMembership, diff --git a/Database/Database-Volunteers.cs b/Database/Database-Volunteers.cs index 8b19d074..995e0f15 100644 --- a/Database/Database-Volunteers.cs +++ b/Database/Database-Volunteers.cs @@ -58,54 +58,6 @@ namespace Swarmops.Database } } - public BasicVolunteerRole GetVolunteerRole (int volunteerRoleId) - { - using (DbConnection connection = GetMySqlDbConnection()) - { - connection.Open(); - - DbCommand command = - GetDbCommand ( - "SELECT VolunteerRoleId,VolunteerId,OrganizationId,GeographyId,RoleTypeId,Open,Assigned FROM VolunteerRoles WHERE VolunteerRoleId=" + - volunteerRoleId + ";", connection); - - using (DbDataReader reader = command.ExecuteReader()) - { - if (reader.Read()) - { - return ReadVolunteerRoleFromDataReader (reader); - } - - throw new ArgumentException ("Unknown VolunteerId"); - } - } - } - - - public BasicVolunteerRole[] GetVolunteerRolesByVolunteer (int volunteerId) - { - List result = new List(); - - using (DbConnection connection = GetMySqlDbConnection()) - { - connection.Open(); - - DbCommand command = - GetDbCommand ( - "SELECT VolunteerRoleId,VolunteerId,OrganizationId,GeographyId,RoleTypeId,Open,Assigned FROM VolunteerRoles WHERE VolunteerId=" + - volunteerId + ";", connection); - - using (DbDataReader reader = command.ExecuteReader()) - { - while (reader.Read()) - { - result.Add (ReadVolunteerRoleFromDataReader (reader)); - } - } - } - - return result.ToArray(); - } private BasicVolunteer ReadVolunteerFromDataReader (DbDataReader reader) @@ -123,18 +75,9 @@ namespace Swarmops.Database } - private BasicVolunteerRole ReadVolunteerRoleFromDataReader (DbDataReader reader) + private BasicVolunteerPosition ReadVolunteerPositionFromDataReader (DbDataReader reader) { - int volunteerRoleId = reader.GetInt32 (0); - int volunteerId = reader.GetInt32 (1); - int organizationId = reader.GetInt32 (2); - int geographyId = reader.GetInt32 (3); - int roleTypeId = reader.GetInt32 (4); - bool open = reader.GetBoolean (5); - bool assigned = reader.GetBoolean (6); - - return new BasicVolunteerRole (volunteerRoleId, volunteerId, organizationId, geographyId, - (RoleType) roleTypeId, open, assigned); + throw new NotImplementedException(); } @@ -149,25 +92,24 @@ namespace Swarmops.Database AddParameterWithName (command, "personId", personId); AddParameterWithName (command, "ownerPersonId", ownerPersonId); - AddParameterWithName (command, "openedDateTime", DateTime.Now); + AddParameterWithName (command, "openedDateTime", DateTime.UtcNow); return Convert.ToInt32 (command.ExecuteScalar()); } } - public int CreateVolunteerRole (int volunteerId, int organizationId, int geographyId, RoleType roleType) + public int CreateVolunteerPosition (int volunteerId, int positionId, int geographyId) { using (DbConnection connection = GetMySqlDbConnection()) { connection.Open(); - DbCommand command = GetDbCommand ("CreateVolunteerRole", connection); + DbCommand command = GetDbCommand ("CreateVolunteerPosition", connection); command.CommandType = CommandType.StoredProcedure; AddParameterWithName (command, "volunteerId", volunteerId); - AddParameterWithName (command, "organizationId", organizationId); + AddParameterWithName (command, "positionId", positionId); AddParameterWithName (command, "geographyId", geographyId); - AddParameterWithName (command, "roleTypeId", (int) roleType); return Convert.ToInt32 (command.ExecuteScalar()); } diff --git a/Logic/Cache/OrganizationCache.cs b/Logic/Cache/OrganizationCache.cs index 7693075c..061d6958 100644 --- a/Logic/Cache/OrganizationCache.cs +++ b/Logic/Cache/OrganizationCache.cs @@ -142,7 +142,6 @@ namespace Swarmops.Logic.Cache throw new ArgumentException ("No such OrganizationId: " + OrganizationId.ToString()); } } - ; } } diff --git a/Logic/Logic.csproj b/Logic/Logic.csproj index 864c4585..a8c00730 100644 --- a/Logic/Logic.csproj +++ b/Logic/Logic.csproj @@ -387,6 +387,7 @@ + diff --git a/Logic/Swarm/Person.cs b/Logic/Swarm/Person.cs index 717e7cb0..2e6e4101 100644 --- a/Logic/Swarm/Person.cs +++ b/Logic/Swarm/Person.cs @@ -785,14 +785,14 @@ namespace Swarmops.Logic.Swarm return newPerson; } - public Participation AddMembership (Organization organization, DateTime expires) + public Participation AddParticipation (Organization organization, DateTime expires) { - return AddMembership (organization.Identity, expires); + return AddParticipation (organization.Identity, expires); } - public Participation AddMembership (int organizationId, DateTime expires) + private Participation AddParticipation (int organizationId, DateTime expires) { - return Participation.Create (Identity, organizationId, expires); + return Participation.Create (this.Identity, organizationId, expires); } private bool? HasExplicitSubscription (int newsletterFeedId) @@ -1156,6 +1156,11 @@ namespace Swarmops.Logic.Swarm return assignment.Position; } + public Volunteer CreateVolunteer() + { + return Volunteer.Create (this); + } + // A couple of special cases public const int OpenLedgersIdentity = -1; diff --git a/Logic/Swarm/Volunteer.cs b/Logic/Swarm/Volunteer.cs index 0804d12a..f14fd337 100644 --- a/Logic/Swarm/Volunteer.cs +++ b/Logic/Swarm/Volunteer.cs @@ -33,19 +33,24 @@ namespace Swarmops.Logic.Swarm return new Volunteer (basic); } - public static Volunteer Create (Person person, Person owner) + public static Volunteer Create (Person person) { - return Create (person.Identity, owner.Identity); + return Create (person, null); } - public static Volunteer Create (int personId, int ownerPersonId) + public static Volunteer Create (Person person, Person owner) + { + return Create (person.Identity, owner != null? owner.Identity: 0); + } + + private static Volunteer Create (int personId, int ownerPersonId) { return FromIdentity (SwarmDb.GetDatabaseForWriting().CreateVolunteer (personId, ownerPersonId)); } #endregion - private Geography geography; + private Geography _geography; private Person ownerPerson; private Person person; @@ -78,7 +83,7 @@ namespace Swarmops.Logic.Swarm get { PopulateCache(); - return this.geography; + return this._geography; } } @@ -97,7 +102,7 @@ namespace Swarmops.Logic.Swarm get { PopulateCache(); - return this.geography.Name; + return this._geography.Name; } } @@ -119,23 +124,6 @@ namespace Swarmops.Logic.Swarm } } - public VolunteerRoles Roles - { - get - { - return VolunteerRoles.FromArray (SwarmDb.GetDatabaseForReading().GetVolunteerRolesByVolunteer (Identity)); - } - } - - public void AddRole (Organization organization, Geography geography, RoleType roleType) - { - AddRole (organization.Identity, geography.Identity, roleType); - } - - public void AddRole (int organizationId, int geographyId, RoleType roleType) - { - SwarmDb.GetDatabaseForWriting().CreateVolunteerRole (Identity, organizationId, geographyId, roleType); - } public void Close (string comments) { @@ -154,19 +142,26 @@ namespace Swarmops.Logic.Swarm this.ownerPerson = Person.FromIdentity (OwnerPersonId); } - if (this.geography == null) + if (this._geography == null) { if (this.person.GeographyId != 0) { - this.geography = this.person.Geography; + this._geography = this.person.Geography; } else { - this.geography = Geography.Root; + this._geography = Geography.Root; } } } + public void AddPosition (Position position, Geography geography = null) + { + int geographyId = (geography == null ? 0 : geography.Identity); + + SwarmDb.GetDatabaseForWriting().CreateVolunteerPosition (this.Identity, position.Identity, geographyId); + } + /// /// Assign the volunteer to a suitable owner will try to assign to ElectoralCircuit lead diff --git a/Logic/Swarm/VolunteerPosition.cs b/Logic/Swarm/VolunteerPosition.cs new file mode 100644 index 00000000..7f869061 --- /dev/null +++ b/Logic/Swarm/VolunteerPosition.cs @@ -0,0 +1,14 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; +using Swarmops.Basic.Types.Swarm; + +namespace Swarmops.Logic.Swarm +{ + public class VolunteerPosition: BasicVolunteerPosition + { + + } +} diff --git a/Logic/Swarm/VolunteerRole.cs b/Logic/Swarm/VolunteerRole.cs index 7d8958c6..59eda71f 100644 --- a/Logic/Swarm/VolunteerRole.cs +++ b/Logic/Swarm/VolunteerRole.cs @@ -1,3 +1,4 @@ +using System; using Swarmops.Basic.Types; using Swarmops.Basic.Types.Swarm; using Swarmops.Database; @@ -24,7 +25,7 @@ namespace Swarmops.Logic.Swarm public static VolunteerRole FromIdentity (int identity) { - return FromBasic (SwarmDb.GetDatabaseForReading().GetVolunteerRole (identity)); + throw new NotImplementedException(); // This entire class is legacy } public void Close (bool wasAssigned) diff --git a/Site5/App_GlobalResources/Pages.Public.resx b/Site5/App_GlobalResources/Pages.Public.resx index b1fbf89d..01ec01e4 100644 --- a/Site5/App_GlobalResources/Pages.Public.resx +++ b/Site5/App_GlobalResources/Pages.Public.resx @@ -145,6 +145,14 @@ Officer Volunteer + + Welcome! This is the <em>Dashboard,</em> where you can access internal functionality of {0}. You will get more information in mail shortly.<br/><br/> + +If you volunteered for taking formal responsibility, somebody (probably also a volunteer, like yourself) will contact you to discuss more about the opportunities. + + + You have already signed up to this Swarmops server. Please use the Reset Password function from the login screen instead of creating a new account. + Please select and retype a password. diff --git a/Site5/Pages/v5/Admin/Hacks/PopulateFakePeople.aspx.cs b/Site5/Pages/v5/Admin/Hacks/PopulateFakePeople.aspx.cs index 0a78f902..f173e3b5 100644 --- a/Site5/Pages/v5/Admin/Hacks/PopulateFakePeople.aspx.cs +++ b/Site5/Pages/v5/Admin/Hacks/PopulateFakePeople.aspx.cs @@ -93,7 +93,7 @@ namespace Swarmops.Frontend.Pages.v5.Admin.Hacks newPerson.Longitude = lineParts[10]; newPerson.Latitude = lineParts[11]; - newPerson.AddMembership (1, DateTime.Today.AddDays (random.Next (365))); + newPerson.AddParticipation (Organization.Sandbox, DateTime.Today.AddDays (random.Next (365))); } GuidCache.Set (guid + "-Progress", 100); diff --git a/Site5/Pages/v5/Public/Initialize.aspx.cs b/Site5/Pages/v5/Public/Initialize.aspx.cs index bb354703..6ee58af1 100644 --- a/Site5/Pages/v5/Public/Initialize.aspx.cs +++ b/Site5/Pages/v5/Public/Initialize.aspx.cs @@ -682,7 +682,7 @@ namespace Swarmops.Frontend.Pages.v5.Public HttpUtility.UrlDecode (password), string.Empty, string.Empty, string.Empty, string.Empty, string.Empty, DateTime.MinValue, PersonGender.Unknown); - newPerson.AddMembership (1, DateTime.MaxValue); // Add membership in Sandbox + newPerson.AddParticipation (Organization.Sandbox, DateTime.MaxValue); // Add membership in Sandbox newPerson.AddRole (RoleType.SystemAdmin, 0, 0); // Add role System Admin } diff --git a/Site5/Pages/v5/Public/Signup.aspx b/Site5/Pages/v5/Public/Signup.aspx index 93d3dd8f..30408ce2 100644 --- a/Site5/Pages/v5/Public/Signup.aspx +++ b/Site5/Pages/v5/Public/Signup.aspx @@ -32,7 +32,10 @@ - + + + + @@ -104,23 +107,6 @@ } - .swMain ul.anchor li a.crossout, .swMain ul.anchor li a.crossout:hover { /* cross out step 5 if it is skipped - if so, it gets marked disabled */ - background: - linear-gradient(to top left, - rgba(0,0,0,0) 0%, - rgba(0,0,0,0) calc(50% - 2px), - rgba(0,0,0,.2) 50%, - rgba(0,0,0,0) calc(50% + 2px), - rgba(0,0,0,0) 100%), - linear-gradient(to top right, - rgba(0,0,0,0) 0%, - rgba(0,0,0,0) calc(50% - 2px), - rgba(0,0,0,.2) 50%, - rgba(0,0,0,0) calc(50% + 2px), - rgba(0,0,0,0) 100%); - } - - .entryFieldsAdmin, .entryLabelsAdmin { font-size: 16px; } @@ -298,7 +284,30 @@ isValid = ValidateTextField('#<%= TextMail.ClientID %>', "") && isValid; isValid = ValidateTextField('#<%= TextName.ClientID %>', "") && isValid; // TODO: Actually validate geography? - return isValid; + if (isValid) { + + var jsonData = {}; + jsonData.mail = $('#<%= TextMail.ClientID %>').val(); + + $.ajax({ + type: "POST", + url: "/Pages/v5/Public/Signup.aspx/CheckMailFree", + data: $.toJSON(jsonData), + contentType: "application/json; charset=utf-8", + dataType: "json", + async: false, // blocks until function returns - race conditions otherwise + success: function(msg) { + if (msg.d != true) { + isValid = false; + $('#<%= this.TextMail.ClientID %>').addClass("entryError"); + alertify.error(""); + $('#<%=this.TextMail.ClientID %>').focus(); + } + } + }); + } + + return isValid; } function ValidateTextField(fieldId, message) { @@ -355,8 +364,39 @@ } function onFinishCallback(obj) { - alert("On Finish Callback"); - // $('#LOGINBUTTONID').click(); + var positionIdArray = []; + + $('a.buttonFinish').addClass('buttonDisabled').css('cursor', 'wait'); + + if (selectedPositions.length > 0) { + selectedPositions.forEach(function(currentValue, index, array) { + positionIdArray.push(parseInt(currentValue.positionId)); + }); + } + + SwarmopsJS.ajaxCall("/Pages/v5/Public/Signup.aspx/SignupParticipant", + { + name: $('#<%=this.TextName.ClientID%>').val(), + organizationId: <%= this.Organization.Identity %>, + mail: $('#<%=this.TextMail.ClientID%>').val(), + phone: $('#<%=this.TextPhone.ClientID%>').val(), + password: $('#<%=this.TextPassword1.ClientID%>').val(), + street1: $('#<%=this.TextStreet1.ClientID%>').val(), + street2: $('#<%=this.TextStreet2.ClientID%>').val(), + postalCode: $('#<%=this.TextPostal.ClientID%>').val(), + city: $('#<%=this.TextCity.ClientID%>').val(), + countryCode: $('#<%=this.DropCountries.ClientID%>').val(), + dateOfBirth: $('#<%=this.TextDateOfBirth.ClientID%>').val(), + geographyId: currentGeographyId, + activist: $('input:radio[name="ActivationLevel"]:checked').val() != "RadioActivationPassive", + gender: $('#<%=this.DropGenders.ClientID%>').val(), + positionIdsVolunteer: positionIdArray + + }, + function() { + // On success, the participant is created and an authentication cookie has been set. Redirect to Dashboard. + document.location = "/"; + }); } function validateStep(stepNumber) { @@ -403,36 +443,46 @@ alertify.error(""); } - if (selectedOption != "RadioActivationVolunteer" && isValid) { - - // If we're NOT an officer volunteer... - - suppressChecks = true; // prevents foreverlooping into this check - $('#wizard').smartWizard('goToStep', 6); - setTimeout(function() { - $('a[rel="5"]').addClass("disabled").addClass("crossout").removeClass("selected"); - $('a.buttonNext').addClass("buttonDisabled"); // hacks because SmartWizard doesn't handle skipping steps - }, 250); - suppressChecks = false; - } else if (isValid) { + if (selectedOption == "RadioActivationVolunteer" && isValid) { // If we ARE an officer volunteer... - $('a[rel="5"]').removeClass("crossout"); // if user navigating back and forth, need to remove the crossout here - setTimeout(function() { $('#tableVolunteerPositions').datagrid({ url: '/Pages/v5/Public/Json-SignupVolunteerPositions.aspx?OrganizationId=<%=Organization.Identity%>&GeographyId=' + currentGeographyId }); - //$('#tableVolunteerPositions').datagrid('reload'); }, 250); + } else { + // Otherwise, jump to step 6 + + // This is NOT how you do it. The SmartWizard doesn't want to do DisableStep (so that a step is skipped), and doesn't do GoToStep either. + // These hacks mean that backstepping becomes shit ugly if you go to step 6 and backstep to 4. Need to fix. BUGBUG TODO + + if (!suppressChecks) { + suppressChecks = true; + $('#wizard').smartWizard('goToStep', '6'); + setTimeout(function() { + $('#step-5').hide(); + $('a.buttonNext').addClass('buttonDisabled'); + $('a[rel="5"]').removeClass('selected').removeClass('done').addClass('disabled'); + }, 250); // needs to be at least 250ms to happen after... what? BUG here, there has to be a better way to do this + suppressChecks = false; + } } } else if (stepNumber == 5) { isValid = true; // assume true, make false as we go - selectedPositions = $('#tableVolunteerPositions').datagrid('getChecked'); - if (selectedPositions.length == 0) { - isValid = false; - alertify.error(""); + if ($('input:radio[name="ActivationLevel"]:checked').val() == "RadioActivationVolunteer") { + // if step 5 active... + + selectedPositions = $('#tableVolunteerPositions').datagrid('getChecked'); + if (selectedPositions.length == 0) { + isValid = false; + alertify.error(""); + } + } else { + // If we should just skip step 5 + $('a[rel="5"]').addClass("disabled").addClass("crossout"); + selectedPositions = {}; } } else if (stepNumber == 6) { @@ -446,6 +496,17 @@ UpdatePostalPrefix('oldValueDummy', $('#<%=this.DropCountries.ClientID%>').val()); }); + $('input:radio[name="ActivationLevel"]').click(function() { + if ($('input:radio[name="ActivationLevel"]:checked').val() == "RadioActivationVolunteer") { + $('#wizard').smartWizard('enableStep', '5'); + $('a[rel="5"]').removeClass("crossout"); + } else { + $('#wizard').smartWizard('disableStep', '5'); + $('a[rel="5"]').addClass("crossout"); + selectedPositions = {}; + } + }); + }); // end of document.ready var disableNext = false; diff --git a/Site5/Pages/v5/Public/Signup.aspx.cs b/Site5/Pages/v5/Public/Signup.aspx.cs index b69ced13..f18186e1 100644 --- a/Site5/Pages/v5/Public/Signup.aspx.cs +++ b/Site5/Pages/v5/Public/Signup.aspx.cs @@ -3,9 +3,12 @@ using System.Collections.Generic; using System.Linq; using System.Threading; using System.Web; +using System.Web.Security; +using System.Web.Services; using System.Web.UI; using System.Web.UI.WebControls; using Resources; +using Swarmops.Common.Enums; using Swarmops.Logic.Security; using Swarmops.Logic.Structure; using Swarmops.Logic.Swarm; @@ -106,6 +109,7 @@ namespace Swarmops.Frontend.Pages.Public this.LiteralErrorPasswordMismatch.Text = Resources.Pages.Public.Signup_Error_PasswordMismatch; this.LiteralErrorSelectActivationLevel.Text = Resources.Pages.Public.Signup_Error_SelectActivationLevel; this.LiteralErrorSelectVolunteerPosition.Text = Resources.Pages.Public.Signup_Error_SelectPosition; + this.LiteralErrorMailExists.Text = Resources.Pages.Public.Signup_Error_MailExists; this.LabelWelcomeHeader.Text = String.Format (Resources.Pages.Public.Signup_Welcome, Organization.Name); this.LabelHeader.Text = String.Format(Resources.Pages.Public.Signup_SigningUp, Organization.Name).ToUpperInvariant(); @@ -189,5 +193,73 @@ namespace Swarmops.Frontend.Pages.Public protected Organization Organization; + + [WebMethod] + public static AjaxCallResult SignupParticipant (string name, int organizationId, string mail, string password, string phone, + string street1, string street2, string postalCode, string city, string countryCode, string dateOfBirth, + int geographyId, bool activist, PersonGender gender, int[] positionIdsVolunteer) + { + CommonV5.CulturePreInit (HttpContext.Current.Request); // Set culture, for date parsing + + if (geographyId == 0) + { + geographyId = Geography.RootIdentity; // if geo was undetermined, set it to "Global" + } + + Organization organization = Organization.FromIdentity (organizationId); + DateTime parsedDateOfBirth = new DateTime (1800, 1, 1); // Default if unspecified + + if (dateOfBirth.Length > 0) + { + parsedDateOfBirth = DateTime.Parse (dateOfBirth); + } + + Person newPerson = Person.Create (name, mail, password, phone, street1 + "\n" + street2.Trim(), postalCode, + city, countryCode, parsedDateOfBirth, gender); + newPerson.AddParticipation (organization, DateTime.UtcNow.AddYears (1)); // TODO: set duration from organization settings of Participantship + + // TODO: SEND NOTIFICATIONS + + if (activist) + { + newPerson.CreateActivist (false, false); + } + + if (positionIdsVolunteer.Length > 0) + { + Volunteer volunteer = newPerson.CreateVolunteer(); + foreach (int positionId in positionIdsVolunteer) + { + volunteer.AddPosition (Position.FromIdentity (positionId)); + } + } + + newPerson.LastLogonOrganizationId = organizationId; + + // Create a welcome message to the Dashboard + + HttpContext.Current.Response.AppendCookie (new HttpCookie ("DashboardMessage", CommonV5.JavascriptEscape(String.Format(Resources.Pages.Public.Signup_DashboardMessage, organization.Name)))); + + // Set authentication cookie, which will log the new person in using the credentials just given + + FormsAuthentication.SetAuthCookie (Authority.FromLogin (newPerson).ToEncryptedXml(), true); + + AjaxCallResult result = new AjaxCallResult {Success = true}; + return result; + } + + [WebMethod] + public static AjaxCallResult CheckMailFree (string mail) + { + People people = People.FromMail (mail); + // This should be zero + + if (people.Count == 0) + { + return new AjaxCallResult {Success = true}; + } + + return new AjaxCallResult {Success = false}; + } } } \ No newline at end of file diff --git a/Site5/Pages/v5/Public/WizardStyle.css b/Site5/Pages/v5/Public/WizardStyle.css index 3f9c5c70..0300a30c 100644 --- a/Site5/Pages/v5/Public/WizardStyle.css +++ b/Site5/Pages/v5/Public/WizardStyle.css @@ -198,7 +198,7 @@ body.rtl .swMain ul.anchor li a .stepDesc { /* background: #EA8511; */ } -.swMain ul.anchor li a.done { +.swMain ul.anchor li a.done:not(.crossout) { position:relative; color:#FFF; background: #8CC63F; @@ -228,6 +228,24 @@ body.rtl .swMain ul.anchor li a .stepDesc { background: #F8F8F8; } + +.swMain ul.anchor li a.crossout, .swMain ul.anchor li a.crossout:hover { + background: + linear-gradient(to top left, + rgba(0,0,0,0) 0%, + rgba(0,0,0,0) calc(50% - 2px), + rgba(0,0,0,.2) 50%, + rgba(0,0,0,0) calc(50% + 2px), + rgba(0,0,0,0) 100%), + linear-gradient(to top right, + rgba(0,0,0,0) 0%, + rgba(0,0,0,0) calc(50% - 2px), + rgba(0,0,0,.2) 50%, + rgba(0,0,0,0) calc(50% + 2px), + rgba(0,0,0,0) 100%); +} + + .swMain ul.anchor li a.error { color:#6c6c6c !important; background: #f08f75 !important;