Skip to content

Commit

Permalink
Completed auto installation feature.
Browse files Browse the repository at this point in the history
  • Loading branch information
binodnp committed Dec 15, 2015
1 parent 20741e8 commit 30a688f
Show file tree
Hide file tree
Showing 876 changed files with 292,281 additions and 25,338 deletions.
2 changes: 1 addition & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -5,4 +5,4 @@ obj
*.exe
*.suo
*.user
.db
.my
Binary file added designs/logo.psd
Binary file not shown.
7 changes: 7 additions & 0 deletions src/Frapid.Web.sln
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,8 @@ Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Frapid.Areas", "Libraries\F
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Frapid.NPoco", "Libraries\Frapid.NPoco\Frapid.NPoco.csproj", "{58F77141-FFE7-45F6-B726-80100204E69D}"
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Frapid.Installer", "Libraries\Frapid.Installer\Frapid.Installer.csproj", "{BFFE76A6-7E9D-42FA-AB3A-108BD2125923}"
EndProject
Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution
Debug|Any CPU = Debug|Any CPU
Expand Down Expand Up @@ -53,6 +55,10 @@ Global
{58F77141-FFE7-45F6-B726-80100204E69D}.Debug|Any CPU.Build.0 = Debug|Any CPU
{58F77141-FFE7-45F6-B726-80100204E69D}.Release|Any CPU.ActiveCfg = Release|Any CPU
{58F77141-FFE7-45F6-B726-80100204E69D}.Release|Any CPU.Build.0 = Release|Any CPU
{BFFE76A6-7E9D-42FA-AB3A-108BD2125923}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{BFFE76A6-7E9D-42FA-AB3A-108BD2125923}.Debug|Any CPU.Build.0 = Debug|Any CPU
{BFFE76A6-7E9D-42FA-AB3A-108BD2125923}.Release|Any CPU.ActiveCfg = Release|Any CPU
{BFFE76A6-7E9D-42FA-AB3A-108BD2125923}.Release|Any CPU.Build.0 = Release|Any CPU
EndGlobalSection
GlobalSection(SolutionProperties) = preSolution
HideSolutionNode = FALSE
Expand All @@ -64,5 +70,6 @@ Global
{88DFDF57-A52B-4D71-A0C4-BEF1A3839506} = {0DFA1BB9-74FE-4C63-B8AF-0B312ED992F6}
{0361910A-7773-4EE9-861B-FFC5636D82D1} = {0DFA1BB9-74FE-4C63-B8AF-0B312ED992F6}
{58F77141-FFE7-45F6-B726-80100204E69D} = {0DFA1BB9-74FE-4C63-B8AF-0B312ED992F6}
{BFFE76A6-7E9D-42FA-AB3A-108BD2125923} = {0DFA1BB9-74FE-4C63-B8AF-0B312ED992F6}
EndGlobalSection
EndGlobal
12 changes: 12 additions & 0 deletions src/Frapid.Web.sln.DotSettings
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
<wpf:ResourceDictionary xml:space="preserve" xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" xmlns:s="clr-namespace:System;assembly=mscorlib" xmlns:ss="urn:shemas-jetbrains-com:settings-storage-xaml" xmlns:wpf="http://schemas.microsoft.com/winfx/2006/xaml/presentation">
<s:String x:Key="/Default/CodeInspection/Highlighting/InspectionSeverities/=ArrangeThisQualifier/@EntryIndexedValue">DO_NOT_SHOW</s:String>
<s:String x:Key="/Default/CodeInspection/Highlighting/InspectionSeverities/=SuggestVarOrType_005FBuiltInTypes/@EntryIndexedValue">SUGGESTION</s:String>
<s:String x:Key="/Default/CodeInspection/Highlighting/InspectionSeverities/=SuggestVarOrType_005FElsewhere/@EntryIndexedValue">SUGGESTION</s:String>
<s:String x:Key="/Default/CodeInspection/Highlighting/InspectionSeverities/=SuggestVarOrType_005FSimpleTypes/@EntryIndexedValue">SUGGESTION</s:String>




