#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:
Dave Reed
2011-05-12 11:06:11 -07:00
parent 435b688816
commit 765cf34b83
2 changed files with 4 additions and 4 deletions

View File

@@ -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>

View File

@@ -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>