#185 added some settings for readonly mode
This commit is contained in:
parent
9454de0266
commit
44bec378ce
@ -10,5 +10,6 @@
|
||||
"GoogleAnalyticsCode": "",
|
||||
"APIRoot": "http://localhost:3439",
|
||||
"GlobalAPIRoot": "http://localhost:3439",
|
||||
"SiteUrl": "https://localhost:33081"
|
||||
"SiteUrl": "https://localhost:33081",
|
||||
"ReadOnlyMode": "False"
|
||||
}
|
||||
|
||||
@ -78,5 +78,6 @@
|
||||
"GDBListXMLFile": "D:\\My Documents\\My Web Design\\ganjoor\\www\\i\\android\\sitepoets.xml"
|
||||
},
|
||||
"WebServiceUrl": "http://localhost:3439",
|
||||
"ReadOnlyMode": "False",
|
||||
"AllowedHosts": "*"
|
||||
}
|
||||
|
||||
@ -827,6 +827,9 @@ namespace RSecurityBackend.Controllers
|
||||
[ProducesResponseType((int)HttpStatusCode.BadRequest, Type = typeof(string))]
|
||||
public async Task<IActionResult> SignUp([FromBody] UnverifiedSignUpViewModel signUpViewModel)
|
||||
{
|
||||
if (SiteInReadOnlyMode)
|
||||
return BadRequest("سایت به دلایل فنی مثل انتقال سرور موقتاً در حالت فقط خواندنی قرار دارد. لطفاً ساعاتی دیگر مجدداً برای ثبت نام تلاش کنید.");
|
||||
|
||||
if (!SignupEnabled)
|
||||
return BadRequest("ثبت نام غیرفعال است.");
|
||||
|
||||
@ -959,6 +962,17 @@ namespace RSecurityBackend.Controllers
|
||||
return Ok(true);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// read only mode
|
||||
/// </summary>
|
||||
public bool SiteInReadOnlyMode
|
||||
{
|
||||
get
|
||||
{
|
||||
return bool.Parse(Configuration["ReadOnlyMode"]);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// Is Sign-up enabled?
|
||||
|
||||
Loading…
Reference in New Issue
Block a user