mirror of
https://github.com/standardebooks/web.git
synced 2025-07-20 13:24:48 -04:00
Temporarily disable feed authentication
This commit is contained in:
parent
30442c0c62
commit
7341304729
1 changed files with 14 additions and 14 deletions
|
@ -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.
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue