--- a/lib/common.inc.php +++ b/lib/common.inc.php @@ -11,18 +11,22 @@ } define('ROOT', pathinfo(__FILE__, PATHINFO_DIRNAME)); -if (strstr($_SERVER['PHP_SELF'], "labs/")) { +if (strstr($_SERVER['PHP_SELF'], "labs/") || strstr($_SERVER['PHP_SELF'], "admin/") || strstr($_SERVER['PHP_SELF'], "heuristics/")) { $basePath = "../"; } + if (php_sapi_name() != "cli") { + require $basePath."lib/amon-php/amon.php"; Amon::config(array('address'=> 'http://127.0.0.1:2464', 'protocol' => 'http', 'secret_key' => "JBcSUdFOi5lK0vCjLjbHDpQamcBnRA4iV7QLaTADeDQ")); Amon::setup_exception_handler(); + } require ROOT . DIRECTORY_SEPARATOR . '..' . DIRECTORY_SEPARATOR . 'lib' . DIRECTORY_SEPARATOR . 'openid.php'; $openid = new LightOpenID($_SERVER['HTTP_HOST']); - +// you have to open the session to be able to modify or remove it +session_start(); function login() { global $openid; if (!$openid->mode) {