' . $avatar_img . '
',
+ 'before_content' => $avatar_script . '
' . $avatar_img . '
',
'after_content' => '
',
'attributes' => 'accept="image/png, image/jpg, image/jpeg"',
'type' => 'file',
diff --git a/inc/modules/lost-password.php b/inc/modules/lost-password.php
index 689a90c..f0c809e 100644
--- a/inc/modules/lost-password.php
+++ b/inc/modules/lost-password.php
@@ -27,24 +27,28 @@ function wpu_extranet_lostpassword__action() {
wp_redirect(wpu_extranet__get_dashboard_page());
die;
}
+ $messages = array();
+ $return_type = 'error';
- $html_return = '';
if (isset($_GET['lostpassword']) && $_GET['lostpassword'] == 'success') {
- $html_return .= '';
+ $return_type = 'success';
+ $messages[] = __('Check your email for the confirmation link.', 'wpu_extranet');
}
if (isset($_GET['lostpassworderror'])) {
- $html_return .= '';
}
- return $html_return;
+ return wpuextranet_get_html_errors($messages, array(
+ 'form_id' => 'reset_password',
+ 'type' => $return_type
+ ));
+
}
/* Form HTML
diff --git a/inc/modules/register.php b/inc/modules/register.php
index 87618c3..1d6d21c 100644
--- a/inc/modules/register.php
+++ b/inc/modules/register.php
@@ -62,12 +62,18 @@ function wpu_extranet_register__action() {
return '';
}
+ $messages = array();
+
/* Checked honeypot */
$honeypot_id = wpu_extranet_register_get_honeypot_id();
if (isset($_POST[$honeypot_id]) && $_POST[$honeypot_id] == 1) {
return '';
}
+ if(isset($_POST['user_email'])){
+ $messages = apply_filters('wpu_extranet__email__validation', $messages, $_POST['user_email']);
+ }
+
$register_success_user_id = false;
if (!empty($_POST) && isset($_POST['user_login'], $_POST['user_email'], $_POST['user_password'])) {
$user_login = sanitize_text_field($_POST['user_login']);
@@ -84,30 +90,33 @@ function wpu_extranet_register__action() {
}
}
- $html_return = '';
+ $return_type = 'error';
+
if (isset($_GET['register']) && $_GET['register'] == 'success') {
- $html_return .= '';
+ $return_type = 'success';
+ $messages[] = __('Registration confirmation will be emailed to you.', 'wpu_extranet');
}
if (isset($_GET['registererror'])) {
- $html_return .= '';
}
- return $html_return;
+ return wpuextranet_get_html_errors($messages, array(
+ 'form_id' => 'register',
+ 'type' => $return_type
+ ));
}
/* Form HTML
diff --git a/lang/wpu_extranet-fr_FR.l10n.php b/lang/wpu_extranet-fr_FR.l10n.php
index 3b445f1..e23e9e0 100644
--- a/lang/wpu_extranet-fr_FR.l10n.php
+++ b/lang/wpu_extranet-fr_FR.l10n.php
@@ -1,2 +1,2 @@
NULL,'plural-forms'=>NULL,'messages'=>['All fields are required.'=>'Tous les champs sont requis.','Invalid email.'=>'E-mail invalide.','New email is the same as the current email.'=>'Le nouvel e-mail est le même que l’e-mail actuel.','Emails do not match.'=>'Les e-mails ne sont pas identiques.','Email is already in use.'=>'L’e-mail est déjà utilisé.','Email successfully updated!'=>'L’e-mail a été mis à jour avec succès !','Change email'=>'Changer d\'adresse e-mail','Your current email'=>'Votre adresse e-mail actuelle','New email'=>'Nouvel e-mail','Confirm new email'=>'Confirmez votre nouvel e-mail','Current password is incorrect.'=>'Le mot de passe actuel est incorrect.','Passwords do not match.'=>'Les mots de passe ne correspondent pas.','Password is too short, minimum of 6 characters.'=>'Le mot de passe est trop court, minimum de 6 caractères.','Password successfully changed!'=>'Mot de passe changé avec succès !','Error:'=>'Erreur :','Change password'=>'Changer le mot de passe','Enter your current password'=>'Veuillez saisir votre mot de passe actuel','New password'=>'Nouveau mot de passe','Confirm new password'=>'Confirmer le nouveau mot de passe','Profile successfully updated!'=>'Profil mis à jour avec succès!','Infos'=>'Infos','The current avatar is generated by %s.'=>'L’avatar actuel est généré par %s.','Delete this avatar'=>'Supprimer cet avatar','Avatar'=>'Avatar','Username'=>'Nom d\'utilisateur','Email'=>'E-mail','Edit my infos'=>'Modifier mes infos','Check your email for the confirmation link.'=>'Vérifiez vos courriels pour y trouver le lien de confirmation.','Your account could not be found.'=>'Votre compte est introuvable.','Reset password failed.'=>'Échec de la réinitialisation du mot de passe.','Username or Email Address'=>'Identifiant ou adresse email','Get New Password'=>'Obtenir un nouveau mot de passe','Registration confirmation will be emailed to you.'=>'La confirmation d’inscription vous sera envoyée par courriel.','This username already exists.'=>'Ce nom d’utilisateur existe déjà.','This email is already registered.'=>'Cet e-mail est déjà enregistré.','This username contains invalid characters.'=>'Ce nom d’utilisateur contient des caractères non valides.','Registration failed.'=>'Échec de l’inscription.','Password'=>'Mot de passe','Register'=>'S\'inscrire','Log out'=>'Se déconnecter','First name'=>'Prénom','Last name'=>'Nom'],'language'=>'fr_FR','x-generator'=>'Poedit 3.4.4'];
\ No newline at end of file
+return ['domain'=>NULL,'plural-forms'=>NULL,'messages'=>['Error:'=>'Erreur :','All fields are required.'=>'Tous les champs sont requis.','Invalid email.'=>'E-mail invalide.','New email is the same as the current email.'=>'Le nouvel e-mail est le même que l’e-mail actuel.','Emails do not match.'=>'Les e-mails ne sont pas identiques.','Email is already in use.'=>'L’e-mail est déjà utilisé.','Email successfully updated!'=>'L’e-mail a été mis à jour avec succès !','Change email'=>'Changer d\'adresse e-mail','Your current email'=>'Votre adresse e-mail actuelle','New email'=>'Nouvel e-mail','Confirm new email'=>'Confirmez votre nouvel e-mail','Current password is incorrect.'=>'Le mot de passe actuel est incorrect.','Passwords do not match.'=>'Les mots de passe ne correspondent pas.','Password is too short, minimum of 6 characters.'=>'Le mot de passe est trop court, minimum de 6 caractères.','Password successfully changed!'=>'Mot de passe changé avec succès !','Change password'=>'Changer le mot de passe','Enter your current password'=>'Veuillez saisir votre mot de passe actuel','New password'=>'Nouveau mot de passe','Confirm new password'=>'Confirmer le nouveau mot de passe','You can not delete this type of account.'=>'Vous ne pouvez pas supprimer ce type de compte.','Invalid password.'=>'Mot de passe invalide.','Delete your account'=>'Supprimer votre compte','Profile successfully updated!'=>'Profil mis à jour avec succès!','Infos'=>'Infos','The current avatar is generated by %s.'=>'L’avatar actuel est généré par %s.','Delete this avatar'=>'Supprimer cet avatar','Avatar'=>'Avatar','Username'=>'Nom d\'utilisateur','Email'=>'E-mail','Edit my infos'=>'Modifier mes infos','Check your email for the confirmation link.'=>'Vérifiez vos courriels pour y trouver le lien de confirmation.','Your account could not be found.'=>'Votre compte est introuvable.','Reset password failed.'=>'Échec de la réinitialisation du mot de passe.','Username or Email Address'=>'Identifiant ou adresse email','Get New Password'=>'Obtenir un nouveau mot de passe','Registration confirmation will be emailed to you.'=>'La confirmation d’inscription vous sera envoyée par courriel.','This username already exists.'=>'Ce nom d’utilisateur existe déjà.','This email is already registered.'=>'Cet e-mail est déjà enregistré.','This username contains invalid characters.'=>'Ce nom d’utilisateur contient des caractères non valides.','Registration failed.'=>'Échec de l’inscription.','Password'=>'Mot de passe','Register'=>'S\'inscrire','Log out'=>'Se déconnecter','First name'=>'Prénom','Last name'=>'Nom','Simple toolbox to create an extranet or a customer account'=>'Boîte à outils simple pour créer un extranet ou un compte client'],'language'=>'fr_FR','x-generator'=>'Poedit 3.4.4'];
\ No newline at end of file
diff --git a/lang/wpu_extranet-fr_FR.mo b/lang/wpu_extranet-fr_FR.mo
index cab2bbb..c46ba5b 100644
Binary files a/lang/wpu_extranet-fr_FR.mo and b/lang/wpu_extranet-fr_FR.mo differ
diff --git a/lang/wpu_extranet-fr_FR.po b/lang/wpu_extranet-fr_FR.po
index c9bc8e9..3f3d581 100644
--- a/lang/wpu_extranet-fr_FR.po
+++ b/lang/wpu_extranet-fr_FR.po
@@ -1,7 +1,7 @@
msgid ""
msgstr ""
"Project-Id-Version: WPU Extranet\n"
-"POT-Creation-Date: 2024-08-08 12:06+0200\n"
+"POT-Creation-Date: 2024-08-08 16:40+0200\n"
"PO-Revision-Date: \n"
"Last-Translator: Darklg
\n"
"Language-Team: \n"
@@ -15,177 +15,195 @@ msgstr ""
"X-Poedit-KeywordsList: __;_e\n"
"X-Poedit-SearchPath-0: ../.\n"
-#: .././inc/modules/change-email.php:40 .././inc/modules/change-password.php:40
+#: .././inc/helpers.php:21
+msgid "Error:"
+msgstr "Erreur :"
+
+#: .././inc/modules/change-email.php:41 .././inc/modules/change-password.php:41
+#: .././inc/modules/delete-account.php:52
msgid "All fields are required."
msgstr "Tous les champs sont requis."
-#: .././inc/modules/change-email.php:45
+#: .././inc/modules/change-email.php:46
msgid "Invalid email."
msgstr "E-mail invalide."
-#: .././inc/modules/change-email.php:50
+#: .././inc/modules/change-email.php:51
msgid "New email is the same as the current email."
msgstr "Le nouvel e-mail est le même que l’e-mail actuel."
-#: .././inc/modules/change-email.php:55
+#: .././inc/modules/change-email.php:56
msgid "Emails do not match."
msgstr "Les e-mails ne sont pas identiques."
-#: .././inc/modules/change-email.php:60
+#: .././inc/modules/change-email.php:61
msgid "Email is already in use."
msgstr "L’e-mail est déjà utilisé."
-#: .././inc/modules/change-email.php:72
+#: .././inc/modules/change-email.php:75
msgid "Email successfully updated!"
msgstr "L’e-mail a été mis à jour avec succès !"
-#: .././inc/modules/change-email.php:98 .././inc/modules/change-email.php:120
+#: .././inc/modules/change-email.php:101 .././inc/modules/change-email.php:123
msgid "Change email"
msgstr "Changer d'adresse e-mail"
-#: .././inc/modules/change-email.php:105
+#: .././inc/modules/change-email.php:108
msgid "Your current email"
msgstr "Votre adresse e-mail actuelle"
-#: .././inc/modules/change-email.php:111
+#: .././inc/modules/change-email.php:114
msgid "New email"
msgstr "Nouvel e-mail"
-#: .././inc/modules/change-email.php:116
+#: .././inc/modules/change-email.php:119
msgid "Confirm new email"
msgstr "Confirmez votre nouvel e-mail"
-#: .././inc/modules/change-password.php:45
+#: .././inc/modules/change-password.php:46
msgid "Current password is incorrect."
msgstr "Le mot de passe actuel est incorrect."
-#: .././inc/modules/change-password.php:50
+#: .././inc/modules/change-password.php:51
msgid "Passwords do not match."
msgstr "Les mots de passe ne correspondent pas."
-#: .././inc/modules/change-password.php:55
+#: .././inc/modules/change-password.php:56
msgid "Password is too short, minimum of 6 characters."
msgstr "Le mot de passe est trop court, minimum de 6 caractères."
-#: .././inc/modules/change-password.php:65
+#: .././inc/modules/change-password.php:66
msgid "Password successfully changed!"
msgstr "Mot de passe changé avec succès !"
-#: .././inc/modules/change-password.php:69
-#: .././inc/modules/lost-password.php:35 .././inc/modules/register.php:92
-msgid "Error:"
-msgstr "Erreur :"
-
-#: .././inc/modules/change-password.php:92
-#: .././inc/modules/change-password.php:113
+#: .././inc/modules/change-password.php:90
+#: .././inc/modules/change-password.php:111
msgid "Change password"
msgstr "Changer le mot de passe"
-#: .././inc/modules/change-password.php:99
+#: .././inc/modules/change-password.php:97
+#: .././inc/modules/delete-account.php:113
msgid "Enter your current password"
msgstr "Veuillez saisir votre mot de passe actuel"
-#: .././inc/modules/change-password.php:104
+#: .././inc/modules/change-password.php:102
msgid "New password"
msgstr "Nouveau mot de passe"
-#: .././inc/modules/change-password.php:109
+#: .././inc/modules/change-password.php:107
msgid "Confirm new password"
msgstr "Confirmer le nouveau mot de passe"
-#: .././inc/modules/edit-metas.php:49
+#: .././inc/modules/delete-account.php:13
+msgid "You can not delete this type of account."
+msgstr "Vous ne pouvez pas supprimer ce type de compte."
+
+#: .././inc/modules/delete-account.php:57
+msgid "Invalid password."
+msgstr "Mot de passe invalide."
+
+#: .././inc/modules/delete-account.php:105
+#: .././inc/modules/delete-account.php:117
+msgid "Delete your account"
+msgstr "Supprimer votre compte"
+
+#: .././inc/modules/edit-metas.php:50
msgid "Profile successfully updated!"
msgstr "Profil mis à jour avec succès!"
-#: .././inc/modules/edit-metas.php:115
+#: .././inc/modules/edit-metas.php:120
msgid "Infos"
msgstr "Infos"
-#: .././inc/modules/edit-metas.php:138
+#: .././inc/modules/edit-metas.php:143
#, php-format
msgid "The current avatar is generated by %s."
msgstr "L’avatar actuel est généré par %s."
-#: .././inc/modules/edit-metas.php:141
+#: .././inc/modules/edit-metas.php:146
msgid "Delete this avatar"
msgstr "Supprimer cet avatar"
-#: .././inc/modules/edit-metas.php:144
+#: .././inc/modules/edit-metas.php:149
msgid "Avatar"
msgstr "Avatar"
-#: .././inc/modules/edit-metas.php:154 .././inc/modules/register.php:140
+#: .././inc/modules/edit-metas.php:159 .././inc/modules/register.php:150
msgid "Username"
msgstr "Nom d'utilisateur"
-#: .././inc/modules/edit-metas.php:159 .././inc/modules/register.php:146
+#: .././inc/modules/edit-metas.php:164 .././inc/modules/register.php:156
msgid "Email"
msgstr "E-mail"
-#: .././inc/modules/edit-metas.php:175
+#: .././inc/modules/edit-metas.php:180
msgid "Edit my infos"
msgstr "Modifier mes infos"
-#: .././inc/modules/lost-password.php:32
+#: .././inc/modules/lost-password.php:35
msgid "Check your email for the confirmation link."
msgstr "Vérifiez vos courriels pour y trouver le lien de confirmation."
-#: .././inc/modules/lost-password.php:38
+#: .././inc/modules/lost-password.php:40
msgid "Your account could not be found."
msgstr "Votre compte est introuvable."
-#: .././inc/modules/lost-password.php:41
+#: .././inc/modules/lost-password.php:43
msgid "Reset password failed."
msgstr "Échec de la réinitialisation du mot de passe."
-#: .././inc/modules/lost-password.php:69
+#: .././inc/modules/lost-password.php:74
msgid "Username or Email Address"
msgstr "Identifiant ou adresse email"
-#: .././inc/modules/lost-password.php:75
+#: .././inc/modules/lost-password.php:80
msgid "Get New Password"
msgstr "Obtenir un nouveau mot de passe"
-#: .././inc/modules/register.php:88
+#: .././inc/modules/register.php:97
msgid "Registration confirmation will be emailed to you."
msgstr "La confirmation d’inscription vous sera envoyée par courriel."
-#: .././inc/modules/register.php:95
+#: .././inc/modules/register.php:103
msgid "This username already exists."
msgstr "Ce nom d’utilisateur existe déjà."
-#: .././inc/modules/register.php:98
+#: .././inc/modules/register.php:106
msgid "This email is already registered."
msgstr "Cet e-mail est déjà enregistré."
-#: .././inc/modules/register.php:101
+#: .././inc/modules/register.php:109
msgid "This username contains invalid characters."
msgstr "Ce nom d’utilisateur contient des caractères non valides."
-#: .././inc/modules/register.php:104
+#: .././inc/modules/register.php:112
msgid "Registration failed."
msgstr "Échec de l’inscription."
-#: .././inc/modules/register.php:151
+#: .././inc/modules/register.php:161
msgid "Password"
msgstr "Mot de passe"
-#: .././inc/modules/register.php:160
+#: .././inc/modules/register.php:170
msgid "Register"
msgstr "S'inscrire"
-#: .././inc/pages.php:90
+#: .././inc/pages.php:91
msgid "Log out"
msgstr "Se déconnecter"
-#: .././inc/user.php:10
+#: .././inc/user.php:11
msgid "First name"
msgstr "Prénom"
-#: .././inc/user.php:13
+#: .././inc/user.php:14
msgid "Last name"
msgstr "Nom"
+#: .././wpu_extranet.php:52
+msgid "Simple toolbox to create an extranet or a customer account"
+msgstr "Boîte à outils simple pour créer un extranet ou un compte client"
+
#~ msgid "Enter your current password :"
#~ msgstr "Entrez votre mot de passe actuel :"
diff --git a/wpu_extranet.php b/wpu_extranet.php
index eaa2369..122efa1 100644
--- a/wpu_extranet.php
+++ b/wpu_extranet.php
@@ -4,7 +4,7 @@
/*
Plugin Name: WPU Extranet
Description: Simple toolbox to create an extranet or a customer account
-Version: 0.7.0
+Version: 0.8.0
Author: Darklg
Author URI: https://darklg.me/
Text Domain: wpu_extranet
@@ -22,6 +22,7 @@
Settings
---------------------------------------------------------- */
+require_once __DIR__ . '/inc/helpers.php';
require_once __DIR__ . '/inc/notifications.php';
require_once __DIR__ . '/inc/pages.php';
require_once __DIR__ . '/inc/permissions.php';
@@ -31,8 +32,9 @@
Modules
---------------------------------------------------------- */
-require_once __DIR__ . '/inc/modules/change-password.php';
require_once __DIR__ . '/inc/modules/change-email.php';
+require_once __DIR__ . '/inc/modules/change-password.php';
+require_once __DIR__ . '/inc/modules/delete-account.php';
require_once __DIR__ . '/inc/modules/edit-metas.php';
require_once __DIR__ . '/inc/modules/lost-password.php';
require_once __DIR__ . '/inc/modules/register.php';
@@ -43,7 +45,11 @@
add_action('plugins_loaded', 'wpu_extranet_plugins_loaded', 10);
function wpu_extranet_plugins_loaded() {
- load_muplugin_textdomain('wpu_extranet', dirname(plugin_basename(__FILE__)) . '/lang/');
+ $lang_dir = dirname(plugin_basename(__FILE__)) . '/lang/';
+ if (!load_plugin_textdomain('wpu_extranet', false, $lang_dir)) {
+ load_muplugin_textdomain('wpu_extranet', $lang_dir);
+ }
+ $plugin_description = __('Simple toolbox to create an extranet or a customer account', 'wpuactionlogs');
}
/* ----------------------------------------------------------