Example #1
0
	public function ping() {

		if (isset($_REQUEST['u-login']) && strlen($_REQUEST['u-login'])>0
			&& isset($_REQUEST['u-password']) && strlen($_REQUEST['u-password'])>0 ) {
				umiAuth::tryPreAuth();
		}

		 $ping = '0';

		//$permissions = permissionsCollection::getInstance();

		if($this->is_auth()) {
			$ping = 'ok';
			$this->updateUserLastRequestTime($this->user_id);
		}
		//session_destroy();

		$buffer = outputBuffer::current();
		$buffer-> contentType('text/html');
		$buffer-> option('generation-time', false);
		$buffer-> clear();
		$buffer-> push($ping);
		$buffer-> end();
	}
Example #2
0
}
// don't use getRequest('p') for this
if (isset($_GET['p']) && $_GET['p'] === '0' && !getRequest("xmlMode") && !getRequest("jsonMode")) {
    $urlInfo = parse_url($_SERVER['REQUEST_URI']);
    $vars = array();
    parse_str($urlInfo['query'], $vars);
    unset($vars['p']);
    $validUrl = $urlInfo['path'];
    if (count($vars)) {
        $validUrl .= '?' . http_build_query($vars);
    }
    $buffer->redirect($validUrl, '301 Moved Permanently', 301);
}
showWorkTime("buffer started");
if (PRE_AUTH_ENABLED) {
    umiAuth::tryPreAuth();
}
if (strpos(getServer("HTTP_REFERER"), getServer("HTTP_HOST")) !== 0) {
    $_SESSION["http_referer"] = getServer("HTTP_REFERER");
}
if (!getSession("http_target")) {
    $_SESSION["http_target"] = getServer("REQUEST_URI");
}
//Parse [stub] ini section
if ($config->get('stub', 'enabled')) {
    if (is_array($ips = $config->get('stub', 'filter.ip'))) {
        $enabled = !in_array(getServer('REMOTE_ADDR'), $ips);
    } else {
        $enabled = true;
    }
    if ($enabled) {