Ignore:
Timestamp:
09/03/21 11:25:12 (3 years ago)
Author:
KostaFortumanov <kfortumanov@…>
Branches:
master
Children:
f8007b3
Parents:
5577566
Message:

Added moderator class

File:
1 edited

Legend:

Unmodified
Added
Removed
  • src/main/java/it/finki/charitable/controller/UserProfileController.java

    r5577566 rf0d5cb7  
    44import it.finki.charitable.entities.DonationInformation;
    55import it.finki.charitable.entities.DonationPost;
     6import it.finki.charitable.entities.MainUser;
    67import it.finki.charitable.security.PasswordEncoder;
    78import it.finki.charitable.services.DonationPostService;
     
    3738    public String myDonations(Model model) {
    3839        model.addAttribute("myDonations", true);
    39         AppUser user = userService.loadUserByUsername(SecurityContextHolder.getContext().getAuthentication().getName());
     40        MainUser user = (MainUser) userService.loadUserByUsername(SecurityContextHolder.getContext().getAuthentication().getName());
    4041        List<DonationInformation> donations = user.getDonationInformation();
    4142        model.addAttribute("donations", donations);
     
    8990        }
    9091
    91         AppUser user = (AppUser) model.getAttribute("user");
     92        MainUser user = (MainUser) model.getAttribute("user");
    9293        user.setCreditCardInfo(cardName + "," + cardNumber + "," + expiryDate + "," + cvv);
    9394        userService.saveUser(user);
     
    9899    @RequestMapping("/removeCardInfo")
    99100    public String removeCardInfo(Model model) {
    100         AppUser user = (AppUser) model.getAttribute("user");
     101        MainUser user = (MainUser) model.getAttribute("user");
    101102        user.setCreditCardInfo(null);
    102103        userService.saveUser(user);
Note: See TracChangeset for help on using the changeset viewer.