mirror of
https://github.com/OrchardCMS/Orchard.git
synced 2025-09-22 20:13:50 +08:00
Merge
--HG-- branch : dev
This commit is contained in:
@@ -50,11 +50,15 @@ namespace Orchard.Setup.Controllers {
|
||||
|
||||
[HttpPost, ActionName("Index")]
|
||||
public ActionResult IndexPOST(SetupViewModel model) {
|
||||
try {
|
||||
if (!ModelState.IsValid) {
|
||||
return Index(model);
|
||||
}
|
||||
//HACK: (erikpo) Couldn't get a custom ValidationAttribute to validate two properties
|
||||
if (!model.DatabaseOptions && string.IsNullOrEmpty(model.DatabaseConnectionString))
|
||||
ModelState.AddModelError("DatabaseConnectionString", "A SQL connection string is required");
|
||||
|
||||
if (!ModelState.IsValid) {
|
||||
return Index(model);
|
||||
}
|
||||
|
||||
try {
|
||||
var shellSettings = new ShellSettings {
|
||||
Name = "default",
|
||||
DataProvider = model.DatabaseOptions ? "SQLite" : "SqlServer",
|
||||
|
@@ -4,6 +4,9 @@ using Orchard.Mvc.ViewModels;
|
||||
|
||||
namespace Orchard.Setup.ViewModels {
|
||||
public class SetupViewModel : BaseViewModel {
|
||||
public SetupViewModel() {
|
||||
DatabaseOptions = true;
|
||||
}
|
||||
[Required(ErrorMessage = "Site name is required."), StringLength(70, ErrorMessage = "Site name can be no longer than 70 characters.")]
|
||||
public string SiteName { get; set; }
|
||||
[Required(ErrorMessage = "User name is required."), StringLengthMin(3, ErrorMessage = "User name must be longer than 3 characters."), StringLength(25, ErrorMessage = "User name can be no longer than 25 characters.")]
|
||||
|
Reference in New Issue
Block a user