You are here

function gauth_user_services_user_account_create in Google Auth 7

Same name and namespace in other branches
  1. 7.2 gauth_user/gauth_user.pages.inc \gauth_user_services_user_account_create()

Function creates a service account of the specified type.

1 string reference to 'gauth_user_services_user_account_create'
gauth_user_menu in gauth_user/gauth_user.module
Implements hook_menu().

File

gauth_user/gauth_user.pages.inc, line 57
User pages for Google Auth User Services.

Code

function gauth_user_services_user_account_create($type) {
  $account = gauth_user_services_load($type, FALSE);
  $gauth_account = array(
    'client_id' => $account['client_id'],
    'client_secret' => $account['client_secret'],
    'developer_key' => $account['developer_key'],
    'services' => $account['services'],
    'name' => $type . '|' . $GLOBALS['user']->uid,
    'access_type' => $account['access_type'],
  );
  gauth_account_save($gauth_account);
  gauth_account_authenticate($type . '|' . $GLOBALS['user']->uid, TRUE);
}