mirror of
https://github.com/OrchardCMS/Orchard.git
synced 2025-09-20 02:37:55 +08:00
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:
@@ -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();
|
||||
}
|
||||
|
@@ -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>
|
||||
|
@@ -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>
|
@@ -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>
|
||||
|
Reference in New Issue
Block a user