Merge branch 'branch-2.10'
This commit is contained in:
commit
4d5b03c5a0
2 changed files with 0 additions and 59 deletions
|
@ -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("<meta name='theme-color' content='#7EB977'>");
|
||||
$page->add_html_header("<meta name='juicyads-site-verification' content='20d309e193510e130c3f8a632f281335'>");
|
||||
|
||||
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);
|
||||
|
|
|
@ -1,26 +0,0 @@
|
|||
<?php
|
||||
|
||||
declare(strict_types=1);
|
||||
|
||||
namespace Shimmie2;
|
||||
|
||||
use function MicroHTML\INPUT;
|
||||
use function MicroHTML\LABEL;
|
||||
use function MicroHTML\BR;
|
||||
|
||||
class Rule34Theme extends Themelet
|
||||
{
|
||||
public function show_comic_changer(User $duser, bool $current_state): void
|
||||
{
|
||||
global $page;
|
||||
$html = (string)SHM_SIMPLE_FORM(
|
||||
"rule34/comic_admin",
|
||||
INPUT(["type" => '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));
|
||||
}
|
||||
}
|
Reference in a new issue