Skip to content

Commit 011d08c

Browse files
author
gauffininteractive
committed
Corrected a few issues in the installation wizard.
1 parent beae4b5 commit 011d08c

File tree

7 files changed

+16
-35
lines changed

7 files changed

+16
-35
lines changed

src/Server/OneTrueError.SqlServer/Database.sql

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -327,4 +327,3 @@ BEGIN
327327
END
328328

329329
insert into Applications (Name, AppKey, CreatedById, CreatedAtUtc, ApplicationType, SharedSecret) VALUES('test', '13d82df603a845c7a27164c4fec19dd6', 1, GetUtcDate(), 'DesktopApplication', '6f0a0a7fac6d42caa7cc47bb34a6520b');
330-
insert into ApplicationMembers (AccountId, ApplicationId, EmailAddress, AddedAtUtc, AddedByName, Roles) SELECT 1, 1, (SELECT TOP 1 email FROM accounts), GetUtcDate(), 'admin', 'Admin,Member';

src/Server/OneTrueError.Web/Areas/Installation/Controllers/AccountController.cs

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@
66
using OneTrueError.App.Core.Users;
77
using OneTrueError.Infrastructure;
88
using OneTrueError.SqlServer.Core.Accounts;
9+
using OneTrueError.SqlServer.Core.Applications;
910
using OneTrueError.SqlServer.Core.Users;
1011
using OneTrueError.Web.Areas.Installation.Models;
1112
using OneTrueError.Web.Models;
@@ -50,6 +51,18 @@ public async Task<ActionResult> Admin(AccountViewModel model)
5051
var userRepos = new UserRepository(uow);
5152
await userRepos.CreateAsync(user);
5253

54+
var repos2 = new ApplicationRepository(uow);
55+
/*insert into ApplicationMembers (AccountId, ApplicationId, EmailAddress, AddedAtUtc, AddedByName, Roles) SELECT 1, 1, (SELECT TOP 1 email FROM accounts), GetUtcDate(), 'admin', 'Admin,Member';
56+
*/
57+
var tm = new ApplicationTeamMember(1, account.Email)
58+
{
59+
AccountId = account.Id,
60+
AddedByName = "system",
61+
Roles = new[] {"Admin, Member"},
62+
UserName = account.UserName
63+
};
64+
await repos2.CreateAsync(tm);
65+
5366
uow.SaveChanges();
5467
SessionUser.Current = new SessionUser(account.Id, model.UserName);
5568
return Redirect(Url.GetNextWizardStep());

src/Server/OneTrueError.Web/Areas/Installation/Controllers/SetupController.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -90,7 +90,7 @@ public ActionResult Basics(BasicsViewModel model)
9090
return Redirect(Url.GetNextWizardStep());
9191
}
9292

93-
[HttpPost]
93+
[HttpPost, AllowAnonymous]
9494
public ActionResult Activate()
9595
{
9696
ConfigurationManager.RefreshSection("appSettings");

src/Server/OneTrueError.Web/Nuget/ReadMe.txt

Lines changed: 0 additions & 31 deletions
This file was deleted.

src/Server/OneTrueError.Web/OneTrueError.Web.csproj

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -349,7 +349,6 @@
349349
<Content Include="favicon.ico" />
350350
<Content Include="fonts\glyphicons-halflings-regular.svg" />
351351
<Content Include="Global.asax" />
352-
<Content Include="Nuget\ReadMe.txt" />
353352
<Content Include="Scripts\alertify.js" />
354353
<Content Include="Scripts\alertify.min.js" />
355354
<Content Include="Scripts\Application.js" />

src/Server/OneTrueError.Web/app/Application.js

Lines changed: 1 addition & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

src/Server/OneTrueError.Web/app/Application.js.map

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)