From 15aaedb951973d1d51d7dfc4818489212adfa6f3 Mon Sep 17 00:00:00 2001 From: Shish Date: Wed, 5 Jun 2024 12:50:12 +0100 Subject: [PATCH] [danbooru2] minor fixes for signup form --- themes/danbooru2/user.theme.php | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) diff --git a/themes/danbooru2/user.theme.php b/themes/danbooru2/user.theme.php index 3772db16..6dd1b0cc 100644 --- a/themes/danbooru2/user.theme.php +++ b/themes/danbooru2/user.theme.php @@ -65,13 +65,19 @@ class CustomUserPageTheme extends UserPageTheme public function display_signup_page(Page $page): void { - global $config; + global $config, $user; $tac = $config->get_string("login_tac", ""); $tac = send_event(new TextFormattingEvent($tac))->formatted; $reca = "".captcha_get_html().""; + $email_required = ( + $config->get_bool("user_email_required") && + !$user->can(Permissions::CREATE_OTHER_USER) + ); + $email_text = $email_required ? "Email" : "Email (Optional)"; + if (empty($tac)) { $html = ""; } else { @@ -84,8 +90,8 @@ class CustomUserPageTheme extends UserPageTheme Name Password Repeat Password - Email (Optional) - $reca; + $email_text + $reca