From: joshuaruesweg Date: Fri, 22 May 2020 14:30:35 +0000 (+0200) Subject: Add new user quick search filter for pending activations X-Git-Tag: 5.3.0_Alpha_1~182^2~20 X-Git-Url: https://git.stricted.de/?a=commitdiff_plain;h=ab129052fcdb45ca06b58db1c8884e2429bb6af5;p=GitHub%2FWoltLab%2FWCF.git Add new user quick search filter for pending activations --- diff --git a/wcfsetup/install/files/acp/templates/userSearch.tpl b/wcfsetup/install/files/acp/templates/userSearch.tpl index b5c240cdde..eb9e6216ef 100644 --- a/wcfsetup/install/files/acp/templates/userSearch.tpl +++ b/wcfsetup/install/files/acp/templates/userSearch.tpl @@ -19,6 +19,7 @@
  • {lang}wcf.acp.user.quickSearch.banned{/lang}
  • {lang}wcf.acp.user.quickSearch.newest{/lang}
  • {lang}wcf.acp.user.quickSearch.disabled{/lang}
  • +
  • {lang}wcf.acp.user.quickSearch.pendingActivation{/lang}
  • {lang}wcf.acp.user.quickSearch.disabledAvatars{/lang}
  • {lang}wcf.acp.user.quickSearch.disabledSignatures{/lang}
  • diff --git a/wcfsetup/install/files/lib/acp/action/UserQuickSearchAction.class.php b/wcfsetup/install/files/lib/acp/action/UserQuickSearchAction.class.php index 3883185b1c..2f38de8fc3 100644 --- a/wcfsetup/install/files/lib/acp/action/UserQuickSearchAction.class.php +++ b/wcfsetup/install/files/lib/acp/action/UserQuickSearchAction.class.php @@ -2,6 +2,8 @@ namespace wcf\acp\action; use wcf\data\search\SearchEditor; use wcf\action\AbstractAction; +use wcf\data\user\User; +use wcf\system\database\util\PreparedStatementConditionBuilder; use wcf\system\exception\NamedUserException; use wcf\system\menu\acp\ACPMenu; use wcf\system\request\LinkHandler; @@ -126,6 +128,26 @@ class UserQuickSearchAction extends AbstractAction { $this->matches = $statement->fetchAll(\PDO::FETCH_COLUMN); break; + case 'pendingActivation': + $conditionBuilder = new PreparedStatementConditionBuilder(); + $conditionBuilder->add('activationCode <> ?', [0]); + if (REGISTER_ACTIVATION_METHOD & User::REGISTER_ACTIVATION_USER) { + $conditionBuilder->add('emailConfirmed IS NULL'); + } + + $this->sortField = 'registrationDate'; + $this->sortOrder = 'DESC'; + $sql = "SELECT user_table.userID + FROM wcf".WCF_N."_user user_table + LEFT JOIN wcf".WCF_N."_user_option_value option_value + ON (option_value.userID = user_table.userID) + ". $conditionBuilder ." + ORDER BY user_table.registrationDate DESC"; + $statement = WCF::getDB()->prepareStatement($sql, $this->maxResults); + $statement->execute($conditionBuilder->getParameters()); + $this->matches = $statement->fetchAll(\PDO::FETCH_COLUMN); + break; + case 'disabledAvatars': $sql = "SELECT user_table.userID FROM wcf".WCF_N."_user user_table diff --git a/wcfsetup/install/files/lib/acp/page/IndexPage.class.php b/wcfsetup/install/files/lib/acp/page/IndexPage.class.php index 176ea6aef8..8507138ea0 100755 --- a/wcfsetup/install/files/lib/acp/page/IndexPage.class.php +++ b/wcfsetup/install/files/lib/acp/page/IndexPage.class.php @@ -4,6 +4,7 @@ use wcf\data\user\User; use wcf\page\AbstractPage; use wcf\system\application\ApplicationHandler; use wcf\system\cache\builder\OptionCacheBuilder; +use wcf\system\database\util\PreparedStatementConditionBuilder; use wcf\system\io\RemoteFile; use wcf\system\package\PackageInstallationDispatcher; use wcf\system\request\LinkHandler; @@ -58,11 +59,17 @@ class IndexPage extends AbstractPage { $usersAwaitingApproval = 0; if (REGISTER_ACTIVATION_METHOD & User::REGISTER_ACTIVATION_ADMIN) { + $conditionBuilder = new PreparedStatementConditionBuilder(); + $conditionBuilder->add('activationCode <> ?', [0]); + if (REGISTER_ACTIVATION_METHOD & User::REGISTER_ACTIVATION_USER) { + $conditionBuilder->add('emailConfirmed IS NULL'); + } + $sql = "SELECT COUNT(*) - FROM wcf".WCF_N."_user - WHERE activationCode <> 0"; + FROM wcf".WCF_N."_user ". + $conditionBuilder; $statement = WCF::getDB()->prepareStatement($sql); - $statement->execute(); + $statement->execute($conditionBuilder->getParameters()); $usersAwaitingApproval = $statement->fetchSingleColumn(); } diff --git a/wcfsetup/install/lang/de.xml b/wcfsetup/install/lang/de.xml index a1646e10c6..91e580143e 100644 --- a/wcfsetup/install/lang/de.xml +++ b/wcfsetup/install/lang/de.xml @@ -3143,6 +3143,7 @@ Wenn {if LANGUAGE_USE_INFORMAL_VARIANT}du{else}Sie{/if} unter „Konfiguration + {#$usersAwaitingApproval} Benutzer {if $usersAwaitingApproval == 1}wartet auf seine{else}warten auf ihre{/if} Aktivierung.]]> diff --git a/wcfsetup/install/lang/en.xml b/wcfsetup/install/lang/en.xml index 8b365ef0a2..b61535a7ca 100644 --- a/wcfsetup/install/lang/en.xml +++ b/wcfsetup/install/lang/en.xml @@ -3069,10 +3069,11 @@ You can define the default sender in “Configuration » Options » General » E - + + - {#$usersAwaitingApproval} User{if $usersAwaitingApproval != 1}s{/if} {if $usersAwaitingApproval == 1}is{else}are{/if} awaiting your approval.]]> + {#$usersAwaitingApproval} User{if $usersAwaitingApproval != 1}s{/if} {if $usersAwaitingApproval == 1}is{else}are{/if} awaiting your approval.]]>