diff --git a/CodeIgniter-3.1.13/application/controllers/Utilisateur.php b/CodeIgniter-3.1.13/application/controllers/Utilisateur.php index b6372ee..c07e3ae 100644 --- a/CodeIgniter-3.1.13/application/controllers/Utilisateur.php +++ b/CodeIgniter-3.1.13/application/controllers/Utilisateur.php @@ -16,8 +16,10 @@ class Utilisateur extends CI_Controller { $this->form_validation->set_rules('email', 'Email', 'required|valid_email|is_unique[utilisateur.email]'); $this->form_validation->set_rules('nom', 'Nom', 'required'); $this->form_validation->set_rules('prenom', 'Prénom', 'required'); - $this->form_validation->set_rules('telephone', 'Téléphone', 'max_length[20]'); - $this->form_validation->set_rules('password', 'Mot de passe', 'required|min_length[6]'); + $this->form_validation->set_rules('password', 'Mot de passe', 'required|min_length[8]|max_length[64]', array( + 'min_length' => 'Le {field} doit contenir au moins {param} caractères.', + 'max_length' => 'Le {field} ne doit pas dépasser {param} caractères.' + )); if ($this->form_validation->run() == FALSE) { // Charger la vue avec les erreurs @@ -31,7 +33,6 @@ class Utilisateur extends CI_Controller { 'email' => $this->input->post('email'), 'nom' => $this->input->post('nom'), 'prenom' => $this->input->post('prenom'), - 'telephone' => $this->input->post('telephone'), 'password' => password_hash($this->input->post('password'), PASSWORD_DEFAULT) // Hasher le mot de passe ); diff --git a/CodeIgniter-3.1.13/application/views/inscription.php b/CodeIgniter-3.1.13/application/views/inscription.php index 43086a6..3f9043b 100644 --- a/CodeIgniter-3.1.13/application/views/inscription.php +++ b/CodeIgniter-3.1.13/application/views/inscription.php @@ -4,7 +4,7 @@ Inscription - +
@@ -17,24 +17,10 @@
- - - + + +
- -
- - - -
- -
- - - -
- -
@@ -43,19 +29,35 @@
- - - + + +
- +
- - + +
+ + +
+
+ + diff --git a/CodeIgniter-3.1.13/assets/css/inscription.css b/CodeIgniter-3.1.13/assets/css/inscription.css index 69ba12e..f1e7c81 100644 --- a/CodeIgniter-3.1.13/assets/css/inscription.css +++ b/CodeIgniter-3.1.13/assets/css/inscription.css @@ -30,7 +30,6 @@ label { #email, #nom, #prenom, -#telephone, #password, #confirm_password { width: 100%; @@ -41,6 +40,35 @@ label { box-sizing: border-box; } +.password-wrapper { + position: relative; + display: flex; + align-items: center; +} + +.password-wrapper input[type="password"], +.password-wrapper input[type="text"] { + flex: 1; + padding-right: 80px; +} + +.password-wrapper button { + position: absolute; + right: 10px; + padding: 5px 10px; + background-color: #634caf; + color: #fff; + border: none; + border-radius: 4px; + cursor: pointer; + transition: background-color 0.3s; + margin-bottom: 10px; +} + +.password-wrapper button:hover { + background-color: rgb(54, 16, 119); +} + .btn-submit { width: 100%; padding: 10px;