<s:String x:Key="/Default/CodeInspection/Highlighting/InspectionSeverities/=ThisInGlobalContext/@EntryIndexedValue">HINT</s:String>
<s:String x:Key="/Default/CodeStyle/CodeFormatting/CSharpCodeStyle/ThisQualifier/INSTANCE_MEMBERS_QUALIFY_MEMBERS/@EntryValue">15</s:String>
<s:String x:Key="/Default/CodeStyle/CSharpVarKeywordUsage/ForBuiltInTypes/@EntryValue">UseExplicitType</s:String></wpf:ResourceDictionary>
23 changes: 23 additions & 0 deletions src/Frapid.Web/AppInfo.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
{
"ApplicationName": "Frapid",
"AutoInstall": true,
"Thumbnail": null,
"Publisher": "MixERP Inc.",
"Url": "http://frapid.com",
"DocumentationUrl": "http://frapid.com",
"AssemblyName": null,
"Version": "1.0",
"RealeasedOn": null,
"Description": "Frapid",
"Category": "N/A",
"Bundle": "Frapid Framework",
"IsMeta": true,
"DbSchema": "i18n",
"BlankDbPath": "~/db/meta.sql",
"SampleDbPath": null,
"InstallSample": false,
"My": null,
"OverrideTemplatePath":"~/Override",
"OverrideDestination":"~/Catalogs/{0}",
"DependsOn": []
}
2 changes: 1 addition & 1 deletion src/Frapid.Web/Application/BundleConfig.cs
Original file line number Diff line number Diff line change
Expand Up @@ -195,7 +195,7 @@ private static string[] GetLibrariesScript()

