function url($path, $opt = null) { $url = ""; if ($opt['ssl'] && $_SERVER['HTTPS'] != 'on') { $context = \CADB\Model\Context::instance(); $service = $context->getProperty('service.*'); if ($service['ssl']) { $url = "https://" . (!preg_match("/:\\/\\//i", $path) ? $_SERVER['HTTP_HOST'] : ""); } } else { if ($opt['ssl'] == false && $_SERVER['HTTPS'] == 'on') { $url = !preg_match("/:\\/\\//i", $path) ? "http://" . $_SERVER['HTTP_HOST'] : ""; } } if (ROOT != '.' && !preg_match("/:\\/\\//i", $path)) { $p = strtok($path, "/"); if (in_array($p, array('resources', 'contribute', 'themes', 'files'))) { $path = ROOT . "/" . $path; } } $url .= (!preg_match("/:\\/\\//i", $path) ? \CADB\Lib\base_uri() : "") . ($path == \CADB\Lib\base_uri() ? "" : $path); if ($opt['query']) { $url .= "?" . (is_array($opt['query']) ? http_build_query($opt['query']) : $opt['query']); } if (substr($url, 0, 2) == "//") { $url = substr($url, 1); } $url = preg_replace("/\\/\\/\$/i", "/", $url); return $url; }
public function process() { \CADB\Log::accessLog('logout'); \CADB\Lib\logout(); if ($_GET['requestURI']) { \CADB\Lib\RedirectURL(rawurldecode($_GET['requestURI'])); } else { \CADB\Lib\RedirectURL(\CADB\Lib\base_uri()); } }