You are here

function yandex_metrics_reports_init in Yandex.Metrics 8.3

Same name and namespace in other branches
  1. 7.3 yandex_metrics_reports/yandex_metrics_reports.module \yandex_metrics_reports_init()
  2. 7.2 yandex_metrics_reports/yandex_metrics_reports.module \yandex_metrics_reports_init()

Implements hook_init().

File

yandex_metrics_reports/yandex_metrics_reports.module, line 83
The main code of Yandex.Metrics Reports module.

Code

function yandex_metrics_reports_init() {

  // Redirect from old authorization callback url to the new one.
  // It's necessary because old Yandex applications have old urls in their settings.
  if (arg(0) == 'yandex_metrics' && arg(1) == 'oauth' && module_exists('yandex_services_auth')) {
    drupal_goto('yandex_services_auth/oauth', array(
      'query' => drupal_get_query_parameters(),
    ));
  }
}