private static string[] GetDashboardScript()
{
List<string> script = new List<string>
var script = new List<string>
{
"~/Scripts/jquery-1.9.1.js",
"~/Scripts/angular/angular.min.js",
Expand Down
8 changes: 4 additions & 4 deletions src/Frapid.Web/Application/ClassicAssemblyResolver.cs
Original file line number Diff line number Diff line change
Expand Up @@ -9,11 +9,11 @@ public class ClassicAssemblyResolver : DefaultAssembliesResolver
{
public override ICollection<Assembly> GetAssemblies()
{
ICollection<Assembly> baseAssemblies = base.GetAssemblies();
List<Assembly> assemblies = new List<Assembly>(baseAssemblies);
List<Assembly> items = FrapidApiController.GetMembers();
var baseAssemblies = base.GetAssemblies();
var assemblies = new List<Assembly>(baseAssemblies);
var items = FrapidApiController.GetMembers();

foreach (Assembly item in items)
foreach (var item in items)
{
baseAssemblies.Add(item);
}
Expand Down
13 changes: 6 additions & 7 deletions src/Frapid.Web/Application/DefaultAssemblyResolver.cs
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
using System;
using System.Collections.Generic;
using System.Collections.Generic;
using System.Reflection;
using System.Web.Http.Dispatcher;
using Frapid.Framework;
Expand All @@ -11,21 +10,21 @@ public class DefaultAssemblyResolver : DefaultAssembliesResolver
{
public override ICollection<Assembly> GetAssemblies()
{
ICollection<Assembly> baseAssemblies = base.GetAssemblies();
List<Assembly> assemblies = new List<Assembly>(baseAssemblies);
var baseAssemblies = base.GetAssemblies();
var assemblies = new List<Assembly>(baseAssemblies);

try
{
List<Assembly> items = FrapidApiController.GetMembers();
var items = FrapidApiController.GetMembers();

foreach (Assembly item in items)
foreach (var item in items)
{
baseAssemblies.Add(item);
}
}
catch (ReflectionTypeLoadException ex)
{
foreach (Exception exception in ex.LoaderExceptions)
foreach (var exception in ex.LoaderExceptions)
{
Log.Error("Could not load assemblies containing Frapid Web API. Exception: {Exception}", exception);
}
Expand Down
2 changes: 1 addition & 1 deletion src/Frapid.Web/Application/LogManager.cs
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ private static LoggerConfiguration GetConfiguration()
string minimumLogLevel = ConfigurationManager.GetConfigurationValue("ParameterConfigFileLocation",
"MinimumLogLevel");

LoggingLevelSwitch levelSwitch = new LoggingLevelSwitch();
var levelSwitch = new LoggingLevelSwitch();

LogEventLevel logLevel;
Enum.TryParse(minimumLogLevel, out logLevel);
Expand Down
4 changes: 2 additions & 2 deletions src/Frapid.Web/Application/StartupRegistration.cs
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,8 @@ public class StartupRegistration
{
public static void Register()
{
Type iType = typeof (IStartupRegistration);
IEnumerable<object> members = AppDomain.CurrentDomain.GetAssemblies()
var iType = typeof (IStartupRegistration);
var members = AppDomain.CurrentDomain.GetAssemblies()
.SelectMany(x => x.GetTypes())
.Where(x => iType.IsAssignableFrom(x) && !x.IsInterface && !x.IsAbstract)
.Select(Activator.CreateInstance);
Expand Down
23 changes: 23 additions & 0 deletions src/Frapid.Web/Areas/Frapid.Account/AppInfo.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
{
"ApplicationName": "Frapid.Account",
"AutoInstall": true,
"Thumbnail": null,
"Publisher": "MixERP Inc.",
"Url": "http://frapid.com",
"DocumentationUrl": "http://frapid.com",
"AssemblyName": "Frapid.Account",
"Version": "1.0",
"RealeasedOn": null,
"Description": "Frapid authentication module.",
"Category": "Core Modules",
"Bundle": "Frapid Framework",
"IsMeta": false,
"DbSchema": "account",
"BlankDbPath": "~/Areas/Frapid.Account/db/1.x/1.0/db-blank.sql",
"SampleDbPath": "~/Areas/Frapid.Account/db/1.x/1.0/db-sample.sql",
"InstallSample": true,
"My": "~/Areas/Frapid.Account/.my/db.sql",
"OverrideTemplatePath":"~/Areas/Frapid.Account/Override",
"OverrideDestination":"~/Catalogs/{0}/Areas",
"DependsOn": ["Frapid.Config", "Frapid.WebsiteBuilder"]
}
8 changes: 6 additions & 2 deletions src/Frapid.Web/Areas/Frapid.Account/Frapid.Account.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -94,12 +94,16 @@
<Private>True</Private>
</Reference>
<Reference Include="Microsoft.CSharp" />
<Reference Include="Mono.Security, Version=4.0.0.0, Culture=neutral, PublicKeyToken=0738eb9f132ed756, processorArchitecture=MSIL">
<HintPath>packages\Npgsql.2.2.6\lib\net45\Mono.Security.dll</HintPath>
<Private>True</Private>
</Reference>
<Reference Include="Newtonsoft.Json, Version=7.0.0.0, Culture=neutral, PublicKeyToken=30ad4fe6b2a6aeed, processorArchitecture=MSIL">
<HintPath>packages\Newtonsoft.Json.7.0.1\lib\net45\Newtonsoft.Json.dll</HintPath>
<Private>True</Private>
</Reference>
<Reference Include="Npgsql, Version=3.0.3.0, Culture=neutral, PublicKeyToken=5d8b90d52f46fda7, processorArchitecture=MSIL">
<HintPath>packages\Npgsql.3.0.3\lib\net45\Npgsql.dll</HintPath>
<Reference Include="Npgsql, Version=2.2.6.0, Culture=neutral, PublicKeyToken=5d8b90d52f46fda7, processorArchitecture=MSIL">
<HintPath>packages\Npgsql.2.2.6\lib\net45\Npgsql.dll</HintPath>
<Private>True</Private>
</Reference>
<Reference Include="System.Net.Http" />
Expand Down
25 changes: 22 additions & 3 deletions src/Frapid.Web/Areas/Frapid.Account/Messaging/ResetEmail.cs
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,9 @@
using Frapid.ApplicationState.Cache;
using Frapid.Account.DTO;
using Frapid.Messaging;
using Frapid.Messaging.DTO;
using Frapid.Messaging.Helpers;
using Frapid.WebsiteBuilder.ViewModels;

namespace Frapid.Account.Messaging
{
Expand Down Expand Up @@ -46,16 +49,32 @@ private string ParseTemplate(string template)
return parsed;
}

private EmailQueue GetEmail(string catalog, Reset model, string subject, string message)
{
Config config = new Config(catalog);

return new EmailQueue
{
AddedOn = DateTime.Now,
FromName = model.Name,
ReplyTo = model.Email,
Subject = subject,
Message = message,
SendTo = config.FromEmail
};
}

public async Task SendAsync()
{
string template = GetTemplate();
string parsed = ParseTemplate(template);
string subject = "Your Password Reset Link for " + HttpContext.Current.Request.Url.Authority;

MailQueueManager queue = new MailQueueManager(AppUsers.GetCatalog(), parsed, "", _resetDetails.Email,
subject);
var catalog = AppUsers.GetCatalog();
var email = this.GetEmail(catalog, this._resetDetails, subject, parsed);
var queue = new MailQueueManager(catalog, email);
queue.Add();
await queue.ProcessMailQueueAsync();
await queue.ProcessMailQueueAsync(EmailProcessor.GetDefault());
}
}
}
23 changes: 21 additions & 2 deletions src/Frapid.Web/Areas/Frapid.Account/Messaging/SignUpEmail.cs
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,8 @@
using Frapid.ApplicationState.Cache;
using Frapid.Account.DTO;
using Frapid.Messaging;
using Frapid.Messaging.DTO;
using Frapid.Messaging.Helpers;

namespace Frapid.Account.Messaging
{
Expand Down Expand Up @@ -48,15 +50,32 @@ private string ParseTemplate(string template)
return parsed;
}

private EmailQueue GetEmail(string catalog, Registration model, string subject, string message)
{
Config config = new Config(catalog);

return new EmailQueue
{
AddedOn = DateTime.Now,
FromName = model.Name,
ReplyTo = model.Email,
Subject = subject,
Message = message,
SendTo = config.FromEmail
};
}

public async Task SendAsync()
{
var template = this.GetTemplate();
var parsed = this.ParseTemplate(template);
var subject = "Confirm Your Registration at " + HttpContext.Current.Request.Url.Authority;

MailQueueManager queue = new MailQueueManager(AppUsers.GetCatalog(), parsed, "", this._registration.Email, subject);
var catalog = AppUsers.GetCatalog();
var email = this.GetEmail(catalog, this._registration, subject, parsed);
var queue = new MailQueueManager(catalog, email);
queue.Add();
await queue.ProcessMailQueueAsync();
await queue.ProcessMailQueueAsync(EmailProcessor.GetDefault());
}
}
}
24 changes: 21 additions & 3 deletions src/Frapid.Web/Areas/Frapid.Account/Messaging/WelcomeEmail.cs
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,8 @@
using Frapid.Account.DTO;
using Frapid.Account.Models;
using Frapid.Messaging;
using Frapid.Messaging.DTO;
using Frapid.Messaging.Helpers;

namespace Frapid.Account.Messaging
{
Expand Down Expand Up @@ -50,15 +52,31 @@ private string ParseTemplate(string template)
return parsed;
}

private EmailQueue GetEmail(string catalog, IUserInfo model, string subject, string message)
{
Config config = new Config(catalog);

return new EmailQueue
{
AddedOn = DateTime.Now,
FromName = model.Name,
ReplyTo = model.Email,
Subject = subject,
Message = message,
SendTo = config.FromEmail
};
}

public async Task SendAsync()
{
string template = GetTemplate();
string parsed = ParseTemplate(template);
string subject = "Welcome to " + HttpContext.Current.Request.Url.Authority;

MailQueueManager queue = new MailQueueManager(AppUsers.GetCatalog(), parsed, "", _user.Email, subject);
var catalog = AppUsers.GetCatalog();
var email = this.GetEmail(catalog, this._user, subject, parsed);
var queue = new MailQueueManager(catalog, email);
queue.Add();
await queue.ProcessMailQueueAsync();
await queue.ProcessMailQueueAsync(EmailProcessor.GetDefault());
}
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
<div style="padding:32px;">
<strong>Dear {{Name}}</strong>,
<br/>
<br/>
You've entered {{EmailAddress}} as the contact email address. To complete the process, we need to verify that this email address belongs to you. Simply click the link below and sign in using your email address and password.
<br/>
<br/>
<a href="{{VerificationLink}}">{{VerificationLink}}</a>
<br/>
<br/>
Thank You,
<br/>
<a href="{{SiteUrl}}">{{SiteUrl}}</a>
</div>
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
<div style="padding:32px;">
<strong>Dear {{Name}}</strong>,
<br/>
<br/>
You or someone pretending to be you has requested to reset your password on <a href="{{SiteUrl}}">{{SiteUrl}}</a>.
To reset your password, click on the following link:
<br/>
<br/>
<a href="{{ResetLink}}">{{ResetLink}}</a>
<br/>
<br/>
Please ignore this email if you did not request to reset your password.
The link will automatically expire in 24 hours.
<br/>
<br/>
Thank You,
<br/>
<a href="{{SiteUrl}}">{{SiteUrl}}</a>
</div>
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
<div style="padding:32px;">
<strong>Dear {{Name}}</strong>,
<br/>
<br/>
We are excited to have you on {{Domain}}. Because you have signed up using {{ProviderName}} in our website, an account was automatically created for you.
<br/>
<br/>
Thank You,
<br/>
<a href="{{SiteUrl}}">{{SiteUrl}}</a>
</div>
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
<div style="padding:32px;">
<strong>Dear {{Name}}</strong>,
<br/>
<br/>
Welcome to {{Domain}}, we are excited to have you with us! Sign-in to our website using this link:
<br/>
<br/>
<a href="{{SiteUrl}}/account/sign-in">{{SiteUrl}}/account/sign-in</a>
<br/>
<br/>
Thank You,
<br/>
<a href="{{SiteUrl}}">{{SiteUrl}}</a>
</div>
Loading

0 comments on commit 30a688f

Please sign in to comment.