diff --git a/inc/helpers.php b/inc/helpers.php new file mode 100644 index 0000000..22f6951 --- /dev/null +++ b/inc/helpers.php @@ -0,0 +1,35 @@ + 'error', + 'form_id' => '' + ); + $args = array_merge($defaults, $args); + $classname = 'extranet-message extranet-message--' . $args['type'] . ' form-' . $args['form_id'] . '-' . $args['type'] . ''; + $html_return = ''; + /* Display errors */ + if (count($errors) > 1) { + $html_return .= ''; + } else { + $html_return .= '

'; + $html_return .= implode('
', $errors); + $html_return .= '

'; + } + + return $html_return; +} diff --git a/inc/modules/change-email.php b/inc/modules/change-email.php index 51bd930..60696fc 100644 --- a/inc/modules/change-email.php +++ b/inc/modules/change-email.php @@ -47,7 +47,7 @@ function wpu_extranet_change_email__action() { } /* Invalid current email */ - if($current_email == $new_email){ + if ($current_email == $new_email) { $errors[] = __('New email is the same as the current email.', 'wpu_extranet'); } @@ -61,27 +61,29 @@ function wpu_extranet_change_email__action() { $errors[] = __('Email is already in use.', 'wpu_extranet'); } + $errors = apply_filters('wpu_extranet__email__validation', $errors, $new_email); $errors = apply_filters('wpu_extranet_change_email__action_errors', $errors, $current_email, $new_email, $confirm_new_email); - $html_return = ''; + $return_type = 'error'; if (empty($errors)) { // Change email wp_update_user(array( 'ID' => $user_id, 'user_email' => $new_email )); - $html_return = '

' . __('Email successfully updated!', 'wpu_extranet') . '

'; - } else { - $html_return = '

' . implode('
', $errors) . '

'; + $return_type = 'success'; + $errors[] = __('Email successfully updated!', 'wpu_extranet'); } - return $html_return; + return wpuextranet_get_html_errors($errors, array( + 'form_id' => 'change_email', + 'type' => $return_type + )); } /* HTML Form -------------------------- */ - function wpu_extranet_change_email__form($args = array()) { if (!is_array($args)) { $args = array(); diff --git a/inc/modules/change-password.php b/inc/modules/change-password.php index d5ae31e..42f93f9 100644 --- a/inc/modules/change-password.php +++ b/inc/modules/change-password.php @@ -56,23 +56,20 @@ function wpu_extranet_change_password__action() { $errors[] = __('Password is too short, minimum of 6 characters.', 'wpu_extranet'); } - $html_return = ''; + $return_type = 'error'; if (empty($errors)) { // Change password wp_set_password($new_password, $current_user->ID); // Log-in again. wpu_extranet_log_user($current_user); - - $html_return .= '

' . __('Password successfully changed!', 'wpu_extranet') . '

'; - } else { - $html_return .= ''; + $return_type = 'success'; + $errors[] = __('Password successfully changed!', 'wpu_extranet'); } - return $html_return; + return wpuextranet_get_html_errors($errors, array( + 'form_id' => 'change_password', + 'type' => $return_type + )); } /* HTML Form diff --git a/inc/modules/delete-account.php b/inc/modules/delete-account.php new file mode 100644 index 0000000..e42a06a --- /dev/null +++ b/inc/modules/delete-account.php @@ -0,0 +1,138 @@ +data->user_pass, $current_user->ID)) { + $errors[] = __('Invalid password.', 'wpu_extranet'); + } + + /* User can edit other users : prevent deletion */ + $errors = wpu_extranet_user_can_delete_account($errors, $user_id); + + if (empty($errors)) { + /* Delete user and redirect to home */ + require_once ABSPATH . 'wp-admin/includes/user.php'; + wp_delete_user($user_id); + wp_redirect(home_url() . '#'); + die; + } + + /* Display errors */ + return wpuextranet_get_html_errors($errors, array( + 'form_id' => 'delete_account', + 'type' => 'error' + )); + +} + +/* HTML Form +-------------------------- */ + +function wpu_extranet_delete_account__form($args = array()) { + if (!is_array($args)) { + $args = array(); + } + if (!isset($args['before_fields'])) { + $args['before_fields'] = ''; + } + $html = ''; + + $user_id = get_current_user_id(); + $userdata = get_userdata($user_id); + + $errors = wpu_extranet_user_can_delete_account(array(), $user_id); + $user_can_delete_account = empty($errors); + if (!empty($errors)) { + $args['before_fields'] .= wpuextranet_get_html_errors($errors, array( + 'form_id' => 'delete_account', + 'type' => 'error' + )); + } + + $settings = wpu_extranet_get_skin_settings(); + $html .= '
'; + $html .= '

' . __('Delete your account', 'wpu_extranet') . '

'; + $html .= '
'; + $html .= $args['before_fields']; + if ($user_can_delete_account) { + $html .= ''; + $html .= '
'; + $html .= '
'; + return $html; +} + +/* ---------------------------------------------------------- + Example code +---------------------------------------------------------- */ + +/* +$html_return_delete_account = wpu_extranet_delete_account__action(); +get_header(); +echo '

' . get_the_title() . '

'; +echo wpu_extranet_delete_account__form(array( + 'before_fields' => $html_return_delete_account +)); +get_footer(); +*/ diff --git a/inc/modules/edit-metas.php b/inc/modules/edit-metas.php index e6e03f3..c438fdd 100644 --- a/inc/modules/edit-metas.php +++ b/inc/modules/edit-metas.php @@ -45,12 +45,16 @@ function wpu_extranet_update_metas__action() { $upload_avatar = wpu_extranet_update_metas__action__avatar($user_id); - $html_return = ''; if ($has_update || $upload_avatar) { - $html_return = '

' . __('Profile successfully updated!', 'wpu_extranet') . '

'; + return wpuextranet_get_html_errors(array( + __('Profile successfully updated!', 'wpu_extranet') + ), array( + 'form_id' => 'editmetas', + 'type' => 'success' + )); } - return $html_return; + return ''; } function wpu_extranet_update_metas__action__avatar($user_id) { @@ -143,7 +147,7 @@ function wpu_extranet_update_metas__form($args = array()) { } $html .= wpu_extranet__display_field('wpuextranet_avatar', array( 'label' => __('Avatar', 'wpu_extranet'), - 'before_content' => $avatar_script.'
' . $avatar_img . '
', + 'before_content' => $avatar_script . '
' . $avatar_img . '
', 'after_content' => '' . $avatar_message . '
', '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 .= '

' . __('Check your email for the confirmation link.', 'wpu_extranet') . '

'; + $return_type = 'success'; + $messages[] = __('Check your email for the confirmation link.', 'wpu_extranet'); } if (isset($_GET['lostpassworderror'])) { - $html_return .= '

' . __('Error:', 'wpu_extranet') . ' '; switch ($_GET['lostpassworderror']) { case '1': - $html_return .= __('Your account could not be found.', 'wpu_extranet'); + $messages[] = __('Your account could not be found.', 'wpu_extranet'); break; default: - $html_return .= __('Reset password failed.', 'wpu_extranet'); + $messages[] = __('Reset password failed.', 'wpu_extranet'); } - $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 .= '

' . __('Registration confirmation will be emailed to you.', 'wpu_extranet') . '

'; + $return_type = 'success'; + $messages[] = __('Registration confirmation will be emailed to you.', 'wpu_extranet'); } if (isset($_GET['registererror'])) { - $html_return .= '

' . __('Error:', 'wpu_extranet') . ' '; switch ($_GET['registererror']) { case '1': - $html_return .= __('This username already exists.', 'wpu_extranet'); + $messages[] = __('This username already exists.', 'wpu_extranet'); break; case '2': - $html_return .= __('This email is already registered.', 'wpu_extranet'); + $messages[] = __('This email is already registered.', 'wpu_extranet'); break; case '3': - $html_return .= __('This username contains invalid characters.', 'wpu_extranet'); + $messages[] = __('This username contains invalid characters.', 'wpu_extranet'); break; default: - $html_return .= __('Registration failed.', 'wpu_extranet'); + $messages[] = __('Registration failed.', 'wpu_extranet'); } - $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'); } /* ----------------------------------------------------------