mirror of
https://github.com/standardebooks/web.git
synced 2025-07-18 12:26:39 -04:00
Replace Template::Emit...() functions with more generic function
This commit is contained in:
parent
f449c024ea
commit
806939ca49
40 changed files with 86 additions and 68 deletions
|
@ -32,13 +32,13 @@ try{
|
|||
}
|
||||
}
|
||||
catch(Exceptions\EbookNotFoundException){
|
||||
Template::Emit404();
|
||||
Template::ExitWithCode(Enums\HttpCode::NotFound);
|
||||
}
|
||||
catch(Exceptions\LoginRequiredException){
|
||||
Template::RedirectToLogin();
|
||||
}
|
||||
catch(Exceptions\InvalidPermissionsException){
|
||||
Template::Emit403();
|
||||
Template::ExitWithCode(Enums\HttpCode::Forbidden);
|
||||
}
|
||||
?>
|
||||
<?= Template::Header(
|
||||
|
|
|
@ -21,7 +21,7 @@ try{
|
|||
}
|
||||
}
|
||||
catch(Exceptions\EbookNotFoundException){
|
||||
Template::Emit404();
|
||||
Template::ExitWithCode(Enums\HttpCode::NotFound);
|
||||
}
|
||||
?><?= Template::Header(
|
||||
[
|
||||
|
|
|
@ -55,7 +55,7 @@ catch(Exceptions\LoginRequiredException){
|
|||
Template::RedirectToLogin();
|
||||
}
|
||||
catch(Exceptions\InvalidPermissionsException){
|
||||
Template::Emit403(); // No permissions to create an ebook placeholder.
|
||||
Template::ExitWithCode(Enums\HttpCode::Forbidden); // No permissions to create an ebook placeholder.
|
||||
}
|
||||
?>
|
||||
<?= Template::Header(
|
||||
|
|
|
@ -110,7 +110,7 @@ catch(Exceptions\LoginRequiredException){
|
|||
Template::RedirectToLogin();
|
||||
}
|
||||
catch(Exceptions\InvalidPermissionsException | Exceptions\InvalidHttpMethodException | Exceptions\HttpMethodNotAllowedException){
|
||||
Template::Emit403();
|
||||
Template::ExitWithCode(Enums\HttpCode::Forbidden);
|
||||
}
|
||||
catch(Exceptions\AppException $ex){
|
||||
$_SESSION['ebook'] = $ebook;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue