Add travel-form enabled check to travel form page

This commit is contained in:
2016-05-25 11:17:17 +10:00
parent 4d3bcb4949
commit bd665d6110

View File

@@ -12,8 +12,16 @@ function booking_travel_page() {
if (! preg_match('/^[0-9A-Fa-f\-]+$/', arg(1))) { if (! preg_match('/^[0-9A-Fa-f\-]+$/', arg(1))) {
//parameter from url is not what we were expecting //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_set_message("Error: Invalid session ID supplied. Please use the contact us form to let us know.", 'error', FALSE);
drupal_goto('content/travel');
return ""; 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 //work out the node id from the session id
$query = db_select('booking_person', 'p'); $query = db_select('booking_person', 'p');
@@ -659,4 +667,4 @@ function travel_view($node, $view_mode) {
'#weight' => 1, '#weight' => 1,
); );
return $node; return $node;
} }