private void ProtectArticle()
{
if (TheArticle == null)
{
DisableButtons();
return;
}
try
{
if (!TheSession.User.IsSysop)
{
MessageBox.Show(
"Current user doesn't have enough rights to protect \"" + TheSession.Page.Title + "\"",
"User rights not sufficient");
return;
}
string msg;
bool succeed = TheArticle.Protect(TheSession);
if (succeed)
msg = "Protected " + TheArticle.Name;
else
msg = "Protection of " + TheArticle.Name + " failed!";
articleActionLogControl1.LogArticleAction(TheArticle.Name, succeed, ArticleAction.Protect, msg);
StatusLabelText = msg;
}
catch (Exception ex)
{
ErrorHandler.HandleException(ex);
}
}
#endregion