Add new user quick search filter for pending activations
authorjoshuaruesweg <ruesweg@woltlab.com>
Fri, 22 May 2020 14:30:35 +0000 (16:30 +0200)
committerjoshuaruesweg <ruesweg@woltlab.com>
Fri, 22 May 2020 14:30:35 +0000 (16:30 +0200)
wcfsetup/install/files/acp/templates/userSearch.tpl
wcfsetup/install/files/lib/acp/action/UserQuickSearchAction.class.php
wcfsetup/install/files/lib/acp/page/IndexPage.class.php
wcfsetup/install/lang/de.xml
wcfsetup/install/lang/en.xml

index b5c240cdde298903658f75f7c6951f394e920715..eb9e6216ef257d327a1f262c9a689bc31323fabe 100644 (file)
@@ -19,6 +19,7 @@
                                        <li><a href="{link controller='UserQuickSearch'}mode=banned{/link}">{lang}wcf.acp.user.quickSearch.banned{/lang}</a></li>
                                        <li><a href="{link controller='UserQuickSearch'}mode=newest{/link}">{lang}wcf.acp.user.quickSearch.newest{/lang}</a></li>
                                        <li><a href="{link controller='UserQuickSearch'}mode=disabled{/link}">{lang}wcf.acp.user.quickSearch.disabled{/lang}</a></li>
+                                       <li><a href="{link controller='UserQuickSearch'}mode=pendingActivation{/link}">{lang}wcf.acp.user.quickSearch.pendingActivation{/lang}</a></li>
                                        <li><a href="{link controller='UserQuickSearch'}mode=disabledAvatars{/link}">{lang}wcf.acp.user.quickSearch.disabledAvatars{/lang}</a></li>
                                        <li><a href="{link controller='UserQuickSearch'}mode=disabledSignatures{/link}">{lang}wcf.acp.user.quickSearch.disabledSignatures{/lang}</a></li>
                                        
index 3883185b1c5961c1edd0dff5a55e21337517050f..2f38de8fc317a734eb94cbb8d6a434b65000d503 100644 (file)
@@ -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
index 176ea6aef82980990e7e6fe7577c22868b3b06b7..8507138ea01e297ebf8b91fcb1a029dd0ccb7e83 100755 (executable)
@@ -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();
                }
                
index a1646e10c67259f8f8d1ae7a43bbdbb6d4b20385..91e580143ebca0a63be2698f1c7bf0ddd3f72edc 100644 (file)
@@ -3143,6 +3143,7 @@ Wenn {if LANGUAGE_USE_INFORMAL_VARIANT}du{else}Sie{/if} unter „Konfiguration 
                <item name="wcf.acp.user.disable"><![CDATA[Deaktivieren]]></item>
                <item name="wcf.acp.user.enable"><![CDATA[Aktivieren]]></item>
                <item name="wcf.acp.user.quickSearch.disabled"><![CDATA[Nicht aktivierte Benutzer]]></item>
+               <item name="wcf.acp.user.quickSearch.pendingActivation"><![CDATA[Benutzer die auf Freischaltung warten]]></item>
                <item name="wcf.acp.user.quickSearch.disabledAvatars"><![CDATA[Gesperrte Avatare]]></item>
                <item name="wcf.acp.user.quickSearch.disabledSignatures"><![CDATA[Gesperrte Signaturen]]></item>
                <item name="wcf.acp.user.usersAwaitingApprovalInfo"><![CDATA[<a href="{link controller='UserQuickSearch'}mode=disabled{/link}">{#$usersAwaitingApproval} Benutzer</a> {if $usersAwaitingApproval == 1}wartet auf seine{else}warten auf ihre{/if} Aktivierung.]]></item>
index 8b365ef0a2b853efda413f3ce1c5c577bd25b115..b61535a7cafe3df1c8e0a142e185ac31d8305057 100644 (file)
@@ -3069,10 +3069,11 @@ You can define the default sender in “Configuration » Options » General » E
                <item name="wcf.acp.user.disableSignature.neverExpires"><![CDATA[Permanently Block]]></item>
                <item name="wcf.acp.user.disable"><![CDATA[Disable]]></item>
                <item name="wcf.acp.user.enable"><![CDATA[Approve]]></item>
-               <item name="wcf.acp.user.quickSearch.disabled"><![CDATA[Users awaiting approval]]></item>
+               <item name="wcf.acp.user.quickSearch.disabled"><![CDATA[Disabled Users]]></item>
+               <item name="wcf.acp.user.quickSearch.pendingActivation"><![CDATA[Users awaiting approval]]></item>
                <item name="wcf.acp.user.quickSearch.disabledAvatars"><![CDATA[Blocked avatars]]></item>
                <item name="wcf.acp.user.quickSearch.disabledSignatures"><![CDATA[Blocked signatures]]></item>
-               <item name="wcf.acp.user.usersAwaitingApprovalInfo"><![CDATA[<a href="{link controller='UserQuickSearch'}mode=disabled{/link}">{#$usersAwaitingApproval} User{if $usersAwaitingApproval != 1}s{/if}</a> {if $usersAwaitingApproval == 1}is{else}are{/if} awaiting your approval.]]></item>
+               <item name="wcf.acp.user.usersAwaitingApprovalInfo"><![CDATA[<a href="{link controller='UserQuickSearch'}mode=pendingActivation{/link}">{#$usersAwaitingApproval} User{if $usersAwaitingApproval != 1}s{/if}</a> {if $usersAwaitingApproval == 1}is{else}are{/if} awaiting your approval.]]></item>
                <item name="wcf.acp.user.search.conditions.state.enabled"><![CDATA[Approved]]></item>
                <item name="wcf.acp.user.search.conditions.state.disabled"><![CDATA[Awaiting Approval]]></item>
                <item name="wcf.acp.user.sendNewPassword.mail.subject"><![CDATA[New Password for your Account for Website: {@PAGE_TITLE|language}]]></item>