Browse files

controller prevents over-capacity when use clicks attend but event al…

…ready full
  • Loading branch information...
1 parent 6a7bc12 commit 519a8a61f817be95cd34c21e87c1bb7c55a7f19a @brindy committed May 26, 2012
Showing with 11 additions and 0 deletions.
  1. +11 −0 controllers/base.php
  2. BIN langs.zip
View
11 controllers/base.php
@@ -1126,6 +1126,17 @@ public function attendFormResponder()
// exit(json_encode($respondArray));
// }
+ $attendeeCount = $this->eventService->findEventUsersCount( $event->id, EVENT_BOL_EventService::USER_STATUS_YES );
+ $attendeeLimit = $event->getAttendeeLimit();
+ if ( isset( $attendeeLimit ) && $attendeeCount >= $event->getAttendeeLimit() )
+ {
+ if ( (int) $_POST['attend_status'] == EVENT_BOL_EventService::USER_STATUS_YES )
+ {
+ $respondArray['message'] = OW::getLanguage()->text('event', 'user_status_event_full_error');
+ exit(json_encode($respondArray));
+ }
+ }
+
if ( $eventUser === null )
{
$eventUser = new EVENT_BOL_EventUser();
View
BIN langs.zip
Binary file not shown.

0 comments on commit 519a8a6

Please sign in to comment.