Bug allowing oversubscription

  • relbud
  • Topic Author
  • Offline
  • New Member
  • New Member
More
12 years 11 months ago #15579 by relbud
Bug allowing oversubscription was created by relbud
Hi,

First of all. Great extension - finding it really useful!

I believe there is a bug in the event registration part of the system whereby a user can inadvertently do a group registration for more people than there is space left in the event.

I understand that there is a javascript client-side check for the number of people in a group - and this works if you press "next" on that screen, but if you press "enter" on the keyboard it takes you to the next screen regardless of the number chosen in the group registration screen. (Of course it's easy to bypass javascript checks intentionally if a user wishes).

Next, the server-side validation only checks whether or not the event is still accepting registrations. Thus if there are n places left, but the user selects any number >n (where n is >1), then the server-side validation will pass when it should fail.

Let me know if you need more info about this...

It would also be great if there was a bit more server-side validation performed on registrations in general.

Also I have modified the helper/fields.php to allow javascript code to be inserted on individual custom fields. This can be very useful for complex fee calculations or other client-side checks required on the registration form. This is done by inserting the custom code in the "description field" of the custom field with the keyword "//code" preceding the function to be inserted and added to the onchange javascript event of the custom field.

Let me know if anyone would like me to post it here...

thanks,
Ariel

Please Log in or Create an account to join the conversation.

More
12 years 11 months ago #15602 by Tuan Pham Ngoc
Replied by Tuan Pham Ngoc on topic Re: Bug allowing oversubscription
Hi

Thanks for reporting the issue. For now, we just use a simple solution which prevent bypass javascript checking. Just get the file below, unzip it, upload to folder components/com_eventbooking/views/register/tmpl folder, after that, test it again and It should work . In the future, I will implement server side check as well .


Also I have modified the helper/fields.php to allow javascript code to be inserted on individual custom fields. This can be very useful for complex fee calculations or other client-side checks required on the registration form. This is done by inserting the custom code in the "description field" of the custom field with the keyword "//code" preceding the function to be inserted and added to the onchange javascript event of the custom field.


=> It is is possible, please zip the file you modified and upload it here. I will check and if it is possible, I will add it into the extension in the next release .

Regards,

Tuan

Attachment group-20120521.zip not found

Attachments:

Please Log in or Create an account to join the conversation.

  • relbud
  • Topic Author
  • Offline
  • New Member
  • New Member
More
12 years 11 months ago #15605 by relbud
Replied by relbud on topic Re: Bug allowing oversubscription
Hi Tuan,

Thanks for your rapid reply and quick fix! I have installed it and it seems to work.

I have attached the helper/fields.php file below.

In order to use it, you just include "//code" as the first entry in the description field of the custom field.

Then put the body of your function following in the description.

Perhaps down the track we could add another field for custom javascript code so as not to have to use the description field, but I couldn't see where the description field was used anyway...

Let me know if you need any more info about it.

I have also attached a stgeorge payment gateway implementation that I wrote (hacked together :). It is pretty messy, but is in live production and I've not had any problems with it. Thought it might be useful for people...

cheers,
Ariel

Attachment files.zip not found

Attachments:

Please Log in or Create an account to join the conversation.

Moderators: Tuan Pham Ngoc