Fixing user registration to not sign the user in after account creation if new user accounts must be approved before use.

via the "Users must be approved before they can log in" site setting

--HG--
branch : dev
This commit is contained in:
Nathan Heskew
2010-11-05 15:18:26 -07:00
parent 3508ae7854
commit 26d34da16a
4 changed files with 13 additions and 1 deletions

View File

@@ -125,6 +125,10 @@ namespace Orchard.Users.Controllers {
return RedirectToAction("ChallengeEmailSent");
}
if (user.As<UserPart>().RegistrationStatus == UserStatus.Pending) {
return RedirectToAction("RegistrationPending");
}
_authenticationService.SignIn(user, false /* createPersistentCookie */);
return Redirect("~/");
}
@@ -174,6 +178,10 @@ namespace Orchard.Users.Controllers {
}
}
public ActionResult RegistrationPending() {
return View();
}
public ActionResult ChangePasswordSuccess() {
return View();
}

View File

@@ -128,6 +128,7 @@
</Content>
</ItemGroup>
<ItemGroup>
<Content Include="Views\Account\RegistrationPending.cshtml" />
<None Include="Views\EditorTemplates\Parts\User.Edit.cshtml" />
<None Include="Views\EditorTemplates\Parts\User.Create.cshtml" />
</ItemGroup>

View File

@@ -0,0 +1,3 @@
@model dynamic
<h1>@Html.TitleForPage(T("User Registration Pending").ToString()) </h1>
<p>@T("Your user account has been created but has to be approved before it can be used.")</p>

View File

@@ -9,7 +9,7 @@
</div>
<div>
@Html.EditorFor(m => m.UsersMustValidateEmail)
<label class="forcheckbox" for="@Html.FieldIdFor( m => m.UsersMustValidateEmail)">@T("Users must justify their email address")</label>
<label class="forcheckbox" for="@Html.FieldIdFor( m => m.UsersMustValidateEmail)">@T("Users must verify their email address")</label>
@Html.ValidationMessage("UsersMustValidateEmail", "*")
</div>
<div>