';
- print $form->selectyesno("MEMBER_SEARCH_MEMBER_PUBLIC_FORM_CREATE"); // Reverse the logic "hide -> show" for retrocompatibility
+ print $form->selectyesno("MEMBER_SEARCH_MEMBER_PUBLIC_FORM_CREATE", getDolGlobalInt("MEMBER_SEARCH_MEMBER_PUBLIC_FORM_CREATE")); // Reverse the logic "hide -> show" for retrocompatibility
print "
\n";
print '';
diff --git a/htdocs/langs/en_US/members.lang b/htdocs/langs/en_US/members.lang
index da563c950f1..9416b02272c 100644
--- a/htdocs/langs/en_US/members.lang
+++ b/htdocs/langs/en_US/members.lang
@@ -262,5 +262,6 @@ ConfirmMergeMembers=Are you sure you want to merge the chosen member with the cu
ErrorMembersMerge=There was an error when merging the members. Please check the log. Changes have been reverted.
ConfirmCreateMember=Confirm create member
CorrespondingMemberFound=Corresponding member found
-CorrespondingMemberFoundQuestion=A member has been found with the given information. Do you want to renew your membership?
-MEMBER_SEARCH_MEMBER_PUBLIC_FORM_CREATE=Searches for a member matching the information entered in the public member creation form. If a member is found, redirects the user to the membership payment form
+CorrespondingMemberFoundQuestion=A member has been found with the given information. Do you want to renew your membership? (if not nothing will be recorded)
+MEMBER_SEARCH_MEMBER_PUBLIC_FORM_CREATE=Suggest to just record the subscription (without creating a new member) if an existing member is found
+MEMBER_SEARCH_MEMBER_PUBLIC_FORM_CREATEDesc=A search is done on login, company name + email (for legal entity), or full name + email (for individual). If a member is already found, the form suggest to record a renewal of subscription.
diff --git a/htdocs/public/members/new.php b/htdocs/public/members/new.php
index 16a47afe396..a184f2a035a 100644
--- a/htdocs/public/members/new.php
+++ b/htdocs/public/members/new.php
@@ -228,9 +228,13 @@ if ($reshook < 0) {
}
// Verify if we can find member
+
if (empty($reshook) && getDolGlobalInt("MEMBER_SEARCH_MEMBER_PUBLIC_FORM_CREATE") && $action == 'add' && !GETPOSTISSET("nofetchmember")) { // Test on permission not required here
$memberfound = false;
+
if (!getDolGlobalString('ADHERENT_LOGIN_NOT_REQUIRED') && GETPOSTISSET('login')) {
+ // Note that this allow to guess anonymous ID already used. But this is not a problem as it is an anonymous pseudonym.
+ // If we try to new account and option MEMBER_SEARCH_MEMBER_PUBLIC_FORM_CREATE was off, we also get the same error.
$sql = "SELECT rowid as id";
$sql .= " FROM ".MAIN_DB_PREFIX."adherent as a";
$sql .= " WHERE a.login = '".$db->escape(GETPOST('login'))."'";
@@ -868,14 +872,14 @@ if (getDolGlobalString('MEMBER_SKIP_TABLE') || getDolGlobalString('MEMBER_NEWFOR
}
// Firstname
- print '