public static function getCurrentUser() { if (!is_null(self::$_current_user)) { return self::$_current_user; } $auth_token = null; if (isset($_GET["auth_token"])) { $auth_token = $_GET["auth_token"]; } else { if (isset($_POST["auth_token"])) { $auth_token = $_POST["auth_token"]; } else { if (isset($_GET["at"])) { $auth_token = $_GET["at"]; } else { if (isset($_POST["at"])) { $auth_token = $_POST["at"]; } else { $sm = SessionManager::getInstance(); $auth_token = $sm->GetCookie("at"); } } } } self::$_current_user = null; if (!is_null($auth_token)) { self::$_current_user = SesionDAO::getUserByAuthToken($auth_token); } /* //there is authtoken in the POST message if( isset($_POST["at"]) && !is_null($_POST["at"]) ){ //Logger::log("post"); self::$_current_user = SesionDAO::getUserByAuthToken( $_POST["at"] ); } //there is authtoken in the GET message if(isset($_GET["at"]) && !is_null($_GET["at"])){ //Logger::log("get"); self::$_current_user = SesionDAO::getUserByAuthToken( $_GET["at"] ); } */ return self::$_current_user; }