about summary refs log tree commit diff stats
path: root/classes/Handler/GetlastreadHandler.php
diff options
context:
space:
mode:
Diffstat (limited to 'classes/Handler/GetlastreadHandler.php')
-rw-r--r--classes/Handler/GetlastreadHandler.php38
1 files changed, 0 insertions, 38 deletions
diff --git a/classes/Handler/GetlastreadHandler.php b/classes/Handler/GetlastreadHandler.php
deleted file mode 100644
index d6b82e7..0000000
--- a/classes/Handler/GetlastreadHandler.php
+++ /dev/null
@@ -1,38 +0,0 @@
-<?php
-
-namespace Handler;
-
-use AuthRequired;
-use ORM;
-use Request;
-use RequestHandlerInterface;
-use Response;
-
-class GetlastreadHandler implements RequestHandlerInterface, AuthRequired
-{
-	public function handle(Request $request): Response
-	{
-		$bookid = (int) $request->getAttribute('id');
-		$owner = $_SESSION["owner"] ?? "";
-
-		if ($bookid) {
-			$book = ORM::for_table('epube_books')
-				->where('bookid', $bookid)
-				->where('owner', $owner)
-				->find_one();
-
-			if ($book) {
-				return (new Response())->withBody(json_encode([
-					"page" => (int)$book->lastread,
-					"cfi" => $book->lastcfi,
-					"total" => 100,
-					"timestamp" => (int)$book->lastts
-				]));
-			}
-		}
-
-		return (new Response())
-			->withStatus(404)
-			->withBody("Not found.");
-	}
-}