captcha Support

This commit is contained in:
MaxKey
2022-03-15 15:37:19 +08:00
parent be44a579c6
commit 7f39c233f6
5 changed files with 109 additions and 65 deletions

View File

@@ -121,7 +121,7 @@ public class LoginEndpoint {
modelAndView.addObject("userDomainUrlJson", kerberosService.buildKerberosProxys());
}
Institutions inst = (Institutions)WebContext.getAttribute(WebConstants.CURRENT_INST);
modelAndView.addObject("isCaptcha", inst.isCaptchaSupport());
modelAndView.addObject("isCaptcha", inst.isTrueCaptchaSupport());
modelAndView.addObject("captcha", inst.getCaptcha());
modelAndView.addObject("sessionid", WebContext.getSession().getId());
//modelAndView.addObject("jwtToken",jwtLoginService.buildLoginJwt());

View File

@@ -67,7 +67,7 @@ public class LoginEndpoint {
ModelAndView modelAndView = new ModelAndView();
Institutions inst = (Institutions)WebContext.getAttribute(WebConstants.CURRENT_INST);
modelAndView.addObject("isRemeberMe", applicationConfig.getLoginConfig().isRemeberMe());
modelAndView.addObject("isCaptcha", inst.isCaptchaSupport());
modelAndView.addObject("isCaptcha", inst.isTrueCaptchaSupport());
modelAndView.addObject("captcha", inst.getCaptcha());
modelAndView.addObject("sessionid", WebContext.getSession().getId());
Object loginErrorMessage=WebContext.getAttribute(WebConstants.LOGIN_ERROR_SESSION_MESSAGE);

View File

@@ -242,8 +242,8 @@
<label class="col-sm-3 col-form-label"><@locale code="institutions.captchaSupport" /></label>
<div class="col-sm-9">
<select id="captchaSupport" name="captchaSupport" class="form-control form-select" >
<option value="YES" <#if 'YES'==model.captchaSupport!>selected</#if>><@locale code="common.text.yes"/></option>
<option value="NO" <#if 'NO'==model.captchaSupport!>selected</#if>><@locale code="common.text.no"/></option>
<option value="YES" <#if 'YES' == model.captchaSupport!>selected</#if>><@locale code="common.text.yes"/></option>
<option value="NO" <#if 'NO' == model.captchaSupport!>selected</#if>><@locale code="common.text.no"/></option>
</select>
</div>
</div>