From 490ee91e4fcd0b7521ca3c8a7b9a8c0aa66671ca Mon Sep 17 00:00:00 2001 From: DavidCo Date: Fri, 12 Feb 2016 11:59:05 +0200 Subject: [PATCH 1/2] remove put and delete http request type --- .../AppCode/Api/BlogRollController.cs | 4 +- .../AppCode/Api/BlogsController.cs | 4 +- .../AppCode/Api/CategoriesController.cs | 4 +- .../AppCode/Api/CommentFilterController.cs | 4 +- .../AppCode/Api/CommentsController.cs | 4 +- .../AppCode/Api/FileManagerController.cs | 4 +- .../AppCode/Api/LogsController.cs | 2 +- .../AppCode/Api/LookupsController.cs | 2 +- .../AppCode/Api/PackagesController.cs | 14 +-- .../AppCode/Api/PagesController.cs | 4 +- .../AppCode/Api/PingServicesController.cs | 2 +- .../AppCode/Api/PostsController.cs | 5 +- .../AppCode/Api/RolesController.cs | 4 +- .../AppCode/Api/TagsController.cs | 4 +- .../AppCode/Api/TrashController.cs | 6 +- .../AppCode/Api/UsersController.cs | 6 +- .../AppCode/Api/WidgetsController.cs | 2 +- .../AppCode/App_Start/BlogEngineConfig.cs | 4 +- .../BlogEngine.NET/App_Data/customfields.xml | 36 +++--- .../f39c3289-e861-48f7-a4b7-edaaffe6f6dc.xml | 114 +++++++++--------- .../Scripts/angular-resource.js | 4 +- .../admin/app/content/posts/postController.js | 2 +- .../BlogEngine.NET/admin/app/data-service.js | 12 +- .../admin/app/editor/posteditorController.js | 2 +- 24 files changed, 127 insertions(+), 122 deletions(-) diff --git a/BlogEngine/BlogEngine.NET/AppCode/Api/BlogRollController.cs b/BlogEngine/BlogEngine.NET/AppCode/Api/BlogRollController.cs index 1fcbc2e6c..49fb10f83 100644 --- a/BlogEngine/BlogEngine.NET/AppCode/Api/BlogRollController.cs +++ b/BlogEngine/BlogEngine.NET/AppCode/Api/BlogRollController.cs @@ -73,7 +73,7 @@ public HttpResponseMessage Post(BlogRollRowItem item) return Request.CreateResponse(HttpStatusCode.Created, br); } - [HttpPut] + [HttpPost] public HttpResponseMessage Update([FromBody]BlogRollRowItem item) { var br = BlogRollItem.GetBlogRollItem(item.Id); @@ -91,7 +91,7 @@ public HttpResponseMessage Update([FromBody]BlogRollRowItem item) return Request.CreateResponse(HttpStatusCode.OK); } - [HttpPut] + [HttpPost] public HttpResponseMessage ProcessChecked([FromBody]List items) { if (items == null || items.Count == 0) diff --git a/BlogEngine/BlogEngine.NET/AppCode/Api/BlogsController.cs b/BlogEngine/BlogEngine.NET/AppCode/Api/BlogsController.cs index 9eb5d441f..0f5da491f 100644 --- a/BlogEngine/BlogEngine.NET/AppCode/Api/BlogsController.cs +++ b/BlogEngine/BlogEngine.NET/AppCode/Api/BlogsController.cs @@ -38,7 +38,7 @@ public HttpResponseMessage Post([FromBody]BlogItem item) return Request.CreateResponse(HttpStatusCode.Created, result); } - [HttpPut] + [HttpPost] public HttpResponseMessage Update([FromBody]BlogEngine.Core.Data.Models.Blog blog) { repository.Update(blog); @@ -53,7 +53,7 @@ public HttpResponseMessage Delete(string id) return Request.CreateResponse(HttpStatusCode.OK); } - [HttpPut] + [HttpPost] public HttpResponseMessage ProcessChecked([FromBody]List items) { if (items == null || items.Count == 0) diff --git a/BlogEngine/BlogEngine.NET/AppCode/Api/CategoriesController.cs b/BlogEngine/BlogEngine.NET/AppCode/Api/CategoriesController.cs index bf4e5700b..d5375fc2d 100644 --- a/BlogEngine/BlogEngine.NET/AppCode/Api/CategoriesController.cs +++ b/BlogEngine/BlogEngine.NET/AppCode/Api/CategoriesController.cs @@ -38,7 +38,7 @@ public HttpResponseMessage Post([FromBody]CategoryItem item) return Request.CreateResponse(HttpStatusCode.Created, result); } - [HttpPut] + [HttpPost] public HttpResponseMessage Update([FromBody]CategoryItem item) { repository.Update(item); @@ -53,7 +53,7 @@ public HttpResponseMessage Delete(string id) return Request.CreateResponse(HttpStatusCode.OK); } - [HttpPut] + [HttpPost] public HttpResponseMessage ProcessChecked([FromBody]List items) { if (items == null || items.Count == 0) diff --git a/BlogEngine/BlogEngine.NET/AppCode/Api/CommentFilterController.cs b/BlogEngine/BlogEngine.NET/AppCode/Api/CommentFilterController.cs index b95f4f922..d616e47ee 100644 --- a/BlogEngine/BlogEngine.NET/AppCode/Api/CommentFilterController.cs +++ b/BlogEngine/BlogEngine.NET/AppCode/Api/CommentFilterController.cs @@ -29,14 +29,14 @@ public HttpResponseMessage Post([FromBody]CommentFilterItem item) return Request.CreateResponse(HttpStatusCode.Created, result); } - [HttpPut] + [HttpPost] public HttpResponseMessage DeleteAll() { repository.RemoveAll(); return Request.CreateResponse(HttpStatusCode.OK); } - [HttpPut] + [HttpPost] public HttpResponseMessage ProcessChecked([FromBody]List items) { if (items == null || items.Count == 0) diff --git a/BlogEngine/BlogEngine.NET/AppCode/Api/CommentsController.cs b/BlogEngine/BlogEngine.NET/AppCode/Api/CommentsController.cs index 83114d81b..85b7fcd21 100644 --- a/BlogEngine/BlogEngine.NET/AppCode/Api/CommentsController.cs +++ b/BlogEngine/BlogEngine.NET/AppCode/Api/CommentsController.cs @@ -53,7 +53,7 @@ public HttpResponseMessage Delete(string id) return Request.CreateResponse(HttpStatusCode.OK); } - [HttpPut] + [HttpPost] public HttpResponseMessage ProcessChecked([FromBody]List items) { if (items == null || items.Count == 0) @@ -79,7 +79,7 @@ public HttpResponseMessage ProcessChecked([FromBody]List items) return Request.CreateResponse(HttpStatusCode.OK); } - [HttpPut] + [HttpPost] public HttpResponseMessage DeleteAll([FromBody]CommentItem item) { var action = Request.GetRouteData().Values["id"].ToString(); diff --git a/BlogEngine/BlogEngine.NET/AppCode/Api/FileManagerController.cs b/BlogEngine/BlogEngine.NET/AppCode/Api/FileManagerController.cs index cebca856a..46b66d461 100644 --- a/BlogEngine/BlogEngine.NET/AppCode/Api/FileManagerController.cs +++ b/BlogEngine/BlogEngine.NET/AppCode/Api/FileManagerController.cs @@ -21,7 +21,7 @@ public IEnumerable Get(int take = 10, int skip = 0, string path = return repository.Find(take, skip, path, order); } - [HttpPut] + [HttpPost] public HttpResponseMessage ProcessChecked([FromBody]List items) { if (items == null || items.Count == 0) @@ -46,7 +46,7 @@ public HttpResponseMessage ProcessChecked([FromBody]List items) return Request.CreateResponse(HttpStatusCode.OK); } - [HttpPut] + [HttpPost] public HttpResponseMessage AddFolder(FileInstance folder) { BlogService.CreateDirectory(folder.FullPath + "/" + folder.Name); diff --git a/BlogEngine/BlogEngine.NET/AppCode/Api/LogsController.cs b/BlogEngine/BlogEngine.NET/AppCode/Api/LogsController.cs index 254edb563..63d9d91b6 100644 --- a/BlogEngine/BlogEngine.NET/AppCode/Api/LogsController.cs +++ b/BlogEngine/BlogEngine.NET/AppCode/Api/LogsController.cs @@ -28,7 +28,7 @@ public IEnumerable GetLog() return new List(); } - [HttpPut] + [HttpPost] public HttpResponseMessage PurgeLog() { if (!Security.IsAuthorizedTo(BlogEngine.Core.Rights.AccessAdminPages)) diff --git a/BlogEngine/BlogEngine.NET/AppCode/Api/LookupsController.cs b/BlogEngine/BlogEngine.NET/AppCode/Api/LookupsController.cs index 1cc67f5bc..322c5af8d 100644 --- a/BlogEngine/BlogEngine.NET/AppCode/Api/LookupsController.cs +++ b/BlogEngine/BlogEngine.NET/AppCode/Api/LookupsController.cs @@ -18,7 +18,7 @@ public Lookups Get() return repository.GetLookups(); } - [HttpPut] + [HttpPost] public bool Update([FromBody]EditorOptions item) { try diff --git a/BlogEngine/BlogEngine.NET/AppCode/Api/PackagesController.cs b/BlogEngine/BlogEngine.NET/AppCode/Api/PackagesController.cs index ca5b8d870..3845b3f50 100644 --- a/BlogEngine/BlogEngine.NET/AppCode/Api/PackagesController.cs +++ b/BlogEngine/BlogEngine.NET/AppCode/Api/PackagesController.cs @@ -30,7 +30,7 @@ public HttpResponseMessage Get(string id) return Request.CreateResponse(HttpStatusCode.OK, result); } - [HttpPut] + [HttpPost] public HttpResponseMessage ProcessChecked([FromBody]List items) { if (items == null || items.Count == 0) @@ -82,7 +82,7 @@ public HttpResponseMessage ProcessChecked([FromBody]List items) } } - [HttpPut] + [HttpPost] public bool Update([FromBody]Package item) { try @@ -101,7 +101,7 @@ public bool Update([FromBody]Package item) } } - [HttpPut] + [HttpPost] public HttpResponseMessage Install(string id) { if (string.IsNullOrEmpty(id)) @@ -111,7 +111,7 @@ public HttpResponseMessage Install(string id) return Request.CreateResponse(HttpStatusCode.OK); } - [HttpPut] + [HttpPost] public HttpResponseMessage Uninstall(string id) { if (string.IsNullOrEmpty(id)) @@ -121,7 +121,7 @@ public HttpResponseMessage Uninstall(string id) return Request.CreateResponse(HttpStatusCode.OK); } - [HttpPut] + [HttpPost] public HttpResponseMessage Rate(string id, [FromBody]Review review) { if (review == null) return Request.CreateResponse(HttpStatusCode.ExpectationFailed, "Review can not be null"); @@ -133,7 +133,7 @@ public HttpResponseMessage Rate(string id, [FromBody]Review review) return Request.CreateResponse(HttpStatusCode.OK, result); } - [HttpPut] + [HttpPost] public bool Refresh() { try @@ -148,7 +148,7 @@ public bool Refresh() } } - [HttpPut] + [HttpPost] public HttpResponseMessage SetTheme(string id) { if (!string.IsNullOrEmpty(id)) diff --git a/BlogEngine/BlogEngine.NET/AppCode/Api/PagesController.cs b/BlogEngine/BlogEngine.NET/AppCode/Api/PagesController.cs index 971cb02f0..40660229c 100644 --- a/BlogEngine/BlogEngine.NET/AppCode/Api/PagesController.cs +++ b/BlogEngine/BlogEngine.NET/AppCode/Api/PagesController.cs @@ -38,14 +38,14 @@ public HttpResponseMessage Post([FromBody]PageDetail item) return Request.CreateResponse(HttpStatusCode.Created, result); } - [HttpPut] + [HttpPost] public HttpResponseMessage Update([FromBody]PageDetail item) { repository.Update(item, "update"); return Request.CreateResponse(HttpStatusCode.OK); } - [HttpPut] + [HttpPost] public HttpResponseMessage ProcessChecked([FromBody]List items) { if (items == null || items.Count == 0) diff --git a/BlogEngine/BlogEngine.NET/AppCode/Api/PingServicesController.cs b/BlogEngine/BlogEngine.NET/AppCode/Api/PingServicesController.cs index cda709776..813fcee2b 100644 --- a/BlogEngine/BlogEngine.NET/AppCode/Api/PingServicesController.cs +++ b/BlogEngine/BlogEngine.NET/AppCode/Api/PingServicesController.cs @@ -35,7 +35,7 @@ public HttpResponseMessage Post([FromBody]PingItem item) return Request.CreateResponse(HttpStatusCode.Created, pings); } - [HttpPut] + [HttpPost] public HttpResponseMessage ProcessChecked([FromBody]List items) { if (items == null || items.Count == 0) diff --git a/BlogEngine/BlogEngine.NET/AppCode/Api/PostsController.cs b/BlogEngine/BlogEngine.NET/AppCode/Api/PostsController.cs index 44f3eb1c1..1bbdca93a 100644 --- a/BlogEngine/BlogEngine.NET/AppCode/Api/PostsController.cs +++ b/BlogEngine/BlogEngine.NET/AppCode/Api/PostsController.cs @@ -30,6 +30,7 @@ public HttpResponseMessage Get(string id) return Request.CreateResponse(HttpStatusCode.OK, result); } + [HttpPost] public HttpResponseMessage Post([FromBody]PostDetail item) { var result = repository.Add(item); @@ -39,14 +40,14 @@ public HttpResponseMessage Post([FromBody]PostDetail item) return Request.CreateResponse(HttpStatusCode.Created, result); } - [HttpPut] + [HttpPost] public HttpResponseMessage Update([FromBody]PostDetail item) { repository.Update(item, "update"); return Request.CreateResponse(HttpStatusCode.OK); } - [HttpPut] + [HttpPost] public HttpResponseMessage ProcessChecked([FromBody]List items) { if (items == null || items.Count == 0) diff --git a/BlogEngine/BlogEngine.NET/AppCode/Api/RolesController.cs b/BlogEngine/BlogEngine.NET/AppCode/Api/RolesController.cs index 267348c56..db1fc4f15 100644 --- a/BlogEngine/BlogEngine.NET/AppCode/Api/RolesController.cs +++ b/BlogEngine/BlogEngine.NET/AppCode/Api/RolesController.cs @@ -57,7 +57,7 @@ public HttpResponseMessage Delete(string id) return Request.CreateResponse(HttpStatusCode.OK); } - [HttpPut] + [HttpPost] public HttpResponseMessage ProcessChecked([FromBody]List items) { if (items == null || items.Count == 0) @@ -92,7 +92,7 @@ public HttpResponseMessage GetUserRoles(string id) return Request.CreateResponse(HttpStatusCode.OK, result); } - [HttpPut] + [HttpPost] public HttpResponseMessage SaveRights([FromBody]List rights, string id) { repository.SaveRights(rights, id); diff --git a/BlogEngine/BlogEngine.NET/AppCode/Api/TagsController.cs b/BlogEngine/BlogEngine.NET/AppCode/Api/TagsController.cs index f612b9474..37756697e 100644 --- a/BlogEngine/BlogEngine.NET/AppCode/Api/TagsController.cs +++ b/BlogEngine/BlogEngine.NET/AppCode/Api/TagsController.cs @@ -20,7 +20,7 @@ public IEnumerable Get(int take = 10, int skip = 0, string postId = "", return repository.Find(take, skip, postId, order); } - [HttpPut] + [HttpPost] public HttpResponseMessage Update([FromBody]TagToUpdate tag) { repository.Save(tag.OldTag, tag.NewTag); @@ -33,7 +33,7 @@ public HttpResponseMessage Delete(string id) return Request.CreateResponse(HttpStatusCode.OK); } - [HttpPut] + [HttpPost] public HttpResponseMessage ProcessChecked([FromBody]List items) { if (items == null || items.Count == 0) diff --git a/BlogEngine/BlogEngine.NET/AppCode/Api/TrashController.cs b/BlogEngine/BlogEngine.NET/AppCode/Api/TrashController.cs index d9536419c..2ce13d202 100644 --- a/BlogEngine/BlogEngine.NET/AppCode/Api/TrashController.cs +++ b/BlogEngine/BlogEngine.NET/AppCode/Api/TrashController.cs @@ -20,21 +20,21 @@ public TrashVM Get(int type = 1, int take = 10, int skip = 0, string filter = "1 return repository.GetTrash((TrashType)type, take, skip, filter, order); } - [HttpPut] + [HttpPost] public HttpResponseMessage Purge(TrashItem item) { repository.Purge(item.ObjectType, item.Id); return Request.CreateResponse(HttpStatusCode.OK); } - [HttpPut] + [HttpPost] public HttpResponseMessage PurgeAll() { repository.PurgeAll(); return Request.CreateResponse(HttpStatusCode.OK); } - [HttpPut] + [HttpPost] public HttpResponseMessage Restore(TrashItem item) { repository.Restore(item.ObjectType, item.Id); diff --git a/BlogEngine/BlogEngine.NET/AppCode/Api/UsersController.cs b/BlogEngine/BlogEngine.NET/AppCode/Api/UsersController.cs index 154a63667..4a1bbc82d 100644 --- a/BlogEngine/BlogEngine.NET/AppCode/Api/UsersController.cs +++ b/BlogEngine/BlogEngine.NET/AppCode/Api/UsersController.cs @@ -38,21 +38,21 @@ public HttpResponseMessage Post([FromBody]BlogUser item) return Request.CreateResponse(HttpStatusCode.Created, result); } - [HttpPut] + [HttpPost] public HttpResponseMessage Update([FromBody]BlogUser item) { repository.Update(item); return Request.CreateResponse(HttpStatusCode.OK); } - [HttpPut] + [HttpPost] public HttpResponseMessage SaveProfile([FromBody]BlogUser item) { repository.SaveProfile(item); return Request.CreateResponse(HttpStatusCode.OK); } - [HttpPut] + [HttpPost] public HttpResponseMessage ProcessChecked([FromBody]List items) { if (items == null || items.Count == 0) diff --git a/BlogEngine/BlogEngine.NET/AppCode/Api/WidgetsController.cs b/BlogEngine/BlogEngine.NET/AppCode/Api/WidgetsController.cs index 59f244fb0..059627605 100644 --- a/BlogEngine/BlogEngine.NET/AppCode/Api/WidgetsController.cs +++ b/BlogEngine/BlogEngine.NET/AppCode/Api/WidgetsController.cs @@ -21,7 +21,7 @@ public WidgetsVM Get() return new WidgetsVM(); } - [HttpPut] + [HttpPost] public HttpResponseMessage Update([FromBody]List items) { if (repository.Update(items)) diff --git a/BlogEngine/BlogEngine.NET/AppCode/App_Start/BlogEngineConfig.cs b/BlogEngine/BlogEngine.NET/AppCode/App_Start/BlogEngineConfig.cs index 77e97aa9e..55009787a 100644 --- a/BlogEngine/BlogEngine.NET/AppCode/App_Start/BlogEngineConfig.cs +++ b/BlogEngine/BlogEngine.NET/AppCode/App_Start/BlogEngineConfig.cs @@ -199,8 +199,8 @@ static void RegisterWebApi(HttpConfiguration config) routeTemplate: "api/{controller}/{id}", defaults: new { id = RouteParameter.Optional } ); - - config.Routes.MapHttpRoute("DefaultApiWithActionAndId", "api/{controller}/{action}/{id}"); + + config.Routes.MapHttpRoute("DefaultApiWithActionAndId", "api/{controller}/{action}/{id}", defaults: new { id = RouteParameter.Optional }); config.Filters.Add(new UnauthorizedAccessExceptionFilterAttribute()); diff --git a/BlogEngine/BlogEngine.NET/App_Data/customfields.xml b/BlogEngine/BlogEngine.NET/App_Data/customfields.xml index 1bacaedb5..fd9e1134a 100644 --- a/BlogEngine/BlogEngine.NET/App_Data/customfields.xml +++ b/BlogEngine/BlogEngine.NET/App_Data/customfields.xml @@ -1,17 +1,21 @@ - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/BlogEngine/BlogEngine.NET/App_Data/posts/f39c3289-e861-48f7-a4b7-edaaffe6f6dc.xml b/BlogEngine/BlogEngine.NET/App_Data/posts/f39c3289-e861-48f7-a4b7-edaaffe6f6dc.xml index 86389abab..e8eea886f 100644 --- a/BlogEngine/BlogEngine.NET/App_Data/posts/f39c3289-e861-48f7-a4b7-edaaffe6f6dc.xml +++ b/BlogEngine/BlogEngine.NET/App_Data/posts/f39c3289-e861-48f7-a4b7-edaaffe6f6dc.xml @@ -1,58 +1,58 @@ - - - Admin - Welcome to BlogEngine.NET - If you see this post it means that BlogEngine.NET is running and the hard part of creating your own - <p>If you see this post it means that BlogEngine.NET is running and the hard part of creating your own blog is done. There is only a few things left to do.</p> -<h2>Write Permissions</h2> -<p>To be able to log in, write posts and customize blog, you need to enable write permissions on the App_Data and Custom folders. If your blog is hosted at a hosting provider, you can either log into your account&rsquo;s admin page or call the support.</p> -<p>If you wish to use a database to store your blog data, we still encourage you to enable this write access for an images you may wish to store for your blog posts.&nbsp; If you are interested in using Microsoft SQL Server, MySQL, SQL CE, or other databases, please see the <a href="http://dnbe.net/docs" target="_blank">BlogEngine docs</a> to get started.</p> -<h2>Security</h2> -<p>When you`ve got write permissions set, you need to change the username and password. Find the sign-in link located either at the bottom or top of the page depending on your current theme and click it. Now enter "admin" in both the username and password fields and click the button. You will now see an admin menu appear. It has a link to the "Users" admin page. From there you can change password, create new users and set roles and permissions. Passwords are hashed by default so you better configure email in settings for password recovery to work or <a href="http://dnbe.net/docs/post/frequently-asked-questions#HowdoIresetlostadminpassword" target="_blank">learn how to do it manually</a>.</p> -<h2>Configuration and Profile</h2> -<p>Now that you have your blog secured, take a look through the settings and give your new blog a title.&nbsp; BlogEngine.NET is set up to take full advantage of many semantic formats and technologies such as FOAF, SIOC and APML. It means that the content stored in your BlogEngine.NET installation will be fully portable and auto-discoverable.&nbsp; Be sure to fill in your author profile to take better advantage of this.</p> -<h2>Themes and Plugins</h2> -<p>One last thing to consider is customizing the look and behavior of your blog. We have themes and plugins available right out of the box. You can install more right from admin panel under Custom.</p> -<h2>On the web</h2> -<p>You can find news about BlogEngine.NET on the <a href="http://www.dotnetblogengine.net" target="_blank">official website</a>. For tutorials, documentation, tips and tricks visit our <a href="http://dnbe.net/docs" target="_blank">docs site</a>. The ongoing development of BlogEngine.NET can be followed at <a href="https://github.com/rxtur/BlogEngine.NET" target="_blank">Github</a>. You can also subscribe to our <a href="https://www.youtube.com/channel/UC8ahQ2C-V_YEE5es1IJCHgQ" target="_blank">Youtube channel</a>.</p> -<p>Good luck and happy writing.</p> -<p>The BlogEngine.NET team</p> - True - False - True - 2015-09-23 20:04:00 - 2015-09-23 21:07:50 - 0 - 0 - welcome-to-blogengine-net - - welcome - blog - - - - 2015-09-23 21:01:16 - Visitor1 - v1@us.com - - ::1 - Rule:authenticated - - Comment left by visitor1. - - - 2015-09-23 21:05:26 - Visitor2 - v2@us.com - - ::1 - Rule:authenticated - - Reply from visitor2 on comment by visitor1. - - - - 19770e74-9ec9-4cde-b2ab-e5051aaaf348 - - + + + Admin + Welcome to BlogEngine.NET 21 + If you see this post it means that BlogEngine.NET is running and the hard part of creating your own + <p>If you see this post it means that BlogEngine.NET is running and the hard part of creating your own blog is done. There is only a few things left to do.</p> +<h2>Write Permissions</h2> +<p>To be able to log in, write posts and customize blog, you need to enable write permissions on the App_Data and Custom folders. If your blog is hosted at a hosting provider, you can either log into your account&rsquo;s admin page or call the support.</p> +<p>If you wish to use a database to store your blog data, we still encourage you to enable this write access for an images you may wish to store for your blog posts.&nbsp; If you are interested in using Microsoft SQL Server, MySQL, SQL CE, or other databases, please see the <a href="http://dnbe.net/docs" target="_blank">BlogEngine docs</a> to get started.</p> +<h2>Security</h2> +<p>When you`ve got write permissions set, you need to change the username and password. Find the sign-in link located either at the bottom or top of the page depending on your current theme and click it. Now enter "admin" in both the username and password fields and click the button. You will now see an admin menu appear. It has a link to the "Users" admin page. From there you can change password, create new users and set roles and permissions. Passwords are hashed by default so you better configure email in settings for password recovery to work or <a href="http://dnbe.net/docs/post/frequently-asked-questions#HowdoIresetlostadminpassword" target="_blank">learn how to do it manually</a>.</p> +<h2>Configuration and Profile</h2> +<p>Now that you have your blog secured, take a look through the settings and give your new blog a title.&nbsp; BlogEngine.NET is set up to take full advantage of many semantic formats and technologies such as FOAF, SIOC and APML. It means that the content stored in your BlogEngine.NET installation will be fully portable and auto-discoverable.&nbsp; Be sure to fill in your author profile to take better advantage of this.</p> +<h2>Themes and Plugins</h2> +<p>One last thing to consider is customizing the look and behavior of your blog. We have themes and plugins available right out of the box. You can install more right from admin panel under Custom.</p> +<h2>On the web</h2> +<p>You can find news about BlogEngine.NET on the <a href="http://www.dotnetblogengine.net" target="_blank">official website</a>. For tutorials, documentation, tips and tricks visit our <a href="http://dnbe.net/docs" target="_blank">docs site</a>. The ongoing development of BlogEngine.NET can be followed at <a href="https://github.com/rxtur/BlogEngine.NET" target="_blank">Github</a>. You can also subscribe to our <a href="https://www.youtube.com/channel/UC8ahQ2C-V_YEE5es1IJCHgQ" target="_blank">Youtube channel</a>.</p> +<p>Good luck and happy writing.</p> +<p>The BlogEngine.NET team</p> + True + False + True + 2015-09-23 17:04:00 + 2016-02-08 21:23:38 + 0 + 0 + welcome-to-blogengine-net + + welcome + + + + 2015-09-23 21:01:16 + Visitor1 + v1@us.com + + ::1 + Rule:authenticated + + Comment left by visitor1. + + + 2015-09-23 21:05:26 + Visitor2 + v2@us.com + + ::1 + Rule:authenticated + + Reply from visitor2 on comment by visitor1. + + + + c223353c-1aef-4a46-afd1-cb61ab1a792d + 19770e74-9ec9-4cde-b2ab-e5051aaaf348 + + \ No newline at end of file diff --git a/BlogEngine/BlogEngine.NET/Scripts/angular-resource.js b/BlogEngine/BlogEngine.NET/Scripts/angular-resource.js index 3c6365158..dd06741ac 100644 --- a/BlogEngine/BlogEngine.NET/Scripts/angular-resource.js +++ b/BlogEngine/BlogEngine.NET/Scripts/angular-resource.js @@ -362,8 +362,8 @@ angular.module('ngResource', ['ng']). 'get': {method: 'GET'}, 'save': {method: 'POST'}, 'query': {method: 'GET', isArray: true}, - 'remove': {method: 'DELETE'}, - 'delete': {method: 'DELETE'} + 'remove': { method: 'GET' }, + 'delete': { method: 'GET' } } }; diff --git a/BlogEngine/BlogEngine.NET/admin/app/content/posts/postController.js b/BlogEngine/BlogEngine.NET/admin/app/content/posts/postController.js index c12ad5234..0aa8cef33 100644 --- a/BlogEngine/BlogEngine.NET/admin/app/content/posts/postController.js +++ b/BlogEngine/BlogEngine.NET/admin/app/content/posts/postController.js @@ -5,7 +5,7 @@ $scope.reverse = true; $scope.load = function () { - var url = '/api/posts'; + var url = '/api/posts/'; var p = { take: 0, skip: 0 } spinOn(); diff --git a/BlogEngine/BlogEngine.NET/admin/app/data-service.js b/BlogEngine/BlogEngine.NET/admin/app/data-service.js index 6dd78dd62..f68cdba86 100644 --- a/BlogEngine/BlogEngine.NET/admin/app/data-service.js +++ b/BlogEngine/BlogEngine.NET/admin/app/data-service.js @@ -20,14 +20,14 @@ if (item.Id) { return $http({ url: webRoot(url) + "/" + item.Id, - method: 'DELETE', + method: 'GET', headers: { 'x-blog-instance': SiteVars.BlogInstanceId } }); } else { return $http({ url: webRoot(url), - method: 'DELETE', + method: 'GET', data: item, headers: { 'Content-Type': 'application/json', 'x-blog-instance': SiteVars.BlogInstanceId } }); @@ -38,7 +38,7 @@ deleteById: function (url, id) { return $http({ url: webRoot(url) + "/" + id, - method: 'DELETE', + method: 'GET', headers: { 'x-blog-instance': SiteVars.BlogInstanceId } }); }, @@ -46,7 +46,7 @@ deleteChecked: function (url, items) { return $http({ url: webRoot(url) + url, - method: 'DELETE', + method: 'GET', data: items, headers: { 'x-blog-instance': SiteVars.BlogInstanceId } }); @@ -54,7 +54,7 @@ updateItem: function (url, item) { return $http({ url: webRoot(url), - method: 'PUT', + method: 'POST', data: item, headers: { 'x-blog-instance': SiteVars.BlogInstanceId } }); @@ -63,7 +63,7 @@ processChecked: function (url, items) { return $http({ url: webRoot(url), - method: 'PUT', + method: 'POST', data: items, headers: { 'x-blog-instance': SiteVars.BlogInstanceId } }); diff --git a/BlogEngine/BlogEngine.NET/admin/app/editor/posteditorController.js b/BlogEngine/BlogEngine.NET/admin/app/editor/posteditorController.js index d95470fdd..98f21d223 100644 --- a/BlogEngine/BlogEngine.NET/admin/app/editor/posteditorController.js +++ b/BlogEngine/BlogEngine.NET/admin/app/editor/posteditorController.js @@ -125,7 +125,7 @@ .error(function () { toastr.error($rootScope.lbl.updateFailed); spinOff(); }); } else { - dataService.addItem('api/posts', $scope.post) + dataService.addItem('api/posts/post/', $scope.post) .success(function (data) { toastr.success($rootScope.lbl.postAdded); if (data.Id) { From 8f63cc35bcc8449f6d49088c464f7c30105fd333 Mon Sep 17 00:00:00 2001 From: DavidCo Date: Sat, 13 Feb 2016 16:46:25 +0200 Subject: [PATCH 2/2] fix errors after removing put and delete http requests --- .../BlogEngine.NET/AppCode/Api/SettingsController.cs | 1 + .../BlogEngine.NET/AppCode/App_Start/BlogEngineConfig.cs | 3 ++- .../admin/app/content/categories/categoryController.js | 8 ++++---- .../admin/app/content/comments/commentController.js | 4 ++-- .../admin/app/content/pages/pageController.js | 2 +- .../admin/app/content/posts/postController.js | 2 +- .../admin/app/dashboard/dashboardController.js | 2 +- .../admin/app/editor/pageeditorController.js | 4 ++-- .../admin/app/editor/posteditorController.js | 4 ++-- .../admin/app/security/profile/profileController.js | 2 +- .../admin/app/settings/settingController.js | 4 ++-- 11 files changed, 19 insertions(+), 17 deletions(-) diff --git a/BlogEngine/BlogEngine.NET/AppCode/Api/SettingsController.cs b/BlogEngine/BlogEngine.NET/AppCode/Api/SettingsController.cs index 6e72115d0..355e2cedd 100644 --- a/BlogEngine/BlogEngine.NET/AppCode/Api/SettingsController.cs +++ b/BlogEngine/BlogEngine.NET/AppCode/Api/SettingsController.cs @@ -28,6 +28,7 @@ public SettingsVM Get() return repository.Get(); } + [HttpPost] public HttpResponseMessage Put([FromBody]Settings settings, string action = "") { if (action == "testEmail") diff --git a/BlogEngine/BlogEngine.NET/AppCode/App_Start/BlogEngineConfig.cs b/BlogEngine/BlogEngine.NET/AppCode/App_Start/BlogEngineConfig.cs index 55009787a..4067f24eb 100644 --- a/BlogEngine/BlogEngine.NET/AppCode/App_Start/BlogEngineConfig.cs +++ b/BlogEngine/BlogEngine.NET/AppCode/App_Start/BlogEngineConfig.cs @@ -194,13 +194,14 @@ static void RegisterBundles(BundleCollection bundles) static void RegisterWebApi(HttpConfiguration config) { + config.Routes.MapHttpRoute("DefaultApiWithActionAndId", "api/{controller}/{action}/{id}", defaults: new { id = RouteParameter.Optional }); + config.Routes.MapHttpRoute( name: "DefaultApi", routeTemplate: "api/{controller}/{id}", defaults: new { id = RouteParameter.Optional } ); - config.Routes.MapHttpRoute("DefaultApiWithActionAndId", "api/{controller}/{action}/{id}", defaults: new { id = RouteParameter.Optional }); config.Filters.Add(new UnauthorizedAccessExceptionFilterAttribute()); diff --git a/BlogEngine/BlogEngine.NET/admin/app/content/categories/categoryController.js b/BlogEngine/BlogEngine.NET/admin/app/content/categories/categoryController.js index 9bc7812f7..8409f5d0e 100644 --- a/BlogEngine/BlogEngine.NET/admin/app/content/categories/categoryController.js +++ b/BlogEngine/BlogEngine.NET/admin/app/content/categories/categoryController.js @@ -6,7 +6,7 @@ $scope.focusInput = false; if ($scope.id) { - dataService.getItems('/api/categories', { Id: $scope.id }) + dataService.getItems('/api/categories/get/', { Id: $scope.id }) .success(function (data) { angular.copy(data, $scope.category); }) .error(function () { toastr.error($rootScope.lbl.errorLoadingCategory); }); $("#modal-add-cat").modal(); @@ -25,7 +25,7 @@ .error(function () { toastr.error("Error loading lookups"); }); var p = { skip: 0, take: 0 }; - dataService.getItems('/api/categories', p) + dataService.getItems('/api/categories/get/', p) .success(function (data) { angular.copy(data, $scope.items); gridInit($scope, $filter); @@ -43,7 +43,7 @@ return false; } if ($scope.category.Id) { - dataService.updateItem("/api/categories/update/" + $scope.category.Id, $scope.category) + dataService.updateItem('/api/categories/update/' + $scope.category.Id, $scope.category) .success(function (data) { toastr.success($rootScope.lbl.categoryUpdated); $scope.load(); @@ -51,7 +51,7 @@ .error(function (data) { toastr.error(data); }); } else { - dataService.addItem("/api/categories", $scope.category) + dataService.addItem('/api/categories/post', $scope.category) .success(function (data) { toastr.success($rootScope.lbl.categoryAdded); if (data.Id) { diff --git a/BlogEngine/BlogEngine.NET/admin/app/content/comments/commentController.js b/BlogEngine/BlogEngine.NET/admin/app/content/comments/commentController.js index 04d6024c4..519d8c1c5 100644 --- a/BlogEngine/BlogEngine.NET/admin/app/content/comments/commentController.js +++ b/BlogEngine/BlogEngine.NET/admin/app/content/comments/commentController.js @@ -34,7 +34,7 @@ $scope.showEditForm = function (id) { $scope.vm.SelectedItem = findInArray($scope.items, 'Id', id); - dataService.getItems("/api/comments/" + id) + dataService.getItems("/api/comments/get/" + id) .success(function (data) { angular.copy(data, $scope.vm.Detail); $("#modal-comment-edit").modal(); @@ -51,7 +51,7 @@ "PostId": postId, "Content": $scope.commentReply.text } - dataService.addItem("/api/comments", comment) + dataService.addItem("/api/comments/post", comment) .success(function (data) { toastr.success($rootScope.lbl.commentUpdated); $scope.load(); diff --git a/BlogEngine/BlogEngine.NET/admin/app/content/pages/pageController.js b/BlogEngine/BlogEngine.NET/admin/app/content/pages/pageController.js index 04c1fc274..b3cd018be 100644 --- a/BlogEngine/BlogEngine.NET/admin/app/content/pages/pageController.js +++ b/BlogEngine/BlogEngine.NET/admin/app/content/pages/pageController.js @@ -4,7 +4,7 @@ $scope.filter = ($location.search()).fltr; $scope.load = function () { - var url = '/api/pages'; + var url = '/api/pages/get/'; var p = { take: 0, skip: 0 } spinOn(); dataService.getItems('/api/pages', p) diff --git a/BlogEngine/BlogEngine.NET/admin/app/content/posts/postController.js b/BlogEngine/BlogEngine.NET/admin/app/content/posts/postController.js index 0aa8cef33..f907d9281 100644 --- a/BlogEngine/BlogEngine.NET/admin/app/content/posts/postController.js +++ b/BlogEngine/BlogEngine.NET/admin/app/content/posts/postController.js @@ -5,7 +5,7 @@ $scope.reverse = true; $scope.load = function () { - var url = '/api/posts/'; + var url = '/api/posts/get'; var p = { take: 0, skip: 0 } spinOn(); diff --git a/BlogEngine/BlogEngine.NET/admin/app/dashboard/dashboardController.js b/BlogEngine/BlogEngine.NET/admin/app/dashboard/dashboardController.js index 74609366a..8d68104cd 100644 --- a/BlogEngine/BlogEngine.NET/admin/app/dashboard/dashboardController.js +++ b/BlogEngine/BlogEngine.NET/admin/app/dashboard/dashboardController.js @@ -20,7 +20,7 @@ "HasCommentsEnabled": true, "IsPublished": false } - dataService.addItem('api/posts', draft) + dataService.addItem('api/posts/post/', draft) .success(function (data) { $scope.qd = angular.copy(newDraft); var dft = { diff --git a/BlogEngine/BlogEngine.NET/admin/app/editor/pageeditorController.js b/BlogEngine/BlogEngine.NET/admin/app/editor/pageeditorController.js index 3aa5f3f4f..c048018dc 100644 --- a/BlogEngine/BlogEngine.NET/admin/app/editor/pageeditorController.js +++ b/BlogEngine/BlogEngine.NET/admin/app/editor/pageeditorController.js @@ -32,7 +32,7 @@ $scope.loadPage = function () { spinOn(); - var url = '/api/pages/' + $scope.id; + var url = '/api/pages/get/' + $scope.id; dataService.getItems(url) .success(function (data) { angular.copy(data, $scope.page); @@ -88,7 +88,7 @@ }); } else { - dataService.addItem('/api/pages', $scope.page) + dataService.addItem('/api/pages/post/', $scope.page) .success(function (data) { toastr.success("Page added"); $log.log(data); diff --git a/BlogEngine/BlogEngine.NET/admin/app/editor/posteditorController.js b/BlogEngine/BlogEngine.NET/admin/app/editor/posteditorController.js index 98f21d223..2705e0c75 100644 --- a/BlogEngine/BlogEngine.NET/admin/app/editor/posteditorController.js +++ b/BlogEngine/BlogEngine.NET/admin/app/editor/posteditorController.js @@ -52,7 +52,7 @@ $scope.loadPost = function () { spinOn(); - var url = '/api/posts/' + $scope.id; + var url = '/api/posts/get/' + $scope.id; dataService.getItems(url) .success(function (data) { angular.copy(data, $scope.post); @@ -182,7 +182,7 @@ $scope.refreshPost = function () { spinOn(); - var url = '/api/posts/' + $scope.id; + var url = '/api/posts/get/' + $scope.id; dataService.getItems(url) .success(function (data) { angular.copy(data, $scope.post); diff --git a/BlogEngine/BlogEngine.NET/admin/app/security/profile/profileController.js b/BlogEngine/BlogEngine.NET/admin/app/security/profile/profileController.js index b5e77bbec..9c5be86d6 100644 --- a/BlogEngine/BlogEngine.NET/admin/app/security/profile/profileController.js +++ b/BlogEngine/BlogEngine.NET/admin/app/security/profile/profileController.js @@ -10,7 +10,7 @@ $scope.load = function () { spinOn(); - dataService.getItems('/api/users/' + UserVars.Name) + dataService.getItems('/api/users/get/' + UserVars.Name) .success(function (data) { angular.copy(data, $scope.user); $scope.loadCustom(); diff --git a/BlogEngine/BlogEngine.NET/admin/app/settings/settingController.js b/BlogEngine/BlogEngine.NET/admin/app/settings/settingController.js index 2ee198ef1..e7c01576a 100644 --- a/BlogEngine/BlogEngine.NET/admin/app/settings/settingController.js +++ b/BlogEngine/BlogEngine.NET/admin/app/settings/settingController.js @@ -25,7 +25,7 @@ } $scope.loadSettings = function () { - dataService.getItems('/api/settings') + dataService.getItems('/api/settings/get') .success(function (data) { angular.copy(data, $scope.vm); $scope.settings = $scope.vm.Settings; @@ -63,7 +63,7 @@ $scope.settings.FacebookLanguage = $scope.selFacebookLanguage.OptionValue; $scope.settings.txtErrorTitle = $scope.txtErrorTitle; - dataService.updateItem("/api/settings", $scope.settings) + dataService.updateItem("/api/settings/put", $scope.settings) .success(function (data) { toastr.success($rootScope.lbl.settingsUpdated); $scope.load();