From 6318e14bc8db7f388bba2d14be810d317390e203 Mon Sep 17 00:00:00 2001 From: Dmitry Isaenko Date: Thu, 28 Dec 2023 20:53:55 +0300 Subject: [PATCH] Add 'manage users' page; ability to remove users --- src/main/java/ru/redrise/marinesco/User.java | 5 +- .../ru/redrise/marinesco/UserGenerified.java | 27 +++++++ .../Validators/LoginOccupiedConstraint.java | 20 +++++ .../Validators/LoginOccupiedValidator.java | 22 ++++++ .../security/ManageUsersController.java | 61 ++++++++++++++++ .../security/RegistrationController.java | 6 +- .../marinesco/security/RegistrationForm.java | 2 +- .../marinesco/security/SecurityConfig.java | 4 +- .../security/UserSettingsController.java | 8 +- .../marinesco/web/HandyErrorController.java | 4 +- .../marinesco/web/RoleByIdConverter.java | 23 ++++++ src/main/resources/application.yml | 3 +- src/main/resources/static/images/logo.svg | 69 +++++------------- .../resources/templates/manage_users.html | 47 ++++++++++++ .../resources/templates/registration.html | 2 +- src/main/resources/templates/root.html | 4 + target/classes/application.yml | 3 +- .../classes/ru/redrise/marinesco/User.class | Bin 5303 -> 5365 bytes .../ru/redrise/marinesco/UserGenerified.class | Bin 0 -> 3908 bytes .../Validators/LoginOccupiedConstraint.class | Bin 0 -> 904 bytes .../Validators/LoginOccupiedValidator.class | Bin 0 -> 1738 bytes .../security/ManageUsersController.class | Bin 0 -> 3122 bytes .../security/RegistrationController.class | Bin 2777 -> 3300 bytes .../marinesco/security/SecurityConfig.class | Bin 10651 -> 10657 bytes .../security/UserSettingsController.class | Bin 4364 -> 4364 bytes .../marinesco/web/HandyErrorController.class | Bin 1187 -> 1389 bytes .../marinesco/web/RoleByIdConverter.class | Bin 0 -> 1322 bytes target/classes/static/images/logo.svg | 69 +++++------------- target/classes/templates/manage_users.html | 47 ++++++++++++ target/classes/templates/registration.html | 2 +- target/classes/templates/root.html | 4 + 31 files changed, 311 insertions(+), 121 deletions(-) create mode 100644 src/main/java/ru/redrise/marinesco/UserGenerified.java create mode 100644 src/main/java/ru/redrise/marinesco/Validators/LoginOccupiedConstraint.java create mode 100644 src/main/java/ru/redrise/marinesco/Validators/LoginOccupiedValidator.java create mode 100644 src/main/java/ru/redrise/marinesco/security/ManageUsersController.java create mode 100644 src/main/java/ru/redrise/marinesco/web/RoleByIdConverter.java create mode 100644 src/main/resources/templates/manage_users.html create mode 100644 target/classes/ru/redrise/marinesco/UserGenerified.class create mode 100644 target/classes/ru/redrise/marinesco/Validators/LoginOccupiedConstraint.class create mode 100644 target/classes/ru/redrise/marinesco/Validators/LoginOccupiedValidator.class create mode 100644 target/classes/ru/redrise/marinesco/security/ManageUsersController.class create mode 100644 target/classes/ru/redrise/marinesco/web/RoleByIdConverter.class create mode 100644 target/classes/templates/manage_users.html diff --git a/src/main/java/ru/redrise/marinesco/User.java b/src/main/java/ru/redrise/marinesco/User.java index 969bdf1..957fc05 100644 --- a/src/main/java/ru/redrise/marinesco/User.java +++ b/src/main/java/ru/redrise/marinesco/User.java @@ -5,6 +5,7 @@ import java.util.List; import org.springframework.security.core.userdetails.UserDetails; import jakarta.persistence.CascadeType; +import jakarta.persistence.Column; import jakarta.persistence.Entity; import jakarta.persistence.FetchType; import jakarta.persistence.GeneratedValue; @@ -29,6 +30,8 @@ public class User implements UserDetails{ @GeneratedValue(strategy = GenerationType.AUTO) private Long id; + @Column(unique=true) + //@LoginOccupiedConstraint private final String username; private String password; private String displayname; @@ -63,7 +66,7 @@ public class User implements UserDetails{ return true; } - public void setRole(UserRole role){ + public void setRole(UserRole role){ // TODO this.authorities.add(role); } } diff --git a/src/main/java/ru/redrise/marinesco/UserGenerified.java b/src/main/java/ru/redrise/marinesco/UserGenerified.java new file mode 100644 index 0000000..2f70581 --- /dev/null +++ b/src/main/java/ru/redrise/marinesco/UserGenerified.java @@ -0,0 +1,27 @@ +package ru.redrise.marinesco; + +import java.util.List; + +import lombok.Data; +import lombok.NoArgsConstructor; +import ru.redrise.marinesco.security.UserRole; + +@Data +@NoArgsConstructor +public class UserGenerified { + + private static final long serialVersionUID = 1L; + + private Long id; + + private String name; + private String displayName; + private List role; + + public UserGenerified(User user){ + this.id = user.getId(); + this.name = user.getUsername(); + this.displayName = user.getDisplayname(); + this.role = user.getAuthorities(); + } +} \ No newline at end of file diff --git a/src/main/java/ru/redrise/marinesco/Validators/LoginOccupiedConstraint.java b/src/main/java/ru/redrise/marinesco/Validators/LoginOccupiedConstraint.java new file mode 100644 index 0000000..e06157b --- /dev/null +++ b/src/main/java/ru/redrise/marinesco/Validators/LoginOccupiedConstraint.java @@ -0,0 +1,20 @@ +package ru.redrise.marinesco.Validators; + +import java.lang.annotation.Documented; +import java.lang.annotation.ElementType; +import java.lang.annotation.Retention; +import java.lang.annotation.RetentionPolicy; +import java.lang.annotation.Target; + +import jakarta.validation.Constraint; +import jakarta.validation.Payload; + +@Documented +@Constraint(validatedBy = LoginOccupiedValidator.class) +@Target({ElementType.METHOD, ElementType.FIELD}) +@Retention(RetentionPolicy.RUNTIME) +public @interface LoginOccupiedConstraint { + String message() default "Login already taken. Please use anohter one."; + Class[] groups() default {}; + Class[] payload() default {}; +} diff --git a/src/main/java/ru/redrise/marinesco/Validators/LoginOccupiedValidator.java b/src/main/java/ru/redrise/marinesco/Validators/LoginOccupiedValidator.java new file mode 100644 index 0000000..547dbf9 --- /dev/null +++ b/src/main/java/ru/redrise/marinesco/Validators/LoginOccupiedValidator.java @@ -0,0 +1,22 @@ +package ru.redrise.marinesco.Validators; + + +import org.springframework.beans.factory.annotation.Autowired; + +import jakarta.validation.ConstraintValidator; +import jakarta.validation.ConstraintValidatorContext; +import ru.redrise.marinesco.data.UserRepository; + +public class LoginOccupiedValidator implements ConstraintValidator{ + + @Autowired + private UserRepository userRepo; + + @Override + public void initialize(LoginOccupiedConstraint constraintAnnotation) {} + + @Override + public boolean isValid(String login, ConstraintValidatorContext context) { + return userRepo.findByUsername(login) == null; + } +} diff --git a/src/main/java/ru/redrise/marinesco/security/ManageUsersController.java b/src/main/java/ru/redrise/marinesco/security/ManageUsersController.java new file mode 100644 index 0000000..474e994 --- /dev/null +++ b/src/main/java/ru/redrise/marinesco/security/ManageUsersController.java @@ -0,0 +1,61 @@ +package ru.redrise.marinesco.security; + +import java.util.ArrayList; +import java.util.List; + +import org.springframework.security.access.prepost.PreAuthorize; +import org.springframework.stereotype.Controller; +import org.springframework.ui.Model; +import org.springframework.web.bind.annotation.GetMapping; +import org.springframework.web.bind.annotation.ModelAttribute; +import org.springframework.web.bind.annotation.PostMapping; +import org.springframework.web.bind.annotation.RequestMapping; + +import lombok.extern.slf4j.Slf4j; +import ru.redrise.marinesco.User; +import ru.redrise.marinesco.UserGenerified; +import ru.redrise.marinesco.data.UserRepository; + + +//TODO +@Slf4j +@Controller +@RequestMapping("/manage_users") +@PreAuthorize("hasRole('ADMIN')") +public class ManageUsersController { + + private UserRepository userRepository; + + public ManageUsersController(UserRepository userRepository){ + this.userRepository = userRepository; + } + + @ModelAttribute(name = "userGenerified") + public UserGenerified taco() { + return new UserGenerified(); + } + + @ModelAttribute + public void addUsers(Model model){ + Iterable users = userRepository.findAll(); + List usersGen = new ArrayList<>(); + for (User user : users){ + usersGen.add(new UserGenerified(user)); // TODO: ADD ARRAY INSTEAD OF ONE! + } + model.addAttribute("USR", usersGen); // TODO: ADD ARRAY INSTEAD OF ONE! + } + + @GetMapping + public String getPage() { + return "manage_users"; + } + + @PostMapping("/delete") + public String processDelete(UserGenerified userGenerified){ + log.info(userGenerified.toString()); + + userRepository.deleteById(userGenerified.getId()); + + return "redirect:/manage_users"; + } +} diff --git a/src/main/java/ru/redrise/marinesco/security/RegistrationController.java b/src/main/java/ru/redrise/marinesco/security/RegistrationController.java index 5a27943..9bd2899 100644 --- a/src/main/java/ru/redrise/marinesco/security/RegistrationController.java +++ b/src/main/java/ru/redrise/marinesco/security/RegistrationController.java @@ -10,9 +10,12 @@ import org.springframework.web.bind.annotation.PostMapping; import org.springframework.web.bind.annotation.RequestMapping; import jakarta.validation.Valid; +import lombok.extern.slf4j.Slf4j; import ru.redrise.marinesco.data.RolesRepository; import ru.redrise.marinesco.data.UserRepository; +import ru.redrise.marinesco.User; +@Slf4j @Controller @RequestMapping("/register") public class RegistrationController { @@ -46,7 +49,8 @@ public class RegistrationController { return "registration"; } - userRepo.save(registerForm.toUser(passwordEncoder, rolesRepo)); + User user = userRepo.save(registerForm.toUser(passwordEncoder, rolesRepo)); + log.info("Added user {} {} {}", user.getId(), user.getUsername(), user.getDisplayname()); return "redirect:/login"; } } diff --git a/src/main/java/ru/redrise/marinesco/security/RegistrationForm.java b/src/main/java/ru/redrise/marinesco/security/RegistrationForm.java index 4878494..bfc6b8f 100644 --- a/src/main/java/ru/redrise/marinesco/security/RegistrationForm.java +++ b/src/main/java/ru/redrise/marinesco/security/RegistrationForm.java @@ -11,7 +11,7 @@ import ru.redrise.marinesco.data.RolesRepository; @Data public class RegistrationForm { - + @NotNull @Size(min=3, max=32, message="Username must be at least 3 characters long. Should not exceed 32 characters.") private String username; diff --git a/src/main/java/ru/redrise/marinesco/security/SecurityConfig.java b/src/main/java/ru/redrise/marinesco/security/SecurityConfig.java index b45111a..1ecba52 100644 --- a/src/main/java/ru/redrise/marinesco/security/SecurityConfig.java +++ b/src/main/java/ru/redrise/marinesco/security/SecurityConfig.java @@ -52,11 +52,11 @@ public class SecurityConfig { .requestMatchers(mvc.pattern("/register")).permitAll() .requestMatchers(mvc.pattern("/login")).permitAll() .requestMatchers(mvc.pattern("/error")).permitAll() + .requestMatchers(PathRequest.toH2Console()).permitAll() .requestMatchers(mvc.pattern("/")).hasAnyRole("ADMIN", "USER") .requestMatchers(mvc.pattern("/profile/**")).hasAnyRole("ADMIN", "USER") - .requestMatchers(PathRequest.toH2Console()).permitAll() //.requestMatchers(mvc.pattern("/design/**")).hasRole("USER") - .anyRequest().denyAll()) + .anyRequest().authenticated()) //.anyRequest().permitAll()) .formLogin(formLoginConfigurer -> formLoginConfigurer .loginPage("/login") diff --git a/src/main/java/ru/redrise/marinesco/security/UserSettingsController.java b/src/main/java/ru/redrise/marinesco/security/UserSettingsController.java index cb03a4d..b0065f4 100644 --- a/src/main/java/ru/redrise/marinesco/security/UserSettingsController.java +++ b/src/main/java/ru/redrise/marinesco/security/UserSettingsController.java @@ -48,18 +48,16 @@ public class UserSettingsController { return "redirect:/profile/settings"; } - @GetMapping("/settings") public String getSettingsFirstPage(){ return "user_settings"; } - @PostMapping("/settings") public String getSettingsPage(@Valid UserSettingsForm userSettingsForm, - Errors errors, - @AuthenticationPrincipal User user, - Model model){ + Errors errors, + @AuthenticationPrincipal User user, + Model model){ if (errors.hasErrors()) return "user_settings"; if (! user.getDisplayname().equals(userSettingsForm.getDisplayname())) diff --git a/src/main/java/ru/redrise/marinesco/web/HandyErrorController.java b/src/main/java/ru/redrise/marinesco/web/HandyErrorController.java index ea7c21f..ef732ee 100644 --- a/src/main/java/ru/redrise/marinesco/web/HandyErrorController.java +++ b/src/main/java/ru/redrise/marinesco/web/HandyErrorController.java @@ -8,10 +8,12 @@ import org.springframework.web.bind.annotation.RequestMapping; import jakarta.servlet.RequestDispatcher; import jakarta.servlet.http.HttpServletRequest; +import lombok.extern.slf4j.Slf4j; +@Slf4j @Controller public class HandyErrorController implements ErrorController{ - + @ModelAttribute(name = "code") public String addMisc(HttpServletRequest request){ return request.getAttribute(RequestDispatcher.ERROR_STATUS_CODE).toString(); diff --git a/src/main/java/ru/redrise/marinesco/web/RoleByIdConverter.java b/src/main/java/ru/redrise/marinesco/web/RoleByIdConverter.java new file mode 100644 index 0000000..ad05d56 --- /dev/null +++ b/src/main/java/ru/redrise/marinesco/web/RoleByIdConverter.java @@ -0,0 +1,23 @@ +package ru.redrise.marinesco.web; + +import org.springframework.core.convert.converter.Converter; +import org.springframework.stereotype.Component; + +import ru.redrise.marinesco.data.RolesRepository; +import ru.redrise.marinesco.security.UserRole; + +@Component +public class RoleByIdConverter implements Converter{ + + private RolesRepository rolesRepository; + + public RoleByIdConverter(RolesRepository rolesRepository){ + this.rolesRepository = rolesRepository; + } + + @Override + public UserRole convert(Long id) { + return rolesRepository.findById(id).orElse(null); + } + +} diff --git a/src/main/resources/application.yml b/src/main/resources/application.yml index f9babf2..15da86f 100644 --- a/src/main/resources/application.yml +++ b/src/main/resources/application.yml @@ -1,9 +1,8 @@ - spring: thymeleaf: cache: false datasource: - driverClassName: org.h2.Driver + driver-class-name: org.h2.Driver generate-unique-name: false name: marinesco url: jdbc:h2:mem:marinesco diff --git a/src/main/resources/static/images/logo.svg b/src/main/resources/static/images/logo.svg index 7b90bd4..f6a4bcd 100644 --- a/src/main/resources/static/images/logo.svg +++ b/src/main/resources/static/images/logo.svg @@ -2,12 +2,12 @@ + ry="1.226432" /> - - - - - - - + style="color:#000000;fill:#15bade;-inkscape-stroke:none" + d="M 27.730628,1.5763661 C 25.036825,1.5596634 22.673126,2.2437308 20.494299,3.0548817 15.52534,4.9047658 11.509661,7.3067267 4.20719,6.2443347 l -0.2382811,-0.03516 -0.2402344,0.01563 c 0,0 -0.571584,0.03161 -1.09375,0.355469 -0.522166,0.323861 -1.0854728,1.181111 -1.1308594,1.90039 -0.031147,0.493776 0.1131821,1.217964 0.5546875,1.7480473 0.4415054,0.530084 1.3378907,0.798828 1.3378907,0.798828 l 0.056641,0.01172 0.056641,0.0078 C 12.15843,12.305276 17.748772,9.2542897 22.18766,7.6017457 c 2.225096,-0.828377 4.129469,-1.332733 6.328125,-1.154297 2.198656,0.178436 4.822312,1.053458 8.382812,3.423828 l 1.878907,1.2500003 0.002,-0.0039 0.002,0.002 1.875,-1.2500003 c 3.560451,-2.370338 6.184021,-3.243543 8.382812,-3.421875 2.198792,-0.178332 4.10494,0.325904 6.330078,1.154297 4.439025,1.652595 10.029323,4.7035173 18.677735,3.4453133 l 0.05078,-0.0078 0.04883,-0.0098 c 0,0 0.902708,-0.265223 1.347656,-0.796875 0.444949,-0.5316513 0.589732,-1.2583183 0.558594,-1.7519533 -0.04553,-0.721911 -0.612608,-1.579806 -1.134765,-1.902343 -0.522158,-0.322538 -1.091797,-0.353516 -1.091797,-0.353516 l -0.240235,-0.01563 -0.238281,0.03516 C 66.045442,7.3067127 62.031754,4.904815 57.062659,3.0548817 54.883831,2.2437293 52.518178,1.5596634 49.824378,1.5763661 c -0.385437,0.00239 -0.775891,0.018721 -1.171875,0.050781 -2.945866,0.2385075 -6.201654,1.4666842 -9.875,3.7734376 -3.672889,-2.3061606 -6.92781,-3.5330278 -9.873047,-3.7714845 -0.396002,-0.032061 -0.788428,-0.050345 -1.173828,-0.052734 z" + id="path1154" /> + style="opacity:1;fill:#00b185;fill-opacity:1;stroke:#ffffff;stroke-width:0.818;stroke-linejoin:round;stroke-dasharray:none;stroke-opacity:1;paint-order:stroke fill markers" + d="M 40.69873,4.1910257 47.085,1.9080267 c 0.0479,-0.017123 0.08973,0.04381 0.08973,0.09821 v 8.4513743 c 0,0.0544 -0.04003,0.09821 -0.08973,0.09821 0,0 -3.24318,-2.0452513 -3.24318,-3.8408703 0,-0.06402 0,-0.06402 0,0 0,1.794641 -3.14309,3.8409423 -3.14309,3.8409423 -0.03835,0.03461 -0.08973,-0.04381 -0.08973,-0.09821 V 4.2892377 c 0,-0.05441 0.08973,-0.097032 0.08973,-0.09821 z" + sodipodi:nodetypes="sssssssssscs" /> diff --git a/src/main/resources/templates/manage_users.html b/src/main/resources/templates/manage_users.html new file mode 100644 index 0000000..f63e49b --- /dev/null +++ b/src/main/resources/templates/manage_users.html @@ -0,0 +1,47 @@ + + + + + Marinesco - Manage users + + + + + +

Manage users

+
go back +

+

+ user + + user + +
+ + + + + + + + +
+
+
+ + + \ No newline at end of file diff --git a/src/main/resources/templates/registration.html b/src/main/resources/templates/registration.html index 4b7aa14..1da765e 100644 --- a/src/main/resources/templates/registration.html +++ b/src/main/resources/templates/registration.html @@ -5,7 +5,7 @@ Marinesco - registration form - + diff --git a/src/main/resources/templates/root.html b/src/main/resources/templates/root.html index df62e2f..3346843 100644 --- a/src/main/resources/templates/root.html +++ b/src/main/resources/templates/root.html @@ -11,6 +11,10 @@

Welcome to Marinesco


Login +
/profile +
/manage_users +
+
Log out \ No newline at end of file diff --git a/target/classes/application.yml b/target/classes/application.yml index f9babf2..15da86f 100644 --- a/target/classes/application.yml +++ b/target/classes/application.yml @@ -1,9 +1,8 @@ - spring: thymeleaf: cache: false datasource: - driverClassName: org.h2.Driver + driver-class-name: org.h2.Driver generate-unique-name: false name: marinesco url: jdbc:h2:mem:marinesco diff --git a/target/classes/ru/redrise/marinesco/User.class b/target/classes/ru/redrise/marinesco/User.class index ba7444b8d30287ad7a677589d5a9a9b576756502..b935bd455dde83ec9b299f21ebaa3194f19bef64 100644 GIT binary patch literal 5365 zcmb_gdv_FP8UIZ(yR(~2E`)Mfz?RZbb7iGeEgL{W2sD@gCJ-!m>16j!cF1NX?99@} zd$nq9y|rFi>;1|w*d`4y+?dMYUT`HO+7S}+atUUjZJ`HJH$<oo7le)%&O4QwO3_03&oI#DmMApcuw&Zymd0rKY|RVZ6*cb$?m|V4 zd!8RUAyozjc9MPBsfJE|RX!7h$}6h;REc8!ElH=9r>ahRFRk4}g5SHa zwyG#$j$gcRj)LO2$Cw!COBg*DO0dYbr{(u2{7P-bBRO63+-o(}u6@s}IzhnTG6J0? zH(0GWYg%=uQwz&JqwOlX8%L)Wx|RGiy``S)oV(;XVXaC#3fhi3`N(w3oY(Uw$)EKr zYU~&l?QLoAjN`3c@a2~*R?!KHPKjT7uqE?^CdY9~&rZ&qo1Zk0T2x`NY~X>GLZ^fn zi=-yUPfyM=I7eL14UZX^8qh99bs2|t^O$-d#s=pN1pgmhZzHJkRdd2GsSdPb*v7*c zG0;9RIG=@q12*o%Hi6z{Bd4K9Z0yp|qc(P9kAa?PHtN~h%7Ut1a9I6PY<`hl#SWHp zj5Nct%lg>eI^mLMrf++*B&#`=?wwIAveJ1+T0CSU8QAIuyU{1{1{=jU&m|j13!I>{PNz zXmzLF*Th^O1HyE^-rU_holN$(AjXp|UjJs@NoMZIy6!siZB!xsVbsN+t;q;Q?ns4p zlG?DaDT=Wd!qrW#CdmhhWLYMe{@;fG~aWfe)a_shD-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RfCtDKVUOB_BnsN3M94Z+fFFqmww(L9&tb6d(5_bf^z#LI&dQM19^^ zNQyZ>87QZqzQGE#{x1=ga~nwf}L+eFDOnLW{3EuV<;eGw~8 zt?AK4x~zRkozHRDwwQMQ4q+K?kdl#o1Dgye$G-!Xu|>+@V0acjDU+o-ft#fAN%H>; z`!g~OCSNHgoXcnY9_+`2aU5n3(8CzRtQ3~dzy`?sxhdEh1`qHf1XN*++x-!Hk&(z8 zpO$j`18vDZKdbz#ar+Vb4i6ie(`o+X**dA~oOv+#Y~4SNiX$G39Bw83^*wx_t4%XM T=I1APpF8=P`!oCkAE5Mq8xIlg literal 0 HcmV?d00001 diff --git a/target/classes/ru/redrise/marinesco/Validators/LoginOccupiedConstraint.class b/target/classes/ru/redrise/marinesco/Validators/LoginOccupiedConstraint.class new file mode 100644 index 0000000000000000000000000000000000000000..ebaf18834580c17c98ab25065faefff9e842f301 GIT binary patch literal 904 zcmb7C-%k@k5S}g26YvKpiYVCA2Lft(CO&9_nkX%iq}Zmdy!2_f8;*tTZnL{ba{rnS z{sI0`#<|w?npk6e*k3c>H}lQx{P_9pI{>_gFo24HH#UnbC006$hG?ZG7n|r5l}ykZ z>!OxPrEbS@Hj*xcLy1M=?q2Sx=W%$31J!0UOK7aaHst;gtk z(y^k_&V+JM@K<^!voRe>#c8(x(#v|$0RdaxOnW(`Q|aWHqOt{C#M7AyW}4bCaW*9F zDdAkTd1A^RW5nujm6UwS1-xzj*WXWPf&=Z$m(xd^l4t)CC(5|uXY+AQMTP2qJ|YHJ zPn!MD?FO@sj+-q$!}+W(c_wj(nX~&3NXIA{=L`(GU%&K^Pnx>|1T64c;^AN5*$vF?m0m z7>qs`-%R{b#xvWxR9u4iuyc0KoXdBH)r59jkC&XfvezujZz)*|^+_ZcvRh(D@P@GKe66}AEuBO!!_1c07Oob2ryWE& zHh<#So_2+@br^x6&-bLeE?W*mp%e*&APD}dW92ErvsYx8SodwMnzEuiRc*)>+jg|j zl*VItP;%Tl_gYj)eZv(^x$C&wyeft5@eN^_2wa2?e8tz!uA=%WZ10k?m0o6u=kgVX z#1p3`(}-gzgMMTfhDt=vbH7=Y?n^;=8AeKuB^niC&FnkMgx*vEkjRR{@{c2yfTRr$ zMdZDs980-qYK{wZ$aK+EF=~a(AM(WT@V|pn*H@+9bZRezp;t?nicKmnz{Bt~S2`Su zvNmlflIC9qf{<(ZRu}VcQee1{K@xraxP+-BE;HmJ>5LeV46fiR!{COpYmfKL@YsZt zfkzWs{EH?;2Q3Q0Npm}c37n@XE<3(!$!E&kl*#BIcO`7o`<)VPh{3`x407$Ym=yg*;f=#DyO1IO|9VaL(9 zj^iw?=g6hUY>bLH??ih|GETbT!beQbe#XTZzN06xAKxcsybIQ75Phm`97Z3;HB3`L z3V`dFp^I~OFnhEV79=ARa+|=-j$46} d8?0&LHa~ZOTLxq|ccC9??*wOeaW9YyzW_uu)v^Ep literal 0 HcmV?d00001 diff --git a/target/classes/ru/redrise/marinesco/security/ManageUsersController.class b/target/classes/ru/redrise/marinesco/security/ManageUsersController.class new file mode 100644 index 0000000000000000000000000000000000000000..7593a7a884de1f34c5d42c54d34b591e910bb1a2 GIT binary patch literal 3122 zcma)8YgZFj6x}xj2Eu?eRV;{DR7wKk_`s@!+9HUhO%OrjtF0Z9OBftx;><+FzTf|$ zf1qFcw$!z{`nmt1|DvC3_nm|!V5G7Z^T<8->~r?n=briN-{1cL@EX3+5D_@(l?+ej zJi^PXwgrc*F3Ev?F2 zAkbvH1%Y_l^$Lb>FORJnX}3_2UP_>|L>CLP==xURdg}ti>4w00GcXMWSF`2r)`^^L zIaY9v7>Q(7AUfsdWegqIrJ++`?{>r)GpAs5bm0Yowt@`Gkq8VX(zU>+Y}5Bs$)^Ku zgTRYAn$aS#D@{`7N^48fyJ9ZcGR!b%+F7!t-YY-0OjIHqO+0^U$!rWw=+V)Qn8Mtr zLqjX`3sx*&;8bHzJ6DH%b!B9*;^yZ~&s>uMYo|P#IagpPk!TG0oMbwcG*nqpYL|JZ2#`p%S z*)VfOp_Q?h;G%{Zmamqw%2vmlm}PIWDgt}zJFF5z@}|n-Z5?T3 zNb8E}&xHZAn{T$_61QGmTxiE-ENWN~=nMOKo4htFs^bc-3g`r@3QJ(R9(9p=a|)@t zifzWRvsMI}*OXw%#Qz$W%JSP?2U3*<%Nj0I;B3aSMOZdPmTCgE%5HylE7GVt?be?% z>&4BJ=6D0hi5*;>qqEc7g4n^n)|Dx>vtyAb$DNE>tekTi57T+hgzajpa4s;`kh(^P z!$ld;Z&8)170WE?S~zWPSE%hMdTvho{o4ha+Z1eZfT85Y-$7y;+~HC zctAX|JIf}DZ|UT;ON!Jn_E5(M_)s8Lj^_Njvfbi!Q|Q@Nd`t~-v|ApB^EijQn&g|@ z4nA8ibyN~)(Jgs7Ib*50*W2)G;HWwa1V$P%?DKS!Zb0!GweJV2>iH+gg1lRj^(E=p zmdbcz;LR@>Gp96U6g~Cv5g7BHoGfuTde%cVj=FdhEx5K!3{6gFX6J^I7~mLg;s;U$ zy=wl4Pn^lTxA5AA7}wkRmgHUiwZ+A6(0@Yw2fjqGo7a|bX%F^~!37m)>thVwc!Z(v`CK36p%6tc+f-0ED4AYU=uqWyFmw$3!^jjNbHhKQ zcLT!$na4OruP5e?Y~ZB8c=LBS(9^tuvjTtO_3`MaLhXq@!sG^~BeGH{qJfKN|AZAEuLFj!DEZ%YWk`y^-&F<5T&A;!*m|Or{VRpFq?f0 S=X1V)Q4Qrwe5Ia!eElCJIV&ds literal 0 HcmV?d00001 diff --git a/target/classes/ru/redrise/marinesco/security/RegistrationController.class b/target/classes/ru/redrise/marinesco/security/RegistrationController.class index 4961882080f7ce6f599dd9c75a2b49f399e4ff94..80b2c75ac2836534b94985f0178d97982a2d0077 100644 GIT binary patch delta 1350 zcmZWpO>Y}j6g|%~_V{C(CX?9IP2xI%P}_;?v<+W%Q)tr`3J!sqCUpapsmE~~98Z{W zTS7tRFGRzp5(}#G1Avf}fI#e!*s(-ng%Cf21>(GM1XdXN&As=%`_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ta 67 zcmeBC>QUMd$LEMLaf!ZV;Y0X4bP*J*RBQGk zOecyJ^VBqK^TaX=w&}VXNrBY=F%=NH8<*LxP+ovl$mrM52et9`P7~fU&4i{f6UMan zNf~(-2`?_?Ln#euWV{3Eg_gaPT&WWV5k`dnGQg_>mHW1_O7iXxMW=gcH_)$HNa*1; zB(B=gD^9?QsXsP@ci$LH-67U$i3*F>EWiMhQD-rPVGcjSt~OSqJjYzbMT%`kN_?TE z_3;NxO1MSxN??D3bc?Qi&AMh+-+?(~xs}1+L1N+OoJWSsd{PIi1)jT$`ydxff;Pto cet22WwL<#;M3;Xc5>~ia!m8-#zsef$4YBG@asU7T delta 368 zcmY+9Jx)SF6ot>7frkta#HT(*MFsWAKN~<};s&g2Y&8Z8ETA-T0aj*~U}>X;8ZB&1 zScwf=Ae?y+qQ(6=GxwfvW@MhyW;p)(25^Mdqj@NJoo=r?I2Pzi^<0oRy}i6L(8$Z`47c&A#cIdvH&X!UA)eh&HRRCTkxs zuWS^2W-mU>BFo;N4j_j`DnTAgGzr*esFoQkeXPcACtO!SWWe K5j(msHh~El{v#&< diff --git a/target/classes/ru/redrise/marinesco/web/RoleByIdConverter.class b/target/classes/ru/redrise/marinesco/web/RoleByIdConverter.class new file mode 100644 index 0000000000000000000000000000000000000000..02064ced43b92a1067321e404e4f54bf341a7bf1 GIT binary patch literal 1322 zcmbVMT~8B16g^W4OG~A-Du~~RV!K6FjZYRykVs-u#envG+74xKJJZb0Li*}2(nK-( zV0iXN8Sg9=D%1ph*tvUm?>+bIxu^Z{^V@d-Pw~h@iorK=U_{HvNCX{jq!Lk62YaFs zZ0Jxt>%C~LYPBnj6~;rFp|Hbuc@T2d4%QnxqG>&hF+A3$9YkGfZ*Lji5qsLa3!2&p zI+E_+QJCNek0EbpMzkTiI+9kK9z&%zluwIWo)8)+t}=`*NhR$v!(!Hw{C{gAc4ar6NQ9RY-Jd%cdgWlht(`@V%Ebg(&qHr9ByNdR;11I zFe3Tp|BgD~rmBa#R6CUYsqbY-N#a{Lsh5W`!{nbLW@)#T9HubMkloa=X^J)J);e{{ z=ZmhBA+sslird&w(fffBeMM^jWBH{4oMg3U-Rv^CW@aN+R(3>PMv@%3qLjAWt%B_1 z52X{4w}iI6uApCCr>m7vwu)JjVuY?yx>C;V^mpL$46>9@P_{-fMKSAtLC&vyM*bsZ zDV(Qsl4{+VMxHtfC{i|cSd9y~NE!7ds0^3rew4gTfrQ31l?}od{ZGhOzT$EUY#%oc zaOVS69*!BK4iMZieDMgrh + ry="1.226432" /> - - - - - - - + style="color:#000000;fill:#15bade;-inkscape-stroke:none" + d="M 27.730628,1.5763661 C 25.036825,1.5596634 22.673126,2.2437308 20.494299,3.0548817 15.52534,4.9047658 11.509661,7.3067267 4.20719,6.2443347 l -0.2382811,-0.03516 -0.2402344,0.01563 c 0,0 -0.571584,0.03161 -1.09375,0.355469 -0.522166,0.323861 -1.0854728,1.181111 -1.1308594,1.90039 -0.031147,0.493776 0.1131821,1.217964 0.5546875,1.7480473 0.4415054,0.530084 1.3378907,0.798828 1.3378907,0.798828 l 0.056641,0.01172 0.056641,0.0078 C 12.15843,12.305276 17.748772,9.2542897 22.18766,7.6017457 c 2.225096,-0.828377 4.129469,-1.332733 6.328125,-1.154297 2.198656,0.178436 4.822312,1.053458 8.382812,3.423828 l 1.878907,1.2500003 0.002,-0.0039 0.002,0.002 1.875,-1.2500003 c 3.560451,-2.370338 6.184021,-3.243543 8.382812,-3.421875 2.198792,-0.178332 4.10494,0.325904 6.330078,1.154297 4.439025,1.652595 10.029323,4.7035173 18.677735,3.4453133 l 0.05078,-0.0078 0.04883,-0.0098 c 0,0 0.902708,-0.265223 1.347656,-0.796875 0.444949,-0.5316513 0.589732,-1.2583183 0.558594,-1.7519533 -0.04553,-0.721911 -0.612608,-1.579806 -1.134765,-1.902343 -0.522158,-0.322538 -1.091797,-0.353516 -1.091797,-0.353516 l -0.240235,-0.01563 -0.238281,0.03516 C 66.045442,7.3067127 62.031754,4.904815 57.062659,3.0548817 54.883831,2.2437293 52.518178,1.5596634 49.824378,1.5763661 c -0.385437,0.00239 -0.775891,0.018721 -1.171875,0.050781 -2.945866,0.2385075 -6.201654,1.4666842 -9.875,3.7734376 -3.672889,-2.3061606 -6.92781,-3.5330278 -9.873047,-3.7714845 -0.396002,-0.032061 -0.788428,-0.050345 -1.173828,-0.052734 z" + id="path1154" /> + style="opacity:1;fill:#00b185;fill-opacity:1;stroke:#ffffff;stroke-width:0.818;stroke-linejoin:round;stroke-dasharray:none;stroke-opacity:1;paint-order:stroke fill markers" + d="M 40.69873,4.1910257 47.085,1.9080267 c 0.0479,-0.017123 0.08973,0.04381 0.08973,0.09821 v 8.4513743 c 0,0.0544 -0.04003,0.09821 -0.08973,0.09821 0,0 -3.24318,-2.0452513 -3.24318,-3.8408703 0,-0.06402 0,-0.06402 0,0 0,1.794641 -3.14309,3.8409423 -3.14309,3.8409423 -0.03835,0.03461 -0.08973,-0.04381 -0.08973,-0.09821 V 4.2892377 c 0,-0.05441 0.08973,-0.097032 0.08973,-0.09821 z" + sodipodi:nodetypes="sssssssssscs" /> diff --git a/target/classes/templates/manage_users.html b/target/classes/templates/manage_users.html new file mode 100644 index 0000000..f63e49b --- /dev/null +++ b/target/classes/templates/manage_users.html @@ -0,0 +1,47 @@ + + + + + Marinesco - Manage users + + + + + +

Manage users

+
go back +

+

+ user + + user + +
+ + + + + + + + +
+
+
+ + + \ No newline at end of file diff --git a/target/classes/templates/registration.html b/target/classes/templates/registration.html index 4b7aa14..1da765e 100644 --- a/target/classes/templates/registration.html +++ b/target/classes/templates/registration.html @@ -5,7 +5,7 @@ Marinesco - registration form - + diff --git a/target/classes/templates/root.html b/target/classes/templates/root.html index df62e2f..3346843 100644 --- a/target/classes/templates/root.html +++ b/target/classes/templates/root.html @@ -11,6 +11,10 @@

Welcome to Marinesco


Login +
/profile +
/manage_users +
+
Log out \ No newline at end of file