/** * @ignore */ public function generate_ga() { // generate analytics stuff $property_id = \cge_param::get_string($this->_config, 'cghm_ga_propertyid'); if (!$property_id) { return; } $linkdomains = \cge_param::get_string($this->_config, 'cghm_ga_linkdomains'); if ($linkdomains) { $linkdomains = $this->str_to_array($linkdomains); } $subdomains = \cge_param::get_bool($this->_config, 'cghm_ga_subdomains'); $domain = \cge_param::get_string($this->_config, 'cghm_ga_domain'); if ($subdomains && !$domain) { $sysconfig = \cms_config::get_instance(); $url = new \cms_url($sysconfig['root_url']); $domain = $url->get_host(); } $tpl = $this->CreateSmartyTemplate('google_analytics.tpl'); $tpl->assign('content_obj', \cms_utils::get_current_content()); $tpl->assign('config', $this->_config); $tpl->assign('domain', $domain); if (count($linkdomains)) { $tpl->assign('linkdomains', $linkdomains); } return $tpl->fetch(); }
if (isset($_POST['redirect_url'])) { $_SESSION['redirect_url'] = $_POST['redirect_url']; } if (isset($_SESSION["redirect_url"])) { if (isset($gCms->config) and $gCms->config['debug'] == true) { echo "Debug is on. Redirecting disabled... Please click this link to continue.<br />"; echo "<a href=\"" . $_SESSION["redirect_url"] . "\">" . $_SESSION["redirect_url"] . "</a><br />"; foreach ($gCms->errors as $globalerror) { echo $globalerror; } } else { // attempt to redirect to the originally requested page $tmp = $_SESSION["redirect_url"]; unset($_SESSION["redirect_url"]); if (strstr($tmp, CMS_SECURE_PARAM_NAME . '=') !== FALSE) { $the_url = new cms_url($tmp); $the_url->set_queryvar(CMS_SECURE_PARAM_NAME, $_SESSION[CMS_USER_KEY]); $tmp = (string) $the_url; } if (!strstr($tmp, '.php') || endswith($tmp, '/')) { // force the url to go to index.php $tmp = $config['admin_url'] . '/index.php?' . CMS_SECURE_PARAM_NAME . '=' . $_SESSION[CMS_USER_KEY]; debug_to_log('change session var to ' . $tmp); } redirect($tmp); } unset($_SESSION["redirect_url"]); } else { if (isset($config) and $config['debug'] == true) { $url = 'index.php?' . CMS_SECURE_PARAM_NAME . '=' . $_SESSION[CMS_USER_KEY]; echo "Debug is on. Redirecting disabled... Please click this link to continue.<br />";
/** * Attempt to determine the currently requested URL * * @deprecated * @return string */ public static function current_url() { // rebuild the current url. $config = cms_config::get_instance(); $url1 = new cms_url($_SERVER['REQUEST_URI']); $url2 = new cms_url($config['root_url']); $url1->set_scheme($url2->get_scheme()); $url1->set_host($url2->get_host()); $url1->set_port($url2->get_port()); $url1->set_user($url2->get_user()); $url1->set_pass($url2->get_pass()); return (string) $url1; }