You are here

function hosting_site_goto in Hostmaster (Aegir) 6

Menu callback to go to your site.

This needs to be a callback because the link is only going to work once, so this will remove the link from the cache and just redirect to the site not the login page.

1 string reference to 'hosting_site_goto'
hosting_site_menu in modules/hosting/site/hosting_site.module
Implementation of hook_menu()

File

modules/hosting/site/hosting_site.module, line 123

Code

function hosting_site_goto($node) {
  $cid = "hosting:site:" . $node->nid . ":login_link";
  $cache = cache_get($cid);
  if (user_access('create login-reset task') && !is_null($cache) && time() < $cache->data['expire']) {
    $theurl = $cache->data['link'];
    cache_clear_all($cid, 'cache');
  }
  else {
    $theurl = _hosting_site_url($node);
  }
  drupal_goto($theurl);
  exit;
}