Temporarily disable feed authentication

This commit is contained in:
Alex Cabal 2022-07-14 12:50:39 -05:00
parent 30442c0c62
commit 7341304729

View file

@ -18,23 +18,23 @@ try{
}
// Certain user agents may bypass login entirely
if(isset($_SERVER['HTTP_USER_AGENT'])){
$isUserAgentAllowed = (bool)Db::QueryInt('select count(*) from FeedUserAgents where instr(?, UserAgent) limit 1', [$_SERVER['HTTP_USER_AGENT']]);
}
// if(isset($_SERVER['HTTP_USER_AGENT'])){
// $isUserAgentAllowed = (bool)Db::QueryInt('select count(*) from FeedUserAgents where instr(?, UserAgent) limit 1', [$_SERVER['HTTP_USER_AGENT']]);
// }
if(!$isUserAgentAllowed){
if($GLOBALS['User'] === null){
throw new Exceptions\LoginRequiredException();
}
// if(!$isUserAgentAllowed){
// if($GLOBALS['User'] === null){
// throw new Exceptions\LoginRequiredException();
// }
if(!preg_match('/\.xml$/ius', $path)){
throw new Exceptions\InvalidPermissionsException();
}
// if(!preg_match('/\.xml$/ius', $path)){
// throw new Exceptions\InvalidPermissionsException();
// }
if(!$GLOBALS['User']->Benefits->CanAccessFeeds){
throw new Exceptions\InvalidPermissionsException();
}
}
// if(!$GLOBALS['User']->Benefits->CanAccessFeeds){
// throw new Exceptions\InvalidPermissionsException();
// }
// }
// Everything OK, serve the file using Apache.
// The xsendfile Apache module tells Apache to serve the file, including not-modified or etag headers.