WoollyinWalesIT / jomres

Jomres Core, the online booking engine and portal for Joomla and Wordpress
https://www.jomres.net
GNU General Public License v2.0
41 stars 37 forks source link

dobooking.class.php - non unique email error message - 9.23.1 #461

Closed allynat closed 4 years ago

allynat commented 4 years ago

Problem If using 9.23.1 dobooking.class.php and a non unique email is used in the booking form by a logged in manager, the message row below the email box is blank and the proceed button is available to complete the booking.

Solution However, if the selected code below of 9.18 version of the "public function email_usage_check($email)" is used to replace the 9.23.1 version, the error message appears and the proceed button is not available when a non unique email is used my a manager.

This method also allows for the booking to be amended by a manager and reuse the same email address.

/9.23.1 removed-start if ($thisJRUser->userIsManager) { // At this point we have a manager who is using the dropdown to select a guest's details $this->email_address_can_be_used = true; } else { if ($thisJRUser->userIsRegistered) { $users_id = jomres_cmsspecific_getcurrentusers_id(); $stored_email = $all_users[ $users_id ][ 'email' ]; if ($stored_email == $email) { $this->email_address_can_be_used = true; } else { $this->email_address_can_be_used = false; } 9.23.1 removed-end/

/insert 9.18-start/ if ($thisJRUser->userIsRegistered) { $users_id = jomres_cmsspecific_getcurrentusers_id(); $stored_email = $all_users[ $users_id ][ 'email' ]; if ($stored_email == $email) { $this->email_address_can_be_used = true; } else { $this->email_address_can_be_used = false; } } /insert 9.18-end/

ps - This issue may have been hidden by confused & inconsistent communications by me over the last year.

allynat commented 4 years ago

Hello Vince

The original issue was poorly described.

The real and remaining issue is that if a manager wants to add a booking AND they are entering a booking for a guest using their genuine email and may have been previously recorded in the system.

Using the 9.22 version of dobookings.class, the manager can corrupt the previous booking that may have been made by that email if the manager enters the email manually.

Equally, if the manager is making a booking for a guest, and the manager creates an email out of their head, hopefully unique, they are able to proceed to make the booking and therefore corrupt any earlier booking if the entered email is not unique.

If a guest tries to make a booking using an existing email, they are asked to login and thats fine.

The code in the dobooking.class file needs an adjustment to allow the check to apply to the manager and deny use of manually entered of duplicate emails, forcing the manager to use the dropdown.

Thank you

Ally

jomres commented 4 years ago

I believe that this was resolved through tickets.

allynat commented 4 years ago

Hi Vince

Correct, done

Regards

Ally

On 26 Aug BE 2563, at 19:07, Vince Wooll notifications@github.com wrote:

I believe that this was resolved through tickets.

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub https://github.com/WoollyinWalesIT/jomres/issues/461#issuecomment-680838690, or unsubscribe https://github.com/notifications/unsubscribe-auth/AFS3YQFE3SYJMTL6N4X2T2DSCT3JFANCNFSM4MXBLIHQ.