You are here

function yandex_services_auth_admin_settings_submit in Yandex Services Authorization API 6

Same name and namespace in other branches
  1. 7 yandex_services_auth.admin.inc \yandex_services_auth_admin_settings_submit()

Form submit callback for yandex_services_auth_admin_settings form.

File

./yandex_services_auth.admin.inc, line 63
Admin pages for the Yandex Services Authorization API module.

Code

function yandex_services_auth_admin_settings_submit($form, &$form_state) {
  $client_id = $form_state['values']['yandex_services_auth_client_id'];
  variable_set('yandex_services_auth_client_id', $form_state['values']['yandex_services_auth_client_id']);
  variable_set('yandex_services_auth_client_secret', $form_state['values']['yandex_services_auth_client_secret']);
  $request_url = 'https://oauth.yandex.ru/authorize';
  $state = drupal_random_key();
  $_SESSION['yandex_services_auth']['state'] = $state;
  $query = array(
    'response_type' => 'code',
    'client_id' => $client_id,
    'state' => $state,
  );
  drupal_goto($request_url, $query);
}