* New features:
- New Client at estimation, ala ajax - Admins can now edit user's profiles
This commit is contained in:
parent
d9728c5998
commit
0755dd62b3
33 changed files with 634 additions and 234 deletions
|
|
@ -62,29 +62,29 @@ namespace Yavsc.ApiControllers
|
|||
[HttpGet]
|
||||
[ValidateAjax]
|
||||
[Authorize(Roles="Admin,FrontOffice")]
|
||||
public void Register([FromBody] RegisterModel model)
|
||||
public void Register([FromBody] RegisterModel userModel)
|
||||
{
|
||||
if (ModelState.IsValid) {
|
||||
MembershipCreateStatus mcs;
|
||||
var user = Membership.CreateUser (
|
||||
model.UserName,
|
||||
model.Password,
|
||||
model.Email,
|
||||
userModel.UserName,
|
||||
userModel.Password,
|
||||
userModel.Email,
|
||||
null,
|
||||
null,
|
||||
model.IsApprouved,
|
||||
userModel.IsApprouved,
|
||||
out mcs);
|
||||
switch (mcs) {
|
||||
case MembershipCreateStatus.DuplicateEmail:
|
||||
ModelState.AddModelError ("Email",
|
||||
string.Format(LocalizedText.DuplicateEmail,model.UserName) );
|
||||
string.Format(LocalizedText.DuplicateEmail,userModel.UserName) );
|
||||
return ;
|
||||
case MembershipCreateStatus.DuplicateUserName:
|
||||
ModelState.AddModelError ("UserName",
|
||||
string.Format(LocalizedText.DuplicateUserName,model.Email));
|
||||
string.Format(LocalizedText.DuplicateUserName,userModel.Email));
|
||||
return ;
|
||||
case MembershipCreateStatus.Success:
|
||||
if (!model.IsApprouved)
|
||||
if (!userModel.IsApprouved)
|
||||
YavscHelpers.SendActivationEmail (user);
|
||||
return;
|
||||
default:
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue