From bd665d61108df0f262e6ae4085f5deff1020d22e Mon Sep 17 00:00:00 2001 From: Nathan Coad Date: Wed, 25 May 2016 11:17:17 +1000 Subject: [PATCH] Add travel-form enabled check to travel form page --- booking.travel.inc | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/booking.travel.inc b/booking.travel.inc index 60bebc2..84b8969 100644 --- a/booking.travel.inc +++ b/booking.travel.inc @@ -12,8 +12,16 @@ function booking_travel_page() { if (! preg_match('/^[0-9A-Fa-f\-]+$/', arg(1))) { //parameter from url is not what we were expecting drupal_set_message("Error: Invalid session ID supplied. Please use the contact us form to let us know.", 'error', FALSE); + drupal_goto('content/travel'); return ""; - } + } + + if (variable_get('booking_enable_travelform', 0) == 0) { + drupal_set_message("Error: The travel form is not enabled. Please use the contact us form to inform the site owner of this error.", 'error', FALSE); + drupal_goto('content/travel'); + return ""; + } + //work out the node id from the session id $query = db_select('booking_person', 'p'); @@ -659,4 +667,4 @@ function travel_view($node, $view_mode) { '#weight' => 1, ); return $node; -} \ No newline at end of file +}