4in1_ws_web/handlers/ServicesHandler.php

25 lines
568 B
PHP

<?php
class ServicesHandler extends request_handler {
public function GET_robots_txt() {
$txt = <<<TXT
User-agent: *
Disallow: /admin/
TXT;
header('Content-Type: text/plain');
echo $txt;
exit;
}
public function GET_latest() {
global $config;
list($lang) = $this->input('lang');
if (!isset($config['book_versions'][$lang]))
self::notFound();
self::redirect("https://files.4in1.ws/4in1-{$lang}.pdf?{$config['book_versions'][$lang]}",
code: HTTPCode::Found);
}
}