#115 reading signup active status from configurations

This commit is contained in:
Hamid Reza Mohammadi 2021-05-14 09:42:30 +04:30
parent 8e92211670
commit 54f0ae807c
5 changed files with 12 additions and 20 deletions

View File

@ -186,15 +186,6 @@ namespace RMuseum.Controllers
return content;
}
/// <summary>
/// Is Sign-up enabled?
/// </summary>
/// <returns></returns>
protected override bool IsSignupEnabled()
{
return true;
}
}
}

View File

@ -55,12 +55,6 @@
<param name="forgotPasswordCallbackUrl"></param>
<returns>html content</returns>
</member>
<member name="M:RMuseum.Controllers.AppUserController.IsSignupEnabled">
<summary>
Is Sign-up enabled?
</summary>
<returns></returns>
</member>
<member name="M:RMuseum.Controllers.ArtifactController.Get(RSecurityBackend.Models.Generic.PagingParameterModel)">
<summary>
get all published artifacts (including CoverImage info but not items info)

View File

@ -58,10 +58,14 @@
"RootPath": "/home"
},
"AudioUploadService": {
"Enabled": "True",
"Enabled": "True",
"TempUploadPath": "C:\\tempaudio",
"LocalAudioRepositoryPath": "D:\\My Documents\\My Web Design\\ganjoor\\www\\i",
"CurrentSoundFilesFolder": "a2"
},
"SignUp": {
"Enabled": "True",
"VerifyEmail": "True"
},
"AllowedHosts": "*"
}

View File

@ -808,7 +808,7 @@ namespace RSecurityBackend.Controllers
[ProducesResponseType((int)HttpStatusCode.BadRequest, Type = typeof(string))]
public async Task<IActionResult> SignUp([FromBody] UnverifiedSignUpViewModel signUpViewModel)
{
if (!IsSignupEnabled())
if (!SignupEnabled)
return BadRequest("ثبت نام غیرفعال است.");
RServiceResult<bool> captchaRes = await _captchaService.Evaluate(signUpViewModel.CaptchaImageId, signUpViewModel.CaptchaValue);
@ -988,9 +988,12 @@ namespace RSecurityBackend.Controllers
/// Is Sign-up enabled?
/// </summary>
/// <returns></returns>
protected virtual bool IsSignupEnabled()
public bool SignupEnabled
{
return false;
get
{
return bool.Parse(Configuration.GetSection("SignUp")["Enabled"]);
}
}
/// <summary>

View File

@ -269,7 +269,7 @@
<param name="forgotPasswordCallbackUrl"></param>
<returns>html content</returns>
</member>
<member name="M:RSecurityBackend.Controllers.AppUserControllerBase.IsSignupEnabled">
<member name="P:RSecurityBackend.Controllers.AppUserControllerBase.SignupEnabled">
<summary>
Is Sign-up enabled?
</summary>