From b70ba1da6f8a8ace878a9aeae2b48eeab56ec2ca Mon Sep 17 00:00:00 2001 From: Timothy J Warren Date: Tue, 29 Jan 2019 16:01:31 -0500 Subject: [PATCH] Consistent spacing around auth checks --- src/Controller/Anime.php | 2 ++ src/Controller/AnimeCollection.php | 4 ++++ src/Controller/Manga.php | 4 ++++ src/Controller/Misc.php | 1 + 4 files changed, 11 insertions(+) diff --git a/src/Controller/Anime.php b/src/Controller/Anime.php index 47be217b..0f63dc6d 100644 --- a/src/Controller/Anime.php +++ b/src/Controller/Anime.php @@ -172,6 +172,7 @@ final class Anime extends BaseController { public function edit(string $id, $status = 'all'): void { $this->checkAuth(); + $item = $this->model->getLibraryItem($id); $this->setSessionRedirect(); @@ -210,6 +211,7 @@ final class Anime extends BaseController { public function formUpdate(): void { $this->checkAuth(); + $data = $this->request->getParsedBody(); // Do some minor data manipulation for diff --git a/src/Controller/AnimeCollection.php b/src/Controller/AnimeCollection.php index 3332bf64..3e0e382f 100644 --- a/src/Controller/AnimeCollection.php +++ b/src/Controller/AnimeCollection.php @@ -112,6 +112,7 @@ final class AnimeCollection extends BaseController { public function form($id = NULL): void { $this->checkAuth(); + $this->setSessionRedirect(); $action = $id === NULL ? 'Add' : 'Edit'; @@ -140,6 +141,7 @@ final class AnimeCollection extends BaseController { public function edit(): void { $this->checkAuth(); + $data = $this->request->getParsedBody(); if (array_key_exists('hummingbird_id', $data)) { @@ -166,6 +168,7 @@ final class AnimeCollection extends BaseController { public function add(): void { $this->checkAuth(); + $data = $this->request->getParsedBody(); if (array_key_exists('id', $data)) { @@ -197,6 +200,7 @@ final class AnimeCollection extends BaseController { public function delete(): void { $this->checkAuth(); + $data = $this->request->getParsedBody(); if ( ! array_key_exists('hummingbird_id', $data)) { diff --git a/src/Controller/Manga.php b/src/Controller/Manga.php index ed269482..9c97c1cb 100644 --- a/src/Controller/Manga.php +++ b/src/Controller/Manga.php @@ -112,6 +112,7 @@ final class Manga extends Controller { public function addForm(): void { $this->checkAuth(); + $statuses = MangaReadingStatus::KITSU_TO_TITLE; $this->setSessionRedirect(); @@ -135,6 +136,7 @@ final class Manga extends Controller { public function add(): void { $this->checkAuth(); + $data = $this->request->getParsedBody(); if ( ! array_key_exists('id', $data)) { @@ -175,6 +177,7 @@ final class Manga extends Controller { public function edit($id, $status = 'All'): void { $this->checkAuth(); + $this->setSessionRedirect(); $item = $this->model->getLibraryItem($id); $title = $this->formatTitle( @@ -214,6 +217,7 @@ final class Manga extends Controller { public function formUpdate(): void { $this->checkAuth(); + $data = $this->request->getParsedBody(); // Do some minor data manipulation for diff --git a/src/Controller/Misc.php b/src/Controller/Misc.php index a93ace98..b73afc5b 100644 --- a/src/Controller/Misc.php +++ b/src/Controller/Misc.php @@ -90,6 +90,7 @@ final class Misc extends BaseController { public function logout(): void { $this->checkAuth(); + $auth = $this->container->get('auth'); $auth->logout();