Skip to content

Commit 1c7cc62

Browse files
author
gauffininteractive
committed
* Added .gitattributes to enforce line endings on .NET files.
* (Gitattribute generated changes) * installation area is now completety disabled once OTE is installed
1 parent 0192fd1 commit 1c7cc62

33 files changed

+6198
-6169
lines changed

.gitattributes

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
# Set the default behavior, in case people don't have core.autocrlf set.
2+
* text=auto
3+
4+
# Explicitly declare text files you want to always be normalized and converted
5+
# to native line endings on checkout.
6+
#*.c text
7+
#*.h text
8+
9+
# Declare files that will always have CRLF line endings on checkout.
10+
*.sln text eol=crlf
11+
*.csproj text filter=csprojarrange
12+
*.cs text eol=crlf
13+
*.cshtml text eol=crlf
14+
*.ts text eol=crlf
15+
16+
# Denote all files that are truly binary and should not be modified.
17+
*.png binary
18+
*.jpg binary
19+
*.gif binary
20+
*.obj binary
21+
*.exe binary
22+
*.dll binary
Lines changed: 154 additions & 154 deletions
Original file line numberDiff line numberDiff line change
@@ -1,155 +1,155 @@
1-
using System;
2-
using System.Collections.Generic;
3-
using System.Configuration;
4-
using System.Net.Http;
5-
using System.Threading.Tasks;
6-
using System.Web.Mvc;
7-
using OneTrueError.App.Configuration;
8-
using OneTrueError.Infrastructure;
9-
using OneTrueError.Infrastructure.Configuration;
10-
using OneTrueError.Web.Areas.Installation.Models;
11-
12-
namespace OneTrueError.Web.Areas.Installation.Controllers
13-
{
14-
public class SetupController : Controller
15-
{
16-
[HttpPost, AllowAnonymous]
17-
public ActionResult Activate()
18-
{
19-
ConfigurationManager.RefreshSection("appSettings");
20-
if (ConfigurationManager.AppSettings["Configured"] != "true")
21-
{
22-
return RedirectToAction("Completed", new
23-
{
24-
displayError = 1
25-
});
26-
}
27-
return Redirect("~/?#/welcome");
28-
}
29-
30-
public ActionResult Support()
31-
{
32-
return View(new SupportViewModel());
33-
}
34-
35-
[HttpPost]
36-
public async Task<ActionResult> Support(SupportViewModel model)
37-
{
38-
if (!ModelState.IsValid)
39-
return View(model);
40-
41-
try
42-
{
43-
var client = new HttpClient();
44-
var content =
45-
new FormUrlEncodedContent(new []
46-
{
47-
new KeyValuePair<string, string>("EmailAddress", model.Email),
48-
new KeyValuePair<string, string>("CompanyName", model.CompanyName)
49-
});
50-
await client.PostAsync("https://onetrueerror.com/support/register/", content);
51-
return Redirect(Url.GetNextWizardStep());
52-
}
53-
catch (Exception ex)
54-
{
55-
ModelState.AddModelError("", ex.Message);
56-
return View(model);
57-
}
58-
}
59-
60-
public ActionResult Basics()
61-
{
62-
var model = new BasicsViewModel();
63-
var config = ConfigurationStore.Instance.Load<BaseConfiguration>();
64-
if (config != null)
65-
{
66-
model.BaseUrl = config.BaseUrl.ToString();
67-
model.SupportEmail = config.SupportEmail;
68-
}
69-
else
70-
{
71-
model.BaseUrl = Request.Url.ToString().Replace("installation/setup/basics/", "").Replace("localhost", "yourServerName");
72-
ViewBag.NextLink = "";
73-
}
74-
75-
76-
return View(model);
77-
}
78-
79-
[HttpPost]
80-
public ActionResult Basics(BasicsViewModel model)
81-
{
82-
var settings = new BaseConfiguration();
83-
if (!model.BaseUrl.EndsWith("/"))
84-
model.BaseUrl += "/";
85-
86-
if (model.BaseUrl.IndexOf("localhost", StringComparison.OrdinalIgnoreCase) != -1)
87-
{
88-
ModelState.AddModelError("BaseUrl", "Use the servers real DNS name instead of 'localhost'. If you don't the Ajax request wont work as CORS would be enforced by IIS.");
89-
return View(model);
90-
}
91-
settings.BaseUrl = new Uri(model.BaseUrl);
92-
settings.SupportEmail = model.SupportEmail;
93-
ConfigurationStore.Instance.Store(settings);
94-
return Redirect(Url.GetNextWizardStep());
95-
}
96-
97-
98-
public ActionResult Completed(string displayError = null)
99-
{
100-
ViewBag.DisplayError = displayError == "1";
101-
return View();
102-
}
103-
104-
public ActionResult Errors()
105-
{
106-
var model = new ErrorTrackingViewModel();
107-
var config = ConfigurationStore.Instance.Load<OneTrueErrorConfigSection>();
108-
if (config != null)
109-
{
110-
model.ActivateTracking = config.ActivateTracking;
111-
model.ContactEmail = config.ContactEmail;
112-
model.InstallationId = config.InstallationId;
113-
}
114-
else
115-
ViewBag.NextLink = "";
116-
117-
return View("ErrorTracking", model);
118-
}
119-
120-
[HttpPost]
121-
public ActionResult Errors(ErrorTrackingViewModel model)
122-
{
123-
if (!ModelState.IsValid)
124-
return View("ErrorTracking", model);
125-
126-
var settings = new OneTrueErrorConfigSection();
127-
settings.ActivateTracking = model.ActivateTracking;
128-
settings.ContactEmail = model.ContactEmail;
129-
settings.InstallationId = model.InstallationId;
130-
ConfigurationStore.Instance.Store(settings);
131-
return Redirect(Url.GetNextWizardStep());
132-
}
133-
134-
// GET: Installation/Home
135-
public ActionResult Index()
136-
{
137-
try
138-
{
139-
ConnectionFactory.Create();
140-
}
141-
catch
142-
{
143-
ViewBag.Ready = false;
144-
}
145-
return View();
146-
}
147-
148-
protected override void OnActionExecuting(ActionExecutingContext filterContext)
149-
{
150-
ViewBag.PrevLink = Url.GetPreviousWizardStepLink();
151-
ViewBag.NextLink = Url.GetNextWizardStepLink();
152-
base.OnActionExecuting(filterContext);
153-
}
154-
}
1+
using System;
2+
using System.Collections.Generic;
3+
using System.Configuration;
4+
using System.Net.Http;
5+
using System.Threading.Tasks;
6+
using System.Web.Mvc;
7+
using OneTrueError.App.Configuration;
8+
using OneTrueError.Infrastructure;
9+
using OneTrueError.Infrastructure.Configuration;
10+
using OneTrueError.Web.Areas.Installation.Models;
11+
12+
namespace OneTrueError.Web.Areas.Installation.Controllers
13+
{
14+
public class SetupController : Controller
15+
{
16+
[HttpPost, AllowAnonymous]
17+
public ActionResult Activate()
18+
{
19+
ConfigurationManager.RefreshSection("appSettings");
20+
if (ConfigurationManager.AppSettings["Configured"] != "true")
21+
{
22+
return RedirectToAction("Completed", new
23+
{
24+
displayError = 1
25+
});
26+
}
27+
return Redirect("~/?#/welcome");
28+
}
29+
30+
public ActionResult Support()
31+
{
32+
return View(new SupportViewModel());
33+
}
34+
35+
[HttpPost]
36+
public async Task<ActionResult> Support(SupportViewModel model)
37+
{
38+
if (!ModelState.IsValid)
39+
return View(model);
40+
41+
try
42+
{
43+
var client = new HttpClient();
44+
var content =
45+
new FormUrlEncodedContent(new []
46+
{
47+
new KeyValuePair<string, string>("EmailAddress", model.Email),
48+
new KeyValuePair<string, string>("CompanyName", model.CompanyName)
49+
});
50+
await client.PostAsync("https://onetrueerror.com/support/register/", content);
51+
return Redirect(Url.GetNextWizardStep());
52+
}
53+
catch (Exception ex)
54+
{
55+
ModelState.AddModelError("", ex.Message);
56+
return View(model);
57+
}
58+
}
59+
60+
public ActionResult Basics()
61+
{
62+
var model = new BasicsViewModel();
63+
var config = ConfigurationStore.Instance.Load<BaseConfiguration>();
64+
if (config != null)
65+
{
66+
model.BaseUrl = config.BaseUrl.ToString();
67+
model.SupportEmail = config.SupportEmail;
68+
}
69+
else
70+
{
71+
model.BaseUrl = Request.Url.ToString().Replace("installation/setup/basics/", "").Replace("localhost", "yourServerName");
72+
ViewBag.NextLink = "";
73+
}
74+
75+
76+
return View(model);
77+
}
78+
79+
[HttpPost]
80+
public ActionResult Basics(BasicsViewModel model)
81+
{
82+
var settings = new BaseConfiguration();
83+
if (!model.BaseUrl.EndsWith("/"))
84+
model.BaseUrl += "/";
85+
86+
if (model.BaseUrl.IndexOf("localhost", StringComparison.OrdinalIgnoreCase) != -1)
87+
{
88+
ModelState.AddModelError("BaseUrl", "Use the servers real DNS name instead of 'localhost'. If you don't the Ajax request wont work as CORS would be enforced by IIS.");
89+
return View(model);
90+
}
91+
settings.BaseUrl = new Uri(model.BaseUrl);
92+
settings.SupportEmail = model.SupportEmail;
93+
ConfigurationStore.Instance.Store(settings);
94+
return Redirect(Url.GetNextWizardStep());
95+
}
96+
97+
98+
public ActionResult Completed(string displayError = null)
99+
{
100+
ViewBag.DisplayError = displayError == "1";
101+
return View();
102+
}
103+
104+
public ActionResult Errors()
105+
{
106+
var model = new ErrorTrackingViewModel();
107+
var config = ConfigurationStore.Instance.Load<OneTrueErrorConfigSection>();
108+
if (config != null)
109+
{
110+
model.ActivateTracking = config.ActivateTracking;
111+
model.ContactEmail = config.ContactEmail;
112+
model.InstallationId = config.InstallationId;
113+
}
114+
else
115+
ViewBag.NextLink = "";
116+
117+
return View("ErrorTracking", model);
118+
}
119+
120+
[HttpPost]
121+
public ActionResult Errors(ErrorTrackingViewModel model)
122+
{
123+
if (!ModelState.IsValid)
124+
return View("ErrorTracking", model);
125+
126+
var settings = new OneTrueErrorConfigSection();
127+
settings.ActivateTracking = model.ActivateTracking;
128+
settings.ContactEmail = model.ContactEmail;
129+
settings.InstallationId = model.InstallationId;
130+
ConfigurationStore.Instance.Store(settings);
131+
return Redirect(Url.GetNextWizardStep());
132+
}
133+
134+
// GET: Installation/Home
135+
public ActionResult Index()
136+
{
137+
try
138+
{
139+
ConnectionFactory.Create();
140+
}
141+
catch
142+
{
143+
ViewBag.Ready = false;
144+
}
145+
return View();
146+
}
147+
148+
protected override void OnActionExecuting(ActionExecutingContext filterContext)
149+
{
150+
ViewBag.PrevLink = Url.GetPreviousWizardStepLink();
151+
ViewBag.NextLink = Url.GetNextWizardStepLink();
152+
base.OnActionExecuting(filterContext);
153+
}
154+
}
155155
}
Lines changed: 24 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -1,25 +1,25 @@
1-
@{
2-
ViewBag.Title = "Installation - Completed";
3-
}
4-
<div class="container">
5-
<div class="col-lg-6">
6-
7-
<h2>Congratulations!</h2>
8-
9-
<p>The setup is now completed. You need to deactive this configuration part of OneTrueError for security reasons..</p>
10-
<p>
11-
Change the <code>Configured</code> appKey to <code>"true"</code> in your web.config. Then click "Complete" to start OneTrueError
12-
</p>
13-
@if (ViewBag.DisplayError)
14-
{
15-
<h3>Error!</h3>
16-
<div style="color: #990000; font-weight: bolder">
17-
Change the key in your web.config to this: <code>&lt;add key="Configured" value="true" /&gt;</code>. OneTrueError won't start otherwise.
18-
</div>
19-
}
20-
<form action="@Url.Action("Activate")" method="post">
21-
<button>Complete</button>
22-
</form>
23-
@Html.Raw(ViewBag.PrevStep)
24-
</div>
1+
@{
2+
ViewBag.Title = "Installation - Completed";
3+
}
4+
<div class="container">
5+
<div class="col-lg-6">
6+
7+
<h2>Congratulations!</h2>
8+
9+
<p>The setup is now completed. You need to deactive this configuration part of OneTrueError for security reasons..</p>
10+
<p>
11+
Change the <code>Configured</code> appKey to <code>"true"</code> in your web.config. Then click "Complete" to start OneTrueError
12+
</p>
13+
@if (ViewBag.DisplayError)
14+
{
15+
<h3>Error!</h3>
16+
<div style="color: #990000; font-weight: bolder">
17+
Change the key in your web.config to this: <code>&lt;add key="Configured" value="true" /&gt;</code>. OneTrueError won't start otherwise.
18+
</div>
19+
}
20+
<form action="@Url.Action("Activate")" method="post">
21+
<button>Complete</button>
22+
</form>
23+
@Html.Raw(ViewBag.PrevStep)
24+
</div>
2525
</div>

0 commit comments

Comments
 (0)