Starting to test some controller
* BlogUnitTest.cs: Should test the user registration * NpgsqlBlogProvider.cs: Fixes usage of Npgsql upgrade to latest version * TestAPI.csproj: switch to .Net framework 4.5.1 * AccountController.cs: refactoring password validation * CalendarController.cs: * WorkFlowController.cs: SendActivationMessage became an extension method * style.css: menu items already have a background and color, since they're `<A>` tags * Unregister.aspx: * AccountController.cs: refactoring user registration * BlogsController.cs: Fixes a confusion between Author and reader ... * YavscHelpers.cs: refactoring the password reset * App.master: no more <div class="menuitem">, they're hyperlinks * Login.aspx: * Profile.aspx: refactoring the user registration * BlogEntryCollection.cs: implements a method to filter a given post collection in order to be displayed tu a given user or anonymous
This commit is contained in:
@ -72,7 +72,7 @@ namespace Yavsc.ApiControllers
|
||||
break;
|
||||
case MembershipCreateStatus.Success:
|
||||
if (!model.IsApprouved)
|
||||
YavscHelpers.SendActivationMessage (user);
|
||||
Url.SendActivationMessage (user);
|
||||
ProfileBase prtu = ProfileBase.Create (model.UserName);
|
||||
prtu.SetPropertyValue("Name",model.Name);
|
||||
prtu.SetPropertyValue("Address",model.Address);
|
||||
@ -99,9 +99,12 @@ namespace Yavsc.ApiControllers
|
||||
public void ResetPassword(LostPasswordModel model)
|
||||
{
|
||||
StringDictionary errors;
|
||||
YavscHelpers.ResetPassword (model, out errors);
|
||||
MembershipUser user;
|
||||
YavscHelpers.ValidatePasswordReset (model, out errors, out user);
|
||||
foreach (string key in errors.Keys)
|
||||
ModelState.AddModelError (key, errors [key]);
|
||||
if (user != null && ModelState.IsValid)
|
||||
Url.SendActivationMessage (user);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -27,6 +27,7 @@ using Yavsc.Helpers;
|
||||
using System.Web.Profile;
|
||||
using Yavsc.Model.Circles;
|
||||
using Yavsc.Model.Calendar;
|
||||
using System.Web.Http.Routing;
|
||||
|
||||
|
||||
namespace Yavsc.ApiControllers
|
||||
@ -160,7 +161,7 @@ namespace Yavsc.ApiControllers
|
||||
"déjà enregistré");
|
||||
break;
|
||||
case MembershipCreateStatus.Success:
|
||||
YavscHelpers.SendActivationMessage (user);
|
||||
Url.SendActivationMessage (user);
|
||||
// TODO set registration id
|
||||
throw new NotImplementedException ();
|
||||
}
|
||||
|
@ -85,7 +85,8 @@ namespace Yavsc.ApiControllers
|
||||
return ;
|
||||
case MembershipCreateStatus.Success:
|
||||
if (!userModel.IsApprouved)
|
||||
YavscHelpers.SendActivationMessage (user);
|
||||
|
||||
Url.SendActivationMessage (user);
|
||||
return;
|
||||
default:
|
||||
throw new InvalidOperationException (string.Format("Unexpected user creation code :{0}",mcs));
|
||||
|
Reference in New Issue
Block a user