Esempio n. 1
0
 *
 * @copyright Copyright Intermesh
 * @version $Id: index.php 8246 2011-10-05 13:55:38Z mschering $
 * @author Merijn Schering <*****@*****.**>
 */
ini_set('display_errors', 'On');
$root = dirname(__FILE__) . '/';
//initialize autoloading of library
require_once 'GO.php';
//\GO::init();
if (!GO::isInstalled()) {
    header('Location: ' . \GO::config()->host . 'install/');
    exit;
}
if (empty($_REQUEST['r']) && PHP_SAPI != 'cli') {
    if (\GO::config()->force_ssl && !\GO\Base\Util\Http::isHttps()) {
        header("HTTP/1.1 301 Moved Permanently");
        header("Location: https://" . $_SERVER["HTTP_HOST"] . $_SERVER["REQUEST_URI"]);
        exit;
    }
}
if (!\GO::user()) {
    \GO::session()->loginWithCookies();
}
//try with HTTP auth
if (!\GO::user() && !empty($_SERVER['PHP_AUTH_USER']) && !empty($_SERVER['PHP_AUTH_PW'])) {
    if (\GO::session()->login($_SERVER['PHP_AUTH_USER'], $_SERVER['PHP_AUTH_PW'])) {
        //security token not requireed when using basic auth.
        $_REQUEST['security_token'] = \GO::session()->securityToken();
    }
}