diff --git a/profiles/openenterprise/modules/contrib/google_analytics_reports/google_analytics_reports_api/google_analytics_reports_api.pages.inc b/profiles/openenterprise/modules/contrib/google_analytics_reports/google_analytics_reports_api/google_analytics_reports_api.pages.inc index bd96613..aab6dad 100644 --- a/profiles/openenterprise/modules/contrib/google_analytics_reports/google_analytics_reports_api/google_analytics_reports_api.pages.inc +++ b/profiles/openenterprise/modules/contrib/google_analytics_reports/google_analytics_reports_api/google_analytics_reports_api.pages.inc @@ -149,6 +149,22 @@ function google_analytics_reports_api_admin() { '#description' => t('Client Secret created for the app in the Google API Console'), '#weight' => -8, ); + + + $redirect_uri = variable_get('google_analytics_reports_redirect_uri', GoogleAnalyticsReportsApiFeed::currentUrl()); + $form['setup']['redirect_host'] = array( + '#type' => 'textfield', + '#title' => t('Redirect host'), + '#default_value' => variable_get('google_analytics_reports_redirect_host', ''), + '#size' => 30, + '#description' => t('Use to override the host for the callback uri. Include schema and host, but not uri path. Example: http://example.com. Current redirect URI is %redirect_uri. Leave blank to use default.', + array( + '%redirect_uri' => $redirect_uri, + ) + ), + '#weight' => -7, + ); + $form['setup']['setup_submit'] = array( '#type' => 'submit', '#value' => t('Start setup and authorize account'), @@ -170,6 +186,10 @@ function google_analytics_reports_api_admin_submit($form, &$form_state) { $client_id = $form_state['values']['client_id']; $client_secret = $form_state['values']['client_secret']; $redirect_uri = GoogleAnalyticsReportsApiFeed::currentUrl(); + if (!empty($form_state['values']['redirect_host'])) { + variable_set('google_analytics_reports_redirect_host', $form_state['values']['redirect_host']); + $redirect_uri = $form_state['values']['redirect_host'] . $_SERVER['REQUEST_URI']; + } variable_set('google_analytics_reports_client_id', $client_id); variable_set('google_analytics_reports_client_secret', $client_secret); variable_set('google_analytics_reports_redirect_uri', $redirect_uri);