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,9 +12,17 @@ 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');
$query->condition('p.booking_tempid', arg(1), '=')