From cc9cd396ad5201a24b7f8f9f5a21d880fb722006 Mon Sep 17 00:00:00 2001 From: Shish Date: Thu, 18 Jan 2024 15:56:14 +0000 Subject: [PATCH] [r34] remove dead code --- ext/rule34/main.php | 33 --------------------------------- ext/rule34/theme.php | 26 -------------------------- 2 files changed, 59 deletions(-) delete mode 100644 ext/rule34/theme.php diff --git a/ext/rule34/main.php b/ext/rule34/main.php index 6cd43a87..533bf150 100644 --- a/ext/rule34/main.php +++ b/ext/rule34/main.php @@ -9,8 +9,6 @@ use Symfony\Component\Console\Command\Command; use Symfony\Component\Console\Input\{InputInterface,InputArgument}; use Symfony\Component\Console\Output\OutputInterface; -use function MicroHTML\{emptyHTML, A}; - if ( // kill these glitched requests immediately !empty($_SERVER["REQUEST_URI"]) @@ -22,9 +20,6 @@ if ( class Rule34 extends Extension { - /** @var Rule34Theme */ - protected Themelet $theme; - public function onImageDeletion(ImageDeletionEvent $event): void { global $database; @@ -47,15 +42,6 @@ class Rule34 extends Extension $page->add_block(new Block("Cache Purger", $html)); } - public function onUserPageBuilding(UserPageBuildingEvent $event): void - { - global $database, $user, $config; - if ($user->can(Permissions::CHANGE_SETTING) && $config->get_bool('r34_comic_integration')) { - $current_state = bool_escape($database->get_one("SELECT comic_admin FROM users WHERE id=:id", ['id' => $event->display_user->id])); - $this->theme->show_comic_changer($event->display_user, $current_state); - } - } - public function onCliGen(CliGenEvent $event): void { $event->app->register('wipe-thumb-cache') @@ -101,25 +87,6 @@ class Rule34 extends Extension $page->add_html_header(""); $page->add_html_header(""); - if (function_exists("sd_notify_watchdog")) { - \sd_notify_watchdog(); - } - - if ($event->page_matches("rule34/comic_admin")) { - if ($user->can(Permissions::CHANGE_SETTING) && $user->check_auth_token()) { - $input = validate_input([ - 'user_id' => 'user_id,exists', - 'is_admin' => 'bool', - ]); - $database->execute( - 'UPDATE users SET comic_admin=:is_admin WHERE id=:id', - ['is_admin' => $input['is_admin'] ? 't' : 'f', 'id' => $input['user_id']] - ); - $page->set_mode(PageMode::REDIRECT); - $page->set_redirect(referer_or(make_link())); - } - } - if ($event->page_matches("tnc_agreed")) { setcookie("ui-tnc-agreed", "true", 0, "/"); $page->set_mode(PageMode::REDIRECT); diff --git a/ext/rule34/theme.php b/ext/rule34/theme.php deleted file mode 100644 index 9505b9d5..00000000 --- a/ext/rule34/theme.php +++ /dev/null @@ -1,26 +0,0 @@ - 'hidden', "name" => 'user_id', "value" => $duser->id]), - LABEL(INPUT(["type" => 'checkbox', "name" => 'is_admin', "checked" => $current_state]), "Comic Admin"), - BR(), - SHM_SUBMIT("Set") - ); - - $page->add_block(new Block("Rule34 Comic Options", $html)); - } -}