民営化を進め、BlogEngine.Net 設置
質問
していblogengine.net インストールが必要で力を省略
になっている研究プロジェクトに関の瞬間、もし自分のブログ/雑誌個までは特定の要件を満たすこととする。
たいのですが私の民営化blogEngine.net ト読者に分かるようなログインする必要があ読みん?
解決
その結果が、先ほど任天堂さんいます。うファイルに保存しなさいRequireLogin.csおApp_Code\拡張子のフォルダっていることを確認してください拡張を起動します。
using System;
using System.Data;
using System.Configuration;
using System.Web;
using System.Web.Security;
using System.Web.UI;
using System.Web.UI.HtmlControls;
using System.Web.UI.WebControls;
using System.Web.UI.WebControls.WebParts;
using BlogEngine.Core;
using BlogEngine.Core.Web.Controls;
using System.Collections.Generic;
/// <summary>
/// Summary description for PostSecurity
/// </summary>
[Extension("Checks to see if a user can see this blog post.",
"1.0", "<a href=\"http://www.lavablast.com\">LavaBlast.com</a>")]
public class RequireLogin
{
static protected ExtensionSettings settings = null;
public RequireLogin()
{
Post.Serving += new EventHandler<ServingEventArgs>(Post_Serving);
ExtensionSettings s = new ExtensionSettings("RequireLogin");
// describe specific rules for entering parameters
s.Help = "Checks to see if the user has any of those roles before displaying the post. ";
s.Help += "You can associate a role with a specific category. ";
s.Help += "All posts having this category will require that the user have the role. ";
s.Help += "A parameter with only a role without a category will enable to filter all posts to this role. ";
ExtensionManager.ImportSettings(s);
settings = ExtensionManager.GetSettings("PostSecurity");
}
protected void Post_Serving(object sender, ServingEventArgs e)
{
MembershipUser user = Membership.GetUser();
if(HttpContext.Current.Request.RawUrl.Contains("syndication.axd"))
{
return;
}
if (user == null)
{
HttpContext.Current.Response.Redirect("~/Login.aspx");
}
}
}
他のヒント
うにコントロールパネルユーザーはタブの役割のサブ-タブ(右側)は、"匿名"の右側のツール、マウることを選択したものです。
に対する権利のページを匿名です。チェックを外も、特に"ビュー公共投稿".ただし、うまく管理できなければならないで少なくとも一つの項目にチェックそのものに戻すデフォルトに戻例えば、うるおいがもの足りないところは見適格投稿"を確認します。その後保存されます。
その方はログインしていない自動的にリダイレクトにログインページなどのページかのサイトです。
lomaxxの答えは動作しなかったので、私となることのないようにblogengine.net を行うauthたのです。
にiis、障害者の匿名のアクセスおよび追加についてはナビゲーションバーのwin2k3ユーザ一覧です。
また簡単なツールと特定のユーザーの特定の投稿によってASP.NET 会員の役割を占少しても同様に結果が得られます。
http://blog.lavablast.com/post/2008/08/BlogEnginenet-Post-Security.aspx
っと思ったりすることが可能なこのウェブコンフィグファイルによっては、次のようなもの:
<system.web>
<authorization>
<allow roles="Admin" />
<deny users="*" />
</authorization>
</system.web>