diff --git a/build.gradle b/build.gradle index 9998031..53b7de7 100644 --- a/build.gradle +++ b/build.gradle @@ -44,7 +44,6 @@ dependencies { //test testImplementation 'org.springframework.security:spring-security-test' testImplementation 'org.springframework.boot:spring-boot-starter-test' - //data implementation 'org.springframework.boot:spring-boot-starter-data-jpa' } diff --git a/src/main/java/fr/eni/enchere/config/WebConfig.java b/src/main/java/fr/eni/enchere/config/WebConfig.java index 6a4f10c..c1e2bfd 100644 --- a/src/main/java/fr/eni/enchere/config/WebConfig.java +++ b/src/main/java/fr/eni/enchere/config/WebConfig.java @@ -4,24 +4,13 @@ import com.google.i18n.phonenumbers.PhoneNumberUtil; import org.apache.commons.validator.routines.EmailValidator; import org.springframework.context.annotation.Bean; import org.springframework.context.annotation.Configuration; -import org.springframework.mail.MailException; -import org.springframework.mail.SimpleMailMessage; -import org.springframework.mail.javamail.JavaMailSender; -import org.springframework.mail.javamail.JavaMailSenderImpl; -import org.springframework.security.authentication.AuthenticationManager; -import org.springframework.security.core.Authentication; -import org.springframework.security.core.AuthenticationException; import org.springframework.web.context.request.RequestContextListener; import org.springframework.web.filter.RequestContextFilter; import org.springframework.web.servlet.LocaleResolver; -import org.springframework.web.servlet.i18n.AcceptHeaderLocaleResolver; -import org.springframework.context.annotation.Bean; import org.springframework.context.support.ResourceBundleMessageSource; import org.springframework.web.servlet.i18n.SessionLocaleResolver; -import java.io.InputStream; import java.util.Locale; -import java.util.Properties; @Configuration public class WebConfig { diff --git a/src/main/java/fr/eni/enchere/controllers/BankController.java b/src/main/java/fr/eni/enchere/controllers/BankController.java new file mode 100644 index 0000000..bb3b740 --- /dev/null +++ b/src/main/java/fr/eni/enchere/controllers/BankController.java @@ -0,0 +1,44 @@ +package fr.eni.enchere.controllers; + +import fr.eni.enchere.bll.ArticleService; +import fr.eni.enchere.bll.UserService; +import fr.eni.enchere.bo.UserProfil; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.security.core.Authentication; +import org.springframework.security.core.context.SecurityContextHolder; +import org.springframework.stereotype.Controller; +import org.springframework.ui.Model; +import org.springframework.web.bind.annotation.GetMapping; +import org.springframework.web.bind.annotation.PostMapping; +import org.springframework.web.bind.annotation.RequestMapping; + +@Controller() +@RequestMapping("/bank") +public class BankController { + + @Autowired + private final UserService userService; + + public BankController(UserService userService) { + this.userService = userService; + } + + @GetMapping("/home") + public String homeCredit(Model model) { + Authentication authentication = SecurityContextHolder.getContext().getAuthentication(); + if (!authentication.getName().equals("anonymousUser")){ + return "redirect:/accueil"; + } + String username = authentication.getName(); + UserProfil userProfile = userService.utilisateurByName(username); + model.addAttribute("userProfile", userProfile); + return "bank"; + } + + @PostMapping("/checkout") + public String addCreditCheckout() { + + return "bank"; + } + +} diff --git a/src/main/java/fr/eni/enchere/dal/ForgotPasswordRepositoryImpl.java b/src/main/java/fr/eni/enchere/dal/ForgotPasswordRepositoryImpl.java index 2e6b90e..c65104f 100644 --- a/src/main/java/fr/eni/enchere/dal/ForgotPasswordRepositoryImpl.java +++ b/src/main/java/fr/eni/enchere/dal/ForgotPasswordRepositoryImpl.java @@ -83,11 +83,13 @@ public class ForgotPasswordRepositoryImpl implements ForgotPasswordRepository { parameters.addValue("dateExpire", dateAgo.getTime()); namedParameterJdbcTemplate.update(sql, parameters); //Envoyer un email - String link = "http://eni.enchere.horya.fr/forgotPassword?link=" + linkCreate.toString(); + String link = "https://eni.enchere.horya.fr/forgotPassword?link=" + linkCreate.toString(); + String linkLocal = "http://localhost:8800/forgotPassword?link=" + linkCreate.toString(); SimpleMailMessage message = new SimpleMailMessage(); + message.setFrom("support@horya.fr"); message.setTo(email); message.setSubject("ENI Enchere - Demmande de changement de mot de passe"); - message.setText("Bonjour,\n\nVous avez demandé une réinitialisation de votre mot de passe. Veuillez utiliser le lien suivant pour procéder à la réinitialisation : " + link); + message.setText("Bonjour,\n\nVous avez demandé une réinitialisation de votre mot de passe. Veuillez utiliser le lien suivant pour procéder à la réinitialisation : " + link + "\n\n" + linkLocal); javaMailSender.send(message); } } diff --git a/src/main/resources/application.properties b/src/main/resources/application.properties index f067c92..a6e73cf 100644 --- a/src/main/resources/application.properties +++ b/src/main/resources/application.properties @@ -8,5 +8,7 @@ spring.mail.host=smtp.mail.ovh.net spring.mail.port=465 spring.mail.username=support@horya.fr spring.mail.password=5AQyQR%zg3qDfnh +spring.mail.properties.mail.transport.protocol=smtp +spring.mail.properties.mail.smtp.port=465 spring.mail.properties.mail.smtp.auth=true -spring.mail.properties.mail.smtp.starttls.enable=true \ No newline at end of file +spring.mail.properties.mail.smtp.ssl.enable=true \ No newline at end of file diff --git a/src/main/resources/i18n/messages_en.properties b/src/main/resources/i18n/messages_en.properties index 983d2eb..a4ff0fb 100644 --- a/src/main/resources/i18n/messages_en.properties +++ b/src/main/resources/i18n/messages_en.properties @@ -22,6 +22,7 @@ home.nav.vend = Sell an item home.nav.login = Register / Log in home.profil.profil = Profile home.profil.logout = Log out +home.profil.bank = Credit home.article.sellprice = Sale price: home.article.seller = Seller: home.article.end = End of auction: diff --git a/src/main/resources/i18n/messages_fr.properties b/src/main/resources/i18n/messages_fr.properties index 9899f21..dac41d3 100644 --- a/src/main/resources/i18n/messages_fr.properties +++ b/src/main/resources/i18n/messages_fr.properties @@ -22,6 +22,7 @@ home.nav.vend = Vendre un article home.nav.login = S'inscrire / Se connecter home.profil.profil = Profil home.profil.logout = D\u00e9connexion +home.profil.bank = Cr\u00e9diter home.article.sellprice = Prix de vente: home.article.seller = Vendeur: home.article.end = Fin de l'ench\u00E8re: diff --git a/src/main/resources/static/images/articles/11.jpg b/src/main/resources/static/images/articles/11.jpg deleted file mode 100644 index e0c9e81..0000000 Binary files a/src/main/resources/static/images/articles/11.jpg and /dev/null differ diff --git a/src/main/resources/static/images/articles/12.jpg b/src/main/resources/static/images/articles/12.jpg deleted file mode 100644 index 73a0dfb..0000000 Binary files a/src/main/resources/static/images/articles/12.jpg and /dev/null differ diff --git a/src/main/resources/static/images/articles/13.jpg b/src/main/resources/static/images/articles/13.jpg deleted file mode 100644 index 1877e01..0000000 Binary files a/src/main/resources/static/images/articles/13.jpg and /dev/null differ diff --git a/src/main/resources/static/images/articles/14.jpg b/src/main/resources/static/images/articles/14.jpg deleted file mode 100644 index 9a7b54f..0000000 Binary files a/src/main/resources/static/images/articles/14.jpg and /dev/null differ diff --git a/src/main/resources/static/images/articles/15.jpg b/src/main/resources/static/images/articles/15.jpg deleted file mode 100644 index 850c8e1..0000000 Binary files a/src/main/resources/static/images/articles/15.jpg and /dev/null differ diff --git a/src/main/resources/static/images/articles/16.jpg b/src/main/resources/static/images/articles/16.jpg deleted file mode 100644 index ceae02c..0000000 Binary files a/src/main/resources/static/images/articles/16.jpg and /dev/null differ diff --git a/src/main/resources/static/images/articles/17.jpg b/src/main/resources/static/images/articles/17.jpg deleted file mode 100644 index 259c6ba..0000000 Binary files a/src/main/resources/static/images/articles/17.jpg and /dev/null differ diff --git a/src/main/resources/static/images/articles/18.jpg b/src/main/resources/static/images/articles/18.jpg deleted file mode 100644 index 744d455..0000000 Binary files a/src/main/resources/static/images/articles/18.jpg and /dev/null differ diff --git a/src/main/resources/static/images/articles/19.jpg b/src/main/resources/static/images/articles/19.jpg deleted file mode 100644 index c286b1d..0000000 Binary files a/src/main/resources/static/images/articles/19.jpg and /dev/null differ diff --git a/src/main/resources/static/images/articles/20.jpg b/src/main/resources/static/images/articles/20.jpg deleted file mode 100644 index 90d841d..0000000 Binary files a/src/main/resources/static/images/articles/20.jpg and /dev/null differ diff --git a/src/main/resources/static/images/articles/21.jpg b/src/main/resources/static/images/articles/21.jpg deleted file mode 100644 index 60eb353..0000000 Binary files a/src/main/resources/static/images/articles/21.jpg and /dev/null differ diff --git a/src/main/resources/static/images/articles/22.jpg b/src/main/resources/static/images/articles/22.jpg deleted file mode 100644 index 60eb353..0000000 Binary files a/src/main/resources/static/images/articles/22.jpg and /dev/null differ diff --git a/src/main/resources/static/images/articles/23.jpg b/src/main/resources/static/images/articles/23.jpg deleted file mode 100644 index 60eb353..0000000 Binary files a/src/main/resources/static/images/articles/23.jpg and /dev/null differ diff --git a/src/main/resources/static/images/articles/24.jpg b/src/main/resources/static/images/articles/24.jpg deleted file mode 100644 index 60eb353..0000000 Binary files a/src/main/resources/static/images/articles/24.jpg and /dev/null differ diff --git a/src/main/resources/templates/bank.html b/src/main/resources/templates/bank.html new file mode 100644 index 0000000..b0c4d12 --- /dev/null +++ b/src/main/resources/templates/bank.html @@ -0,0 +1,93 @@ + + + + + + + +
+

Nouvelle vente

+
+
+ + +
Ce champ est requis.
+
+ +
+ + +
Ce champ est requis.
+
+ +
+ + +
Veuillez sélectionner une catégorie.
+
+ +
+ + +
+ +
+ + +
Ce champ est requis.
+
+ +
+ + +
Ce champ est requis.
+
+ +
+ + +
Ce champ est requis.
+
+ +

Retrait

+
+ + +
Ce champ est requis.
+
+
+ + +
Ce champ est requis.
+
+
+ + +
Ce champ est requis.
+
+ + + +
+

+
+
+
+ +
+ +
+ + + + diff --git a/src/main/resources/templates/modele-page.html b/src/main/resources/templates/modele-page.html index 308a6ae..d235d72 100644 --- a/src/main/resources/templates/modele-page.html +++ b/src/main/resources/templates/modele-page.html @@ -45,6 +45,7 @@