mirror of
https://github.com/OrchardCMS/Orchard.git
synced 2026-02-09 09:16:41 +08:00
#17714: Authentication in dev environments can bleed from other local sites.
Changed all instances of IsAuthenticated to WorkContext.CurrentUser != null, etc. --HG-- branch : 1.x
This commit is contained in:
@@ -1,7 +1,7 @@
|
||||
@using System.Web.Mvc;
|
||||
|
||||
<div class="user-display">
|
||||
@if (Request.IsAuthenticated) {
|
||||
@if (WorkContext.CurrentUser != null) {
|
||||
<span class="user-actions welcome">
|
||||
@T("Welcome, <strong>{0}</strong>!", new HtmlString(Html.ActionLink( WorkContext.CurrentUser.UserName, "ChangePassword", new { Controller = "Account", Area = "Orchard.Users" }).ToString()))
|
||||
</span>
|
||||
|
||||
@@ -25,13 +25,13 @@
|
||||
</div>
|
||||
}
|
||||
}
|
||||
else if(!Request.IsAuthenticated && !AuthorizedFor(Permissions.AddComment)) {
|
||||
else if (WorkContext.CurrentUser == null && !AuthorizedFor(Permissions.AddComment)) {
|
||||
<h2 id="add-comment">@T("Add a Comment")</h2>
|
||||
<p class="info message">@T("You must {0} to comment.", Html.ActionLink(T("log on").ToString(), "LogOn", new { Controller = "Account", Area = "Orchard.Users", ReturnUrl = string.Format("{0}#addacomment", Context.Request.RawUrl) }))</p>
|
||||
} else {
|
||||
using (Html.BeginForm("Create", "Comment", new { area = "Orchard.Comments" }, FormMethod.Post, new { @class = "comment-form" })) {
|
||||
@Html.ValidationSummary()
|
||||
if (!Request.IsAuthenticated) {
|
||||
if (WorkContext.CurrentUser == null) {
|
||||
|
||||
<fieldset class="who">
|
||||
<legend id="add-comment">@T("Add a Comment")</legend>
|
||||
@@ -55,7 +55,7 @@ using (Html.BeginForm("Create", "Comment", new { area = "Orchard.Comments" }, Fo
|
||||
@Html.Hidden("Email", WorkContext.CurrentUser.Email ?? "")
|
||||
}
|
||||
|
||||
<h2 id="commenter">@if (Request.IsAuthenticated) { @T("Hi, {0}!", Html.Encode(WorkContext.CurrentUser.UserName))}</h2>
|
||||
<h2 id="commenter">@if (WorkContext.CurrentUser != null) { @T("Hi, {0}!", Html.Encode(WorkContext.CurrentUser.UserName))}</h2>
|
||||
<fieldset class="what">
|
||||
<ol>
|
||||
<li>
|
||||
|
||||
Reference in New Issue
Block a user