You are here

function hosting_site_goto in Hosting 7.3

Same name and namespace in other branches
  1. 6.2 site/hosting_site.module \hosting_site_goto()
  2. 7.4 site/hosting_site.module \hosting_site_goto()

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 site/hosting_site.module
Implements hook_menu().

File

site/hosting_site.module, line 211
Contains hook implementations for Hosting site module.

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_object($cache) && REQUEST_TIME < $cache->data['expire']) {
    $theurl = $cache->data['link'];
    cache_clear_all($cid, 'cache');
  }
  else {
    $theurl = _hosting_site_url($node);
  }
  drupal_goto($theurl);
  exit;
}