* Web.csproj:
* T.cs: * IModule.cs: * App.master: * IProvider.cs: * Error.aspx: * AOEMail.aspx: * Login.aspx: * Index.aspx: * Admin.aspx: * yavscModel.csproj: * WFManager.cs: * Index.aspx: * AddRole.aspx: * Profile.aspx: * Edit.aspx: * Register.aspx: * Index.aspx: * RoleList.aspx: * UserList.aspx: * Validate.aspx: * RemovePost.aspx: * Index.aspx: * BasketImpact.cs: * Brand.aspx: * Delete.aspx: * Create.aspx: * Backups.aspx: * HomeController.cs: * BlogManager.cs: * Restore.aspx: * Details.aspx: * TitleNotFound.aspx: * Product.aspx: * AdminController.cs: * Command.aspx: * Service.aspx: * BlogProvider.cs: * NewProject.aspx: * Catalog.aspx: * Restored.aspx: * BasketController.cs: * AccountController.cs: * WorkFlowController.cs: * BlogsApiController.cs: * ChangePassword.aspx: * RemoveRoleQuery.aspx: * CreateBackup.aspx: * IContentProvider.cs: * BackOfficeController.cs: * FrontOfficeController.cs: * NpgsqlBlogProvider.cs: * NpgsqlContentProvider.cs: * RegistrationPending.aspx: * ProductCategory.aspx: * FrontOfficeApiController.cs: * ChangePasswordSuccess.aspx: * ReferenceNotFound.aspx: * BackupCreated.aspx Fixes many HTTP 500 Refactoring on the go
This commit is contained in:
parent
301dbdcb6d
commit
685c03b37e
59 changed files with 384 additions and 392 deletions
|
|
@ -12,7 +12,16 @@ namespace Yavsc.Controllers
|
|||
{
|
||||
public class BlogsApiController : Controller
|
||||
{
|
||||
public void Tag (long postid,string tag) {
|
||||
private const string adminRoleName = "Admin";
|
||||
protected override void Initialize (System.Web.Routing.RequestContext requestContext)
|
||||
{
|
||||
base.Initialize (requestContext);
|
||||
if (!Roles.RoleExists (adminRoleName)) {
|
||||
Roles.CreateRole (adminRoleName);
|
||||
}
|
||||
}
|
||||
|
||||
public long Tag (long postid,string tag) {
|
||||
BlogEntry e = BlogManager.GetPost (postid);
|
||||
if (!Roles.IsUserInRole ("Admin")) {
|
||||
string rguser = Membership.GetUser ().UserName;
|
||||
|
|
@ -23,6 +32,7 @@ namespace Yavsc.Controllers
|
|||
e.UserName));
|
||||
}
|
||||
}
|
||||
return BlogManager.Tag (postid, tag);
|
||||
}
|
||||
|
||||
public static HttpStatusCodeResult RemovePost(string user, string title) {
|
||||
|
|
@ -44,6 +54,10 @@ namespace Yavsc.Controllers
|
|||
BlogManager.RemovePost (user, title);
|
||||
return new HttpStatusCodeResult (200);
|
||||
}
|
||||
|
||||
public void RemoveTag(long tagid) {
|
||||
throw new NotImplementedException ();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Reference in a new issue