* Web.csproj:

* Profile.aspx:
* MyProfile.aspx:
* AccountController.cs: renamed the Profile method to "MyProfile",
  could avoid issue at migrating to MVC5

* favicon.png: favicon now displays a ~"Yavsc"

* BlogManager.cs:
* BlogsApiController.cs: The authorisation for removing a post is now
  implemented at Manager's side

* BlogsController.cs: Removes this odd call to a static method from
  the Api controller

* CalendarApi.cs:
* GoogleController.cs: no more json output for the calls to the Google
  Api

* WorkFlowController.cs: sorted using clauses

* Basket.cs:
* Commande.cs:
* EstimToPdfFormatter.cs:
* Brand.cs: adds xml doc

* RssFeedsFormatter.cs: modifies xml doc

* TexToPdfFormatter.cs: refactoring

* Global.asax.cs: Document formatting

* BBCodeHelper.cs: encapsulates the url display from the BBCode in
  starting and closing characters : "<>"

* OAuth2.cs:
* SimpleJsonPostMethod.cs: using System.Runtime.Serialization.Json
  instead of Newtonsof.Json

* App.master: updating the favicon

* RegistrationPending.aspx: fixes the returnUrl usage

* AssemblyInfo.aspx: better explanation for this list

* Web.config: tried to migrate to MVC5 (using NuGets)

* Estim.cs:
* ChangePasswordModel.cs: adds xmldoc

* BasketController.cs:
* BlogProvidersConfigurationSection.cs: cosmetic change

* GoogleErrorMessage.cs: - adds xml docs
- renders ctor from JsonReaderException obsolete

* MvcActionValueBinder.cs: not used

* web.config: no more used, gave it up to migrate to MVC5
This commit is contained in:
Paul Schneider 2015-02-12 16:08:16 +01:00
commit e676d2fdbf
31 changed files with 246 additions and 234 deletions

View file

@ -255,7 +255,7 @@ namespace Yavsc.Controllers
/// <param name="model">Model.</param>
[Authorize]
[HttpGet]
public ActionResult Profile (Profile model)
public ActionResult MyProfile (Profile model)
{
string username = Membership.GetUser ().UserName;
ViewData ["UserName"] = username;
@ -272,7 +272,7 @@ namespace Yavsc.Controllers
[Authorize]
[HttpPost]
// ASSERT("Membership.GetUser ().UserName is made of simple characters, no slash nor backslash"
public ActionResult Profile (Profile model, HttpPostedFileBase AvatarFile)
public ActionResult MyProfile (Profile model, HttpPostedFileBase AvatarFile)
{
string username = Membership.GetUser ().UserName;
ViewData ["UserName"] = username;

View file

@ -21,6 +21,7 @@ namespace Yavsc.ApiControllers
/// The wfmgr.
/// </summary>
protected WorkFlowManager wfmgr = null;
/// <summary>
/// Initialize the specified controllerContext.
/// </summary>
@ -78,10 +79,7 @@ namespace Yavsc.ApiControllers
[AcceptVerbs("POST")]
public void Post(long itemId)
{
throw new NotImplementedException ();
}
}
}

View file

@ -51,16 +51,7 @@ namespace Yavsc.ApiControllers
/// </summary>
/// <param name="user">User.</param>
/// <param name="title">Title.</param>
public static void RemovePost(string user, string title) {
if (!Roles.IsUserInRole ("Admin")) {
string rguser = Membership.GetUser ().UserName;
if (rguser != user) {
throw new AccessViolationException (
string.Format (
"Vous n'avez pas le droit de suprimer des billets du Blog de {0}",
user));
}
}
public void RemovePost(string user, string title) {
BlogEntry e = BlogManager.GetPost (user, title);
if (e == null) {
throw new KeyNotFoundException (

View file

@ -342,7 +342,7 @@ namespace Yavsc.Controllers
ViewData["returnUrl"]=returnUrl;
if (!confirm)
return View ("RemovePost");
BlogsApiController.RemovePost (user,title);
BlogManager.RemovePost (user,title);
if (returnUrl == null)
RedirectToAction ("Index",new { user = user });
return Redirect (returnUrl);

View file

@ -241,10 +241,9 @@ namespace Yavsc.Controllers
});
}
string cred = OAuth2.GetFreshGoogleCredential (HttpContext.Profile);
string json;
CalendarApi c = new CalendarApi ();
CalendarList cl = c.GetCalendars (cred, out json);
ViewData ["json"] = json;
CalendarList cl = c.GetCalendars (cred);
ViewData ["returnUrl"] = returnUrl;
return View (cl);
}
@ -254,6 +253,7 @@ namespace Yavsc.Controllers
/// </summary>
/// <returns>The calendar.</returns>
/// <param name="calchoice">Calchoice.</param>
/// <param name="returnUrl">return Url.</param>
[HttpPost]
[Authorize]
public ActionResult SetCalendar (string calchoice,string returnUrl)
@ -318,9 +318,8 @@ namespace Yavsc.Controllers
CalendarApi c = new CalendarApi ();
CalendarEntryList res;
string responseStr;
try {
res = c.GetCalendar (calid, mindate, maxdate, upr, out responseStr);
res = c.GetCalendar (calid, mindate, maxdate, upr);
} catch (GoogleErrorException ex) {
ViewData ["Title"] = ex.Title;
ViewData ["Content"] = ex.Content;

View file

@ -1,14 +1,14 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Net.Http;
using System.Web;
using System.Web.Security;
using WorkFlowProvider;
using Yavsc.Model.WorkFlow;
using System.Web.Http.Controllers;
using System.Web.Security;
using System.Web.Http.ModelBinding;
using System.Net.Http;
using System.Web.Http;
using System.Web.Http.Controllers;
using System.Web.Http.ModelBinding;
namespace Yavsc.ApiControllers
{