Browse Source

Formatting changes, remote admin bundle from git

master
Rohan Sircar 4 years ago
parent
commit
cfa6dc3c0b
  1. 18
      src/main/java/org/ros/chatto/controller/RegistrationController.java
  2. 22831
      src/main/resources/static/js/adminBundle.js

18
src/main/java/org/ros/chatto/controller/RegistrationController.java

@ -64,13 +64,17 @@ public class RegistrationController {
log.warn("Registration input has errors!");
return "redirect:registration?error";
}
if (userService.getUser(userRegistrationDTO.getUserName()).isPresent()) {
if (userService.getUser(userRegistrationDTO.getUserName())
.isPresent()) {
return "redirect:registration?error&duplicate=true";
}
log.debug("Captcha text from user input = {}", userRegistrationDTO.getCaptchaInput());
log.debug("Captcha text from captcha map = {}", captchaMap.get(userRegistrationDTO.getCaptchaID()));
if (userRegistrationDTO.getCaptchaInput().equals(captchaMap.get(userRegistrationDTO.getCaptchaID()))) {
log.debug("Captcha text from user input = {}",
userRegistrationDTO.getCaptchaInput());
log.debug("Captcha text from captcha map = {}",
captchaMap.get(userRegistrationDTO.getCaptchaID()));
if (userRegistrationDTO.getCaptchaInput()
.equals(captchaMap.get(userRegistrationDTO.getCaptchaID()))) {
log.info("Registration captcha equal success");
userService.createUser(userRegistrationDTO);
return "redirect:registration?success";
@ -81,12 +85,14 @@ public class RegistrationController {
}
@GetMapping(value = "/img/captcha/{image_id}", produces = MediaType.IMAGE_PNG_VALUE)
public ResponseEntity<byte[]> getImage(@PathVariable("image_id") Long imageId) throws IOException {
public ResponseEntity<byte[]> getImage(
@PathVariable("image_id") Long imageId) throws IOException {
final String captchaText = captchaMap.get(imageId);
final HttpHeaders headers = new HttpHeaders();
headers.setContentType(MediaType.IMAGE_PNG);
BufferedImage captchaBufferedImage = captchaService.createCaptchaImage(captchaText);
BufferedImage captchaBufferedImage = captchaService
.createCaptchaImage(captchaText);
ByteArrayOutputStream baos = new ByteArrayOutputStream();
ImageIO.write(captchaBufferedImage, "png", baos);

22831
src/main/resources/static/js/adminBundle.js
File diff suppressed because it is too large
View File

Loading…
Cancel
Save