function hosting_site_goto in Hosting 6.2
Same name and namespace in other branches
- 7.4 site/hosting_site.module \hosting_site_goto()
- 7.3 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 - Implementation of hook_menu()
File
- site/
hosting_site.module, line 166
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;
}