You are here

function lingotek_setup in Lingotek Translation 7.2

Same name and namespace in other branches
  1. 7.7 lingotek.setup.inc \lingotek_setup()
  2. 7.3 lingotek.setup.inc \lingotek_setup()
  3. 7.4 lingotek.setup.inc \lingotek_setup()
  4. 7.5 lingotek.setup.inc \lingotek_setup()
  5. 7.6 lingotek.setup.inc \lingotek_setup()

Routing: Returning User, New Account or Already Setup

1 string reference to 'lingotek_setup'
lingotek_menu in ./lingotek.module
Implements hook_menu().

File

./lingotek.setup.inc, line 11
Lingotek Easy Install Process.

Code

function lingotek_setup() {

  // Check the current settings
  $current_community_identifier = variable_get('lingotek_community_identifier', '');
  $current_oauth_consumer_id = variable_get('lingotek_oauth_consumer_id', '');
  $current_oauth_consumer_secret = variable_get('lingotek_oauth_consumer_secret', '');
  $current_login_id = variable_get('lingotek_login_id', '');
  $current_project = variable_get('lingotek_project', '');
  $current_vault = variable_get('lingotek_vault', '');
  $current_workflow = variable_get('lingotek_workflow', '');

  // Does the install already have connection credentials?
  if ($current_community_identifier == '' || $current_oauth_consumer_id == '' || $current_oauth_consumer_secret == '' || $current_login_id == '' || $current_project == '' || $current_vault == '' || $current_workflow == '') {
    drupal_goto('admin/config/lingotek/new-account');

    // If something is missing - Go though the Setup Process
  }
  else {
    drupal_goto('admin/lingotek');

    // We already have credentials, goto the Dashboard
  }